From 2d9a27a881f0992e8bc76474ed2e96f43981ac37 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 17 Sep 2014 14:48:49 -0400 Subject: [PATCH] Bug 12893 - 'Clear date' links on start and expiration hold date in staff not working Content-Type: text/plain; charset="utf-8" I introduced this bug with my patch for Bug 8181. In changing the way the date picker widgets worked I changed the ID the "clear date" javascript was looking for, so it stopped working. This patch corrects it and improves the JavaScript by moving it out of the HTML markup. This patch also makes some minor HTML validity corrections: escaping ampersands and removing a "size" attribute from a hidden form field. To test, you should have the AllowHoldDateInFuture system preference enabled. Place a hold in the staff client for a patron and confirm that you can choose a "hold starts on" date and a "hold expires on" date and that the respective "clear date" links work correctly for each one. --- .../prog/en/modules/reserve/request.tt | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt index 60551f4..212f47f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt @@ -136,6 +136,12 @@ function checkMultiHold() { } }); + $(".clear-date").on("click",function(e){ + e.preventDefault(); + var fieldID = this.id.replace("clear-date-",""); + $("#" + fieldID).val(""); + }); + $('#hold-request-form').preventDoubleFormSubmit(); [% UNLESS ( borrowernumber || borrower_list || noitems ) %] @@ -292,7 +298,7 @@ function checkMultiHold() {
[% END %] - + [% IF ( multi_hold ) %] @@ -344,14 +350,14 @@ function checkMultiHold() {
  • - Clear date + Clear date
  • [% END %]
  • - Clear date + Clear date
  • [% UNLESS ( multi_hold ) %] @@ -480,7 +486,7 @@ function checkMultiHold() { [% IF ( bibitemloo.hiddencount ) %] -

    Show all items ([% bibitemloo.hiddencount %] hidden)

    +

    Show all items ([% bibitemloo.hiddencount %] hidden)

    [% END %] [% END %] -- 1.7.9.5