Bug 18597 - Quick add form does not transfer patron attributes values when switching forms/saving

The function that switches between quick add/fulll form assumes labels
are followed by values - patron_attr don't follow this pattern. This
patch just moves the hidden input field

To test:
1 - Have some patron attributes (with/without auth values set)
2 - Add them to QuickAddFields (patron_attr2 for example)
3 - view quick add form and set some values
4 - Switch to full form, values not transferred
5 - Switch to quick add, view values, save
6 - Values are not saved :-(
7 - Apply patch
8 - Repeat 3 - 5
9 - Values are transferred and saved :-)

Signed-off-by: Peggy Thrasher <p.thrasher@dover.nh.gov>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
Nick Clemens 2017-05-12 10:00:29 -04:00 committed by Kyle M Hall
parent 49253ace12
commit 48c87a19a6

View file

@ -1107,7 +1107,6 @@ $(document).ready(function() {
[% FOREACH patron_attribute IN pa_loo.items %]
<li data-category_code="[% patron_attribute.category_code %]">
<label for="[% patron_attribute.form_id %]">[% patron_attribute.description %]: </label>
<input type="hidden" id="[% patron_attribute.form_id %]_code" name="[% patron_attribute.form_id %]_code" value="[% patron_attribute.code |html %]" />
[% IF ( patron_attribute.use_dropdown ) %]
<select id="[% patron_attribute.form_id %]" name="[% patron_attribute.form_id %]">
<option value=""></option>
@ -1126,6 +1125,7 @@ $(document).ready(function() {
[% ELSE %]
<textarea rows="2" cols="30" id="[% patron_attribute.form_id %]" name="[% patron_attribute.form_id %]">[% patron_attribute.value %]</textarea>
[% END %]
<input type="hidden" id="[% patron_attribute.form_id %]_code" name="[% patron_attribute.form_id %]_code" value="[% patron_attribute.code |html %]" />
<a href="#" onclick="clear_entry(this); return false;"><i class="fa fa-fw fa-trash"></i> Clear</a>
[% IF ( patron_attribute.repeatable ) %]
<a href="#" onclick="clone_entry(this); return false;"><i class="fa fa-fw fa-plus"></i> New</a>