From 6fc8d02995b7c5c085c913bde6af3fcd24536107 Mon Sep 17 00:00:00 2001 From: Emmi Date: Fri, 5 Jul 2019 11:46:15 +0300 Subject: [PATCH] Bug 23268: Make "Suspend all holds" calendar select a date from tomorrow This patch removes "circulation" and moremember" templates functions for Datepicker plugin. They now use options common for all inputs with "datepicker" class and get "minDate" option from class "futuredate" assigned function in "calender.inc". To test: - Apply patch - Add holds for patron - Use "Suspend all holds" calendar =>Calendar greys out dates past from today Signed-off-by: David Roberts Signed-off-by: Jonathan Druart Signed-off-by: Martin Renvoize --- koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc | 4 ++++ .../intranet-tmpl/prog/en/modules/circ/circulation.tt | 9 +-------- .../prog/en/modules/members/moremember.tt | 10 +--------- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc index 1cd41e2961..9b266b61a9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc @@ -176,6 +176,10 @@ $("#dateofbirth").datepicker({ yearRange: "c-100:c" }); + $(".futuredate").datepicker({ + minDate: 1, // require that hold suspended until date is after today + }); + $( ".datepicker" ).datepicker({ onClose: function(dateText, inst) { validate_date(dateText, inst); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index e969656152..718ad01ee5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -940,7 +940,7 @@ [% IF Koha.Preference('AutoResumeSuspendedHolds') %] - + Specify date on which to resume [% INCLUDE 'date-format.inc' %]: [% END %] @@ -1122,13 +1122,6 @@ toggle_onsite_checkout(); }); - $("#suspend_until").datepicker({ - onClose: function(dateText, inst) { - validate_date(dateText, inst); - }, - minDate: 1, // require that hold suspended until date is after today - }); - [% IF HIGHHOLDS %] [% IF !override_high_holds %] $("input[name=duedatespec]:hidden").val('[% HIGHHOLDS.returndate | html %]'); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt index cfc2a0ab23..f8ec612d47 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -812,7 +812,7 @@ [% IF Koha.Preference('AutoResumeSuspendedHolds') %] - + Specify date on which to resume [% INCLUDE 'date-format.inc' %]: [% END %] @@ -927,14 +927,6 @@ "bPaginate": false })); - $("#suspend_until").datepicker({ - onClose: function(dateText, inst) { - validate_date(dateText, inst); - }, - minDate: 1, // require that hold suspended until date is after today - }).on("change", function(e, value) { - if ( ! is_valid_date( $(this).val() ) ) {$(this).val("");} - }); $("#view_restrictions").on("click",function(){ $('#debarments-tab-link').click(); -- 2.39.5