Bugzilla – Attachment 42794 Details for
Bug 10067
decreaseLoanHighHolds messes with specify due date
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10067 - decreaseLoanHighHolds messes with specify due date
Bug-10067---decreaseLoanHighHolds-messes-with-spec.patch (text/plain), 8.04 KB, created by
Eivin Giske Skaaren
on 2015-09-22 16:28:59 UTC
(
hide
)
Description:
Bug 10067 - decreaseLoanHighHolds messes with specify due date
Filename:
MIME Type:
Creator:
Eivin Giske Skaaren
Created:
2015-09-22 16:28:59 UTC
Size:
8.04 KB
patch
obsolete
>From c679bb363ae0085b47caa08f3ce0145a2ebe79f9 Mon Sep 17 00:00:00 2001 >From: Eivin Giske Skaaren <eskaaren@yahoo.no> >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 > >Removed duplicate tag > >Refactored stickyduedate session parameter >--- > circ/circulation.pl | 18 +++++++++++------- > .../prog/en/modules/circ/circulation.tt | 17 +++++++++-------- > 2 files changed, 20 insertions(+), 15 deletions(-) > >diff --git a/circ/circulation.pl b/circ/circulation.pl >index 8b2d8d8..c7a3330 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 and/or save stickyduedate to session >+if ($restoreduedatespec || $stickyduedate) { >+ $duedatespec = $restoreduedatespec || $duedatespec; >+ >+ if ($stickyduedate) { >+ $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, >@@ -553,11 +562,6 @@ $template->param( > relatives_borrowernumbers => \@relatives, > ); > >-# save stickyduedate to session >-if ($stickyduedate) { >- $session->param( 'stickyduedate', $duedatespec ); >-} >- > my ($picture, $dberror) = GetPatronImage($borrower->{'borrowernumber'}); > $template->param( picture => 1 ) if $picture; > >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 064e308..40ad45b 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 %] > <script language="JavaScript" type="text/javascript"> > $(document).ready(function() { >- $("input[name=duedatespec]:hidden").val('[% HIGHHOLDS.returndate %]'); >+ $("input[name=duedatespec]:hidden").val('[% HIGHHOLDS.returndate %]'); >+ $("input[name=restoreduedatespec]:hidden").val('[% duedatespec %]'); > }); > </script> > [% END %] > > [% IF CAN_user_circulate_force_checkout or HIGHHOLDS %] > <form method="post" action="/cgi-bin/koha/circ/circulation.pl" autocomplete="off"> >+ <input type="hidden" name="restoreduedatespec" /> > > [% IF (forceallow) %]<input type="hidden" name="forceallow" value="1">[% END %] > >@@ -362,6 +364,7 @@ $(document).ready(function() { > > [% IF ( RESERVED ) %] > <form method="get" action="/cgi-bin/koha/circ/circulation.pl"> >+ <input type="hidden" name="restoreduedatespec" /> > <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" /> > <input type="hidden" name="duedatespec" value="[% duedatespec %]" /> > <input type="hidden" name="stickyduedate" value="[% stickyduedate %]" /> >@@ -371,6 +374,7 @@ $(document).ready(function() { > > [% IF ( RESERVE_WAITING ) %] > <form method="get" action="/cgi-bin/koha/circ/circulation.pl"> >+ <input type="hidden" name="restoreduedatespec" /> > <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" /> > <input type="hidden" name="duedatespec" value="[% duedatespec %]" /> > <input type="hidden" name="stickyduedate" value="[% stickyduedate %]" /> >@@ -382,6 +386,7 @@ $(document).ready(function() { > [% IF (forceallow) %]<input type="hidden" name="forceallow" value="1">[% END %] > <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" /> > <input type="hidden" name="duedatespec" value="[% duedatespec %]" /> >+ <input type="hidden" name="restoreduedatespec" /> > <input type="hidden" name="stickyduedate" value="[% stickyduedate %]" /> > [% IF CAN_user_circulate_force_checkout or HIGHHOLDS %] > [% IF ( RENEW_ISSUE ) %] >@@ -430,6 +435,7 @@ $(document).ready(function() { > <br /> > <form method="post" action="/cgi-bin/koha/circ/circulation.pl" autocomplete="off"> > [% IF (forceallow) %]<input type="hidden" name="forceallow" value="1">[% END %] >+ <input type="hidden" name="restoreduedatespec" /> > <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" /> > <input type="hidden" name="duedatespec" value="[% duedatespec %]" /> > <input type="hidden" name="stickyduedate" value="[% stickyduedate %]" /> >@@ -541,11 +547,11 @@ No patron matched <span class="ex">[% message %]</span> > </h4> > [% END %] > >- > [% IF ( borrowers ) %] > [% INCLUDE 'patron-toolbar.inc' %] > > <form method="post" action="/cgi-bin/koha/circ/circulation.pl" id="mainform" name="mainform" autocomplete="off"> >+ <input type="hidden" name="restoreduedatespec" /> > <fieldset id="circ_circulation_selectborrower" class="brief"> > <legend>Patron selection</legend> > >@@ -601,8 +607,8 @@ No patron matched <span class="ex">[% message %]</span> > > [% END %] > >- > <form method="post" action="/cgi-bin/koha/circ/circulation.pl" id="mainform" name="mainform" autocomplete="off"> >+ <input type="hidden" name="restoreduedatespec" /> > [% IF ( issue ) %] > <fieldset id="circ_circulation_issue" class="lastchecked"> > [% ELSE %] >@@ -786,8 +792,6 @@ No patron matched <span class="ex">[% message %]</span> > </li> > [% END %] > >- >- > </ul> > </div> > >@@ -855,7 +859,6 @@ No patron matched <span class="ex">[% message %]</span> > <!-- /If flagged -->[% END %] > > >- > </div> > </div> > >@@ -971,8 +974,6 @@ No patron matched <span class="ex">[% message %]</span> > </div></div> > [% END %] > >- >- > </div> > </div> > [% UNLESS ( borrowers ) %][% IF ( borrowernumber ) %]<div class="yui-b"> >-- >1.7.10.4
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 10067
:
39466
|
39491
|
40707
|
41012
|
42127
|
42128
|
42259
|
42437
|
42438
|
42750
|
42791
|
42793
|
42794
|
44290
|
44291
|
44292
|
44300
|
44301
|
44908