From a53515084f77d5c423ffe3645f78aaca05cb2c5b 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 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. Signed-off-by: Nick Clemens Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- koha-tmpl/intranet-tmpl/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 ddec2b593f..c51c8f1a4c 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 ) %] @@ -295,7 +301,7 @@ function checkMultiHold() {
[% END %] - + [% IF ( multi_hold ) %] @@ -347,14 +353,14 @@ function checkMultiHold() {
  • - Clear date + Clear date
  • [% END %]
  • - Clear date + Clear date
  • [% UNLESS ( multi_hold ) %] @@ -483,7 +489,7 @@ function checkMultiHold() { [% IF ( bibitemloo.hiddencount ) %] -

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

    +

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

    [% END %] [% END %] -- 2.11.0