Bug 15644 - City dropdown default selection when modifying a patron matches only on city

This patch modifies the include files which contain the form fields for
city, state, zipcode, etc. shown on the patron entry screen. The files
are modified so that the city/state/zip <select> preselects a value
based on city, state, and zipcode matching the values in the
corresponding text fields.

To test, confirm that the bug's steps to reproduce are fixed:

- Enter two cities via Administration -> Patrons and circulation
  -> Cities and towns:
    Springfield, MA 01101
    Springfield, VT 05156
- Edit a patron choosing, Springfield VT, and save.
- Edit the patron again and confirm that the correct city is
  pre-selected.
- Confirm this result with all three different settings of the
  "AddressFormat" system preference.

Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 83704cb1fa)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Owen Leonard 2017-06-08 16:01:32 +00:00 committed by Fridolin Somers
parent b3884ec092
commit 8cd8df1948
3 changed files with 3 additions and 3 deletions

View File

@ -84,7 +84,7 @@
<select id="select_city" name="select_city">
<option value="|||"></option>
[% FOREACH c IN cities %]
[% IF c.city_name == city %]
[% IF c.city_name == city && c.city_state == state && c.city_zipcode == zipcode %]
<option value="[% c.city_zipcode %]|[% c.city_name %]|[% c.city_state %]|[% c.city_country %]" selected="selected">
[% ELSE %]
<option value="[% c.city_zipcode %]|[% c.city_name %]|[% c.city_state %]|[% c.city_country %]">

View File

@ -83,7 +83,7 @@
<select id="select_city" name="select_city">
<option value="|||"></option>
[% FOREACH c IN cities %]
[% IF c.city_name == city %]
[% IF c.city_name == city && c.city_state == state && c.city_zipcode == zipcode %]
<option value="[% c.city_zipcode %]|[% c.city_name %]|[% c.city_state %]|[% c.city_country %]" selected="selected">
[% ELSE %]
<option value="[% c.city_zipcode %]|[% c.city_name %]|[% c.city_state %]|[% c.city_country %]">

View File

@ -72,7 +72,7 @@
<select id="select_city" name="select_city">
<option value="|||"></option>
[% FOREACH c IN cities %]
[% IF c.city_name == city %]
[% IF c.city_name == city && c.city_state == state && c.city_zipcode == zipcode %]
<option value="[% c.city_zipcode %]|[% c.city_name %]|[% c.city_state %]|[% c.city_country %]" selected="selected">
[% ELSE %]
<option value="[% c.city_zipcode %]|[% c.city_name %]|[% c.city_state %]|[% c.city_country %]">