Bug 38459: Ensure cities field works in patron quick add

This patch adjust the selector for quick add and updates the change event for the city
dropdown to affect quickadd fields as well

To test:
 1 - Administration->Cities and towns
 2 - Define several cities
 3 - http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=PatronQuickAddFields
 4 - Select city,state, zipcode and some other fields
 5 - Patrons->Quick add new patron
 6 - Note city field/dropdown does not show
 7 - Apply patch
 8 - Reload
 9 - City dropdown shows!
10 - State and zip are updated when city is selected!
11 - Celebrate!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b007966f44)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
Nick Clemens 2024-11-15 14:53:40 +00:00 committed by Paul Derscheid
parent c69e7864f6
commit dc765520c1
No known key found for this signature in database
GPG Key ID: C25F9FD44CED595B
2 changed files with 5 additions and 5 deletions

View File

@ -2043,7 +2043,7 @@ legend.collapsed i.fa.fa-caret-down::before {
});
new_field.appendTo("#quick_add_list");
} else {
let orig_input_id = orig_li.children("input,textarea,select").attr("id");
let orig_input_id = orig_li.children("input,textarea,select").last().attr("id");
if ( orig_input_id ) {
let new_field = orig_li.clone();
new_field.children("#"+orig_input_id).attr("id",orig_input_id + "_quick_add");

View File

@ -225,10 +225,10 @@ $(document).ready(function(){
var addressfield = $(this).data("addressfield");
var myRegEx=new RegExp(/(.*)\|(.*)\|(.*)\|(.*)/);
var matches = selected_city.match( myRegEx );
$("#" + addressfield + "zipcode").val( matches[1] );
$("#" + addressfield + "city").val( matches[2] );
$("#" + addressfield + "state").val( matches[3] );
$("#" + addressfield + "country").val( matches[4] );
$("#" + addressfield + "zipcode,#" + addressfield + "zipcode_quick_add").val( matches[1] );
$("#" + addressfield + "city,#" + addressfield + "city_quick_add").val( matches[2] );
$("#" + addressfield + "state,#" + addressfield + "state_quick_add").val( matches[3] );
$("#" + addressfield + "country,#" + addressfield + "country_quick_add").val( matches[4] );
});
dateformat = $("#dateofbirth").siblings(".hint").first().html();