From 0c3b750f1af64c201d26428d8eacbedd03f925e7 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 Signed-off-by: Joy Nelson --- 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 e6f12ddce0..85ec55b7ad 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc @@ -173,6 +173,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 5a4bbefcb8..62b7fd1709 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 cee725ea37..e9935edea1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -807,7 +807,7 @@ [% IF Koha.Preference('AutoResumeSuspendedHolds') %] - + Specify date on which to resume [% INCLUDE 'date-format.inc' %]: [% END %] @@ -921,14 +921,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