From 8b2c91e570b3929634468f876e9af38234d1d462 Mon Sep 17 00:00:00 2001 From: Eivin Giske Skaaren Date: Mon, 25 May 2015 17:10:54 +0000 Subject: [PATCH] Bug 10067 - decreaseLoanHighHolds messes with specify due date To test: 1. On a branch up to date with master: apply the patch. 2. Try to check out items both with and without holds. (The decreaseLoanHighHolds function should be configured and kick in when testing an item. 3. Expected results are: The due date date field should be cleared after checkout if "Remember for session" is not selected. If it is selected then the chosen date should stay in the field even if the warning about reduced loan time for an item with too many holds is displayed. Also the correct due dates are shown in the table after a checkout. Known limitation: Does not work too well when jumping between different parts of the system as it relies on the values sent to the circulation.pl script. Sponsored-by: Halland County Library Refactored to both fix specific issue where date is changed and still have the old behaviour with date kept intact. Rebase Remove code whitespace cleanup Remove one more code whitespace cleanup --- circ/circulation.pl | 13 +++++++++++-- .../prog/en/modules/circ/circulation.tt | 18 ++++++++++-------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index 8b2d8d8..6d4436c 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -56,7 +56,6 @@ use Date::Calc qw( ); use List::MoreUtils qw/uniq/; - # # PARAMETERS READING # @@ -123,7 +122,6 @@ my $borrowernumber = $query->param('borrowernumber'); $branch = C4::Context->userenv->{'branch'}; $printer = C4::Context->userenv->{'branchprinter'}; - # If AutoLocation is not activated, we show the Circulation Parameters to chage settings of librarian if (C4::Context->preference("AutoLocation") != 1) { $template->param(ManualLocation => 1); @@ -139,6 +137,7 @@ $barcode =~ s/^\s*|\s*$//g; # remove leading/trailing whitespace $barcode = barcodedecode($barcode) if( $barcode && C4::Context->preference('itemBarcodeInputFilter')); my $stickyduedate = $query->param('stickyduedate') || $session->param('stickyduedate'); my $duedatespec = $query->param('duedatespec') || $session->param('stickyduedate'); +my $restoreduedatespec = $query->param('restoreduedatespec') || $session->param('stickyduedate'); my $issueconfirmed = $query->param('issueconfirmed'); my $cancelreserve = $query->param('cancelreserve'); my $print = $query->param('print') || q{}; @@ -519,6 +518,15 @@ my $roadtype = C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $borrower->{stree $template->param(%$borrower); +# Restore date if changed by holds +if ($restoreduedatespec) { + $duedatespec = $restoreduedatespec; + + if ($stickyduedate eq 'on') { + $session->param( 'stickyduedate', $duedatespec ); + } +} + $template->param( lib_messages_loop => $lib_messages_loop, bor_messages_loop => $bor_messages_loop, @@ -537,6 +545,7 @@ $template->param( barcode => $barcode, stickyduedate => $stickyduedate, duedatespec => $duedatespec, + restoreduedatespec => $restoreduedatespec, message => $message, totaldue => sprintf('%.2f', $total), inprocess => $inprocess, 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 6d9e5ad..799ec54 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -311,13 +311,15 @@ $(document).ready(function() { [% IF HIGHHOLDS %] [% END %] [% IF CAN_user_circulate_force_checkout or HIGHHOLDS %]
+ [% IF (forceallow) %][% END %] @@ -362,6 +364,7 @@ $(document).ready(function() { [% IF ( RESERVED ) %] + @@ -371,6 +374,7 @@ $(document).ready(function() { [% IF ( RESERVE_WAITING ) %] + @@ -380,8 +384,10 @@ $(document).ready(function() { [% IF (forceallow) %][% END %] + + [% IF CAN_user_circulate_force_checkout or HIGHHOLDS %] [% IF ( RENEW_ISSUE ) %] @@ -430,6 +436,7 @@ $(document).ready(function() {
[% IF (forceallow) %][% END %] + @@ -541,11 +548,11 @@ No patron matched [% message %] [% END %] - [% IF ( borrowers ) %] [% INCLUDE 'patron-toolbar.inc' %] +
Patron selection @@ -596,8 +603,8 @@ No patron matched [% message %] [% END %] - + [% IF ( issue ) %]
[% ELSE %] @@ -781,8 +788,6 @@ No patron matched [% message %] [% END %] - - @@ -850,7 +855,6 @@ No patron matched [% message %] [% END %] - @@ -964,8 +968,6 @@ No patron matched [% message %] [% END %] - - [% UNLESS ( borrowers ) %][% IF ( borrowernumber ) %]
-- 1.7.10.4