From 2a73ced61d02a2a06a5aa570bbf149eb1e620faa Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 7 Nov 2012 09:41:03 -0500 Subject: [PATCH] Bug 8972 - Due Date set to 100 years ago In order to prevent submission of dates with ambiguous two-digit years this patch makes date-due input fields read-only so that users must use date/time picker. Other minor fixes: - Adding missing labels - Adding common class wrapper to datepicker for checkout and renewal - Correcting focus handling on "specify due date" field (should focus on barcode field after a date has been selected). - Removing trailing comma from JavaScript (breaks IE) To test, try typing an invalid number in any of the date due entry fields: Under 'specify due date,' 'renewal due date,' or the confirm "invalid" date dialog (after specifying a date in the past). Manual entry should not work. Choosing a date/time using the widget should work. Signed-off-by: Melia Meggs Signed-off-by: Paul Poulain Signed-off-by: Jared Camins-Esakov --- .../intranet-tmpl/prog/en/css/staff-global.css | 17 +++++++++-------- .../prog/en/includes/checkouts-table-footer.inc | 6 +++--- .../prog/en/modules/circ/circulation.tt | 14 +++++++++----- .../prog/en/modules/members/moremember.tt | 7 ++++++- 4 files changed, 27 insertions(+), 17 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css index 3cfbb9b0cf..e66c349687 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css +++ b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css @@ -1008,18 +1008,19 @@ tr.confirm td, tr.highlight.confirm td { margin: .2em 0; } -#circ_circulation_issue .date-select { - font-size : 85%; - padding-top : .3em; +.date-select { + font-size : 85%; + padding-top : .3em; } -#circ_circulation_issue .date-select label { - font-size : inherit; - font-weight: normal; +#circ_circulation_issue .date-select label, +.date-select label { + font-size : inherit; + font-weight: normal; } -#circ_circulation_issue .date-select input { - padding : 1px; +.date-select input { + padding : 1px; } tr.expired td { diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc index f2edfd6cc7..90c4cb2e77 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc @@ -3,10 +3,10 @@ Totals: [% totaldue %] [% totalprice %] - -

Renewal due date: +

+

-

+

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 652cbf87e0..ee3a66662c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -160,11 +160,15 @@ var allcheckboxes = $(".checkboxed"); $("#exportmenuc").empty(); initExportButton(); - $("#newduedate").datepicker({ minDate: 1 }); // require that renewal date is after today + $("#newduedate").datetimepicker({ + minDate: 1, // require that renewal date is after today + hour: 23, + minute: 59 + }); $("#duedatespec").datetimepicker({ - onSelect: function(dateText, inst) { $("#barcode").focus(); }, + onClose: function(dateText, inst) { $("#barcode").focus(); }, hour: 23, - minute: 59, + minute: 59 }); }); @@ -399,7 +403,7 @@ function validate1(date) { [% IF ( DEBT ) %][% END %] [% IF ( INVALID_DATE ) %]

- +

[% ELSE %] @@ -577,7 +581,7 @@ No patron matched [% message %] [% IF ( SpecifyDueDate ) %]
Specify due date [% INCLUDE 'date-format.inc' %]:
- [% IF ( duedatespec ) %][% ELSE %] + [% IF ( duedatespec ) %][% ELSE %] [% END %] [% IF ( stickyduedate ) %] 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 abbf26ff96..4e6271f792 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -11,6 +11,7 @@ [% INCLUDE 'calendar.inc' %] +