From 4d1762f5ec451729d74e3fa6282e1726a0a74969 Mon Sep 17 00:00:00 2001 From: Srdjan Jankovic Date: Mon, 13 Dec 2010 22:34:07 +0100 Subject: [PATCH] Bug 2965: Allow due date in the past Raise warning rather than disallowing Remove due date js validation when checking out Signed-off-by: Katrin Fischer Fixed small error in circulation.tmpl Signed-off-by: Chris Cormack --- C4/Circulation.pm | 9 +++++++-- circ/circulation.pl | 12 ++++++------ .../intranet-tmpl/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 c5ac344770..0131e90e0b 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -650,7 +650,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 @@ -688,7 +688,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 bed119102c..c4421edc06 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -146,13 +146,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 ca93a31554..fc27cfa9b3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl @@ -258,7 +258,14 @@ function refocus(calendar) { " /> + +

+ " /> + +

+ " /> + " /> " /> @@ -411,7 +418,7 @@ No patron matched - + >"/> @@ -440,8 +447,8 @@ No patron matched inputField : "duedatespec", ifFormat : "", button : "CalendarDueDate", - disableFunc : validate1, - dateStatusFunc : validate1, +// disableFunc : validate1, +// dateStatusFunc : validate1, onClose : refocus } ); -- 2.11.0