From 8141c40a111c130f267a9905f7b2213b8143058b Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 19 Feb 2014 11:08:24 -0500 Subject: [PATCH] [PASSED QA] Bug 3766 - Cities/Towns and Road Types only on one address MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When adding a new patron only the primary contact city/state fields are linked to a dropdown listing values from stored city/state/zip/country values. The same dropdown of predefined values should be linked to alternate address and alternate contact. This patch does so by adapting the same JS and markup for these additional cases. To test you should have cities defined in Administration -> Cities. - Edit or create a new patron. - Under main address -> city select one of the predefined entries. - The city, state, zip, and country values should be correctly populated. - Test under alternate address -> city and alternate contact -> city. - Save your changes and confirm that everything worked correctly. Works as expected Signed-off-by: Marc VĂ©ron Signed-off-by: Katrin Fischer This works nicely, passes all tests and QA script. --- .../prog/en/modules/members/memberentrygen.tt | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt index 469bbbd..628ed41 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -25,6 +25,22 @@ document.form.state.value=RegExp.$3; document.form.country.value=RegExp.$4; }); + $("#select_B_city").change(function(){ + var myRegEx=new RegExp(/(.*)\|(.*)\|(.*)\|(.*)/); + document.form.select_B_city.value.match(myRegEx); + document.form.B_zipcode.value=RegExp.$1; + document.form.B_city.value=RegExp.$2; + document.form.B_state.value=RegExp.$3; + document.form.B_country.value=RegExp.$4; + }); + $("#select_altcity").change(function(){ + var myRegEx=new RegExp(/(.*)\|(.*)\|(.*)\|(.*)/); + document.form.select_altcity.value.match(myRegEx); + document.form.altcontactzipcode.value=RegExp.$1; + document.form.altcontactaddress3.value=RegExp.$2; + document.form.altcontactstate.value=RegExp.$3; + document.form.altcontactcountry.value=RegExp.$4; + }); $(".clearDupe").on("focus",function(){ $(this).val(""); }) @@ -687,6 +703,19 @@ [% END %] City: + [% IF ( city_cgipopup ) %]or choose + + [% END %] [% IF ( mandatoryB_city ) %]Required[% END %] [% END %] @@ -826,6 +855,19 @@ [% END %] City: + [% IF ( city_cgipopup ) %]or choose + + [% END %] [% IF ( mandatoryaltcontactaddress3 ) %]Required[% END %] [% END %] -- 1.8.3.2