Bugzilla – Attachment 2660 Details for
Bug 2965
Allow the user to specify due dates in the past
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Fix
0001-Bug-2965-Allow-due-date-in-the-past.patch (text/plain), 5.07 KB, created by
Srdjan Jankovic
on 2010-10-04 01:45:21 UTC
(
hide
)
Description:
Fix
Filename:
MIME Type:
Creator:
Srdjan Jankovic
Created:
2010-10-04 01:45:21 UTC
Size:
5.07 KB
patch
obsolete
>From 6521b8d33b3b2223148f952fd782802e222077c8 Mon Sep 17 00:00:00 2001 >From: Srdjan Jankovic <srdjan@catalyst.net.nz> >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) { > <input type="hidden" name="borrowernumber" value="<!-- TMPL_VAR NAME="borrowernumber" -->" /> > <input type="hidden" name="issueconfirmed" value="1" /> > <!-- TMPL_IF NAME="DEBT" --><input type="hidden" name="debt_confirmed" value="1" /><!-- /TMPL_IF --> >+ <!-- TMPL_IF NAME="INVALID_DATE" --> >+ <p> >+ <input type="text" size="10" id="duedatespec" name="duedatespec" value="<!-- TMPL_VAR NAME="duedatespec" -->" /> >+ <label for="duedatespec">Due Date</label> >+ </p> >+ <!-- TMPL_ELSE --> > <input type="hidden" name="duedatespec" value="<!-- TMPL_VAR NAME="duedatespec" -->" /> >+ <!-- /TMPL_IF --> > <input type="hidden" name="stickyduedate" value="<!-- TMPL_VAR NAME="stickyduedate" -->" /> > <input type="hidden" name="branch" value="<!-- TMPL_VAR NAME="branch" -->" /> > <input type="submit" class="approve" value="Yes, Check Out (Y)" accesskey="y" /> >@@ -420,7 +427,7 @@ No patron matched <span class="ex"><!-- TMPL_VAR name="message" --></span> > <!-- TMPL_IF NAME="NEEDSCONFIRMATION" --> > <input type="text" name="barcode" id="barcode" class="barcode focus" size="14" disabled="disabled" /> > <!-- TMPL_ELSE --> >- <input type="text" name="barcode" id="barcode" class="barcode focus" size="14" /> >+ <!-- TMPL_IF NAME="barcode" -->><input type="text" name="barcode" id="barcode" class="barcode focus" size="14" value="<!-- TMPL_VAR NAME="barcode" -->"/><!-- TMPL_ELSE --><input type="text" name="barcode" id="barcode" class="barcode focus" size="14" /><!-- /TMPL_IF --> > <!-- /TMPL_IF --> > <input type="submit" value="Check Out" /> > >@@ -449,8 +456,8 @@ No patron matched <span class="ex"><!-- TMPL_VAR name="message" --></span> > inputField : "duedatespec", > ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->", > button : "CalendarDueDate", >- disableFunc : validate1, >- dateStatusFunc : validate1, >+// disableFunc : validate1, >+// dateStatusFunc : validate1, > onClose : refocus > } > ); >-- >1.6.5 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 2965
: 2660