@@ -, +, @@ modification template - Apply the patch and go to Tools -> Batch patron modification. - Submit a batch of patrons for modification. - Confirm that the checkbox next to any required field is disabled. - Select a date in the registration date and expiry date fields. Confirm that the "Clear" link next to each empties the correct field. - Click "New" next to a patron attibute. A copy of the patron attribute line should be created. - Click "Delete" next to a cloned patron attribute. The correct line should be removed. --- .../prog/en/modules/tools/modborrowers.tt | 25 ++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt @@ -60,7 +60,20 @@ $('select[name="patron_attributes"]').change(); - } ); + $(".clear-date").on("click",function(e){ + e.preventDefault(); + var fieldID = this.id.replace("clear-date-",""); + $("#" + fieldID).val(""); + }); + $("#cataloguing_additem_newitem").on("click",".add_attributes",function(e){ + e.preventDefault(); + add_attributes(); + }); + $("#cataloguing_additem_newitem").on("click",".del_attributes",function(e){ + e.preventDefault(); + del_attributes(this); + }); + }); function updateAttrValues (select_attr) { var attr_code = $(select_attr).val(); @@ -86,8 +99,8 @@ function add_attributes() { var li_node = $("li.attributes:last"); var li_clone = $(li_node).clone(); - if ( $(li_clone).find("a.delete").length == 0 ) { - $(li_clone).append(' Delete'); + if ( $(li_clone).find("a.del_attributes").length == 0 ) { + $(li_clone).append(' Delete'); } $(li_clone).find('select[name="patron_attributes"]').change(function() { updateAttrValues(this); @@ -337,7 +350,7 @@ [% END %] [% IF field.mandatory %] - + [% ELSE %] [% END %] @@ -357,7 +370,7 @@ [% END %] [% IF ( field.type == 'date' ) %] - Clear + Clear [% END %] [% IF field.mandatory %] Required fields cannot be cleared @@ -375,7 +388,7 @@ - New + New [% END %] --