From 23e74b97c2541c1710d071d7329bf0874d15ec9b 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 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. --- koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt | 9 ++++++++- koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt | 10 ++++++++-- 2 files changed, 16 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 93c60ae..0099edf 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -109,6 +109,13 @@ $(document).ready(function() { } }); + $("#suspend_until").datepicker({ + onClose: function(dateText, inst) { + validate_date(dateText, inst); + }, + minDate: 1, // require that hold suspended until date is after today + }); + }); //]]> @@ -900,7 +907,7 @@ No patron matched [% message %] [% 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 961d4c0..2009300 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -82,7 +82,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 + }); + }); function uncheck_sibling(me){ nodename=me.getAttribute("name"); @@ -489,7 +495,7 @@ function validate1(date) { [% IF AutoResumeSuspendedHolds %] - + Specify date on which to resume [% INCLUDE 'date-format.inc' %]: [% END %] -- 2.1.0