From 9cfee957dbdba479c96dfdce80095b91a628757b Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 27 Apr 2015 10:39:14 +0200 Subject: [PATCH] Bug 14060: Add OnClose event on missing datepicker MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The "suspend until" inputs (hold list on circ/circulation.pl and members/moremember.pl) were not set in the same way. The minDate option should be set for both (bug 10703 removed it for circ/circulation.pl). This patch reintroduces the option and add the OnClose event on both. Signed-off-by: Owen Leonard Signed-off-by: Nick Clemens Signed-off-by: Kyle M Hall (cherry picked from commit d53fb6db6a0cb0d239e7849c902a3dce4966c709) Signed-off-by: Frédéric Demians --- .../intranet-tmpl/prog/en/modules/circ/circulation.tt | 10 +++++++++- .../prog/en/modules/members/moremember.tt | 10 ++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) 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 0ccc638662..260b518ba7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -108,6 +108,14 @@ $(document).ready(function() { $("#onsite_checkout").click(function(){ 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 + }); + }); //]]> @@ -986,7 +994,7 @@ No patron matched [% message | html %] [% IF AutoResumeSuspendedHolds %] - + Specify date on which to resume [% INCLUDE 'date-format.inc' %]: [% END %] 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 50baebec90..7d9a08ec1b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -84,7 +84,13 @@ $(document).ready(function() { return confirm(_("Are you sure you want to replace the current patron image? This cannot be undone.")); });[% END %] - $("#suspend_until").datepicker({ minDate: 1 }); // require that hold suspended until date is after today + $("#suspend_until").datepicker({ + onClose: function(dateText, inst) { + validate_date(dateText, inst); + }, + minDate: 1, // require that hold suspended until date is after today + }); + $("#view_restrictions").on("click",function(){ $('#debarments-tab-link').click(); }); @@ -537,7 +543,7 @@ function validate1(date) { [% IF AutoResumeSuspendedHolds %] - + Specify date on which to resume [% INCLUDE 'date-format.inc' %]: [% END %] -- 2.39.5