From 6521b8d33b3b2223148f952fd782802e222077c8 Mon Sep 17 00:00:00 2001 From: Srdjan Jankovic Date: Mon, 4 Oct 2010 14:22:39 +1300 Subject: [PATCH] Bug 2965: Allow due date in the past Raise warning rather than disallowing Remove due date js validation when checking out --- C4/Circulation.pm | 9 +++++++-- circ/circulation.pl | 12 ++++++------ .../prog/en/modules/circ/circulation.tmpl | 13 ++++++++++--- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 644ab27..1962d57 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -641,7 +641,7 @@ reserved for someone else. =head3 INVALID_DATE -sticky due date is invalid +sticky due date is invalid or due date in the past =head3 TOO_MANY @@ -679,7 +679,12 @@ sub CanBookBeIssued { # Offline circ calls AddIssue directly, doesn't run through here # So issuingimpossible should be ok. } - $issuingimpossible{INVALID_DATE} = $duedate->output('syspref') unless ( $duedate && $duedate->output('iso') ge C4::Dates->today('iso') ); + if ($duedate) { + $needsconfirmation{INVALID_DATE} = $duedate->output('syspref') + unless $duedate->output('iso') ge C4::Dates->today('iso'); + } else { + $issuingimpossible{INVALID_DATE} = $duedate->output('syspref'); + } # # BORROWER STATUS diff --git a/circ/circulation.pl b/circ/circulation.pl index 4b67920..4a79695 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -142,13 +142,13 @@ if($duedatespec_allow){ if ($duedatespec) { if ($duedatespec =~ C4::Dates->regexp('syspref')) { my $tempdate = C4::Dates->new($duedatespec); - if ($tempdate and $tempdate->output('iso') gt C4::Dates->new()->output('iso')) { - # i.e., it has to be later than today/now +# if ($tempdate and $tempdate->output('iso') gt C4::Dates->new()->output('iso')) { +# # i.e., it has to be later than today/now $datedue = $tempdate; - } else { - $invalidduedate = 1; - $template->param(IMPOSSIBLE=>1, INVALID_DATE=>$duedatespec); - } +# } else { +# $invalidduedate = 1; +# $template->param(IMPOSSIBLE=>1, INVALID_DATE=>$duedatespec); +# } } else { $invalidduedate = 1; $template->param(IMPOSSIBLE=>1, INVALID_DATE=>$duedatespec); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl index 980d195..73bc536 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl @@ -267,7 +267,14 @@ function refocus(calendar) { " /> + +

+ " /> + +

+ " /> + " /> " /> @@ -420,7 +427,7 @@ No patron matched - + >"/> @@ -449,8 +456,8 @@ No patron matched inputField : "duedatespec", ifFormat : "", button : "CalendarDueDate", - disableFunc : validate1, - dateStatusFunc : validate1, +// disableFunc : validate1, +// dateStatusFunc : validate1, onClose : refocus } ); -- 1.6.5