Bug 14134 - Make "Holds over" show holds expiring tomorrow if ExpireReservesMaxPickUp...
authorKyle M Hall <kyle@bywatersolutions.com>
Tue, 8 Jul 2014 15:49:50 +0000 (10:49 -0500)
committerBrendan Gallagher <brendan@bywatersolutions.com>
Wed, 2 Mar 2016 04:46:06 +0000 (04:46 +0000)
If ExpireReservesMaxPickUpDelay is enabled, the "holds over" tab becomes
useless. It would be nice if the "holds over" tab would display
*tomorrow's* "holds over" so the librarian can see what will be
automatically canceled over night.

Test Plan:
1) Apply this patch
2) Enable ExpireReservesMaxPickUpDelay
3) Note the "holds over" list now displays holds that will have been
   waiting more than the number of days defined in ReservesMaxPickUpDelay
   as of tomorrow.

Signed-off-by: Jason Burds <JBurds@dubuque.lib.ia.us>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
circ/waitingreserves.pl
koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt

index 268213a..0050ce3 100755 (executable)
@@ -85,6 +85,9 @@ my @getreserves = $all_branches ? GetReservesForBranch() : GetReservesForBranch(
 # get reserves for the branch we are logged into, or for all branches
 
 my $today = Date_to_Days(&Today);
+my $max_pickup_delay = C4::Context->preference('ReservesMaxPickUpDelay');
+$max_pickup_delay-- if C4::Context->preference('ExpireReservesMaxPickUpDelay');
+
 foreach my $num (@getreserves) {
     next unless ($num->{'waitingdate'} && $num->{'waitingdate'} ne '0000-00-00');
 
@@ -105,9 +108,10 @@ foreach my $num (@getreserves) {
     my $itemtypeinfo = getitemtypeinfo( $gettitle->{'itemtype'} );  # using the fixed up itype/itemtype
     $getreserv{'waitingdate'} = $num->{'waitingdate'};
     my ( $waiting_year, $waiting_month, $waiting_day ) = split (/-/, $num->{'waitingdate'});
+
     ( $waiting_year, $waiting_month, $waiting_day ) =
       Add_Delta_Days( $waiting_year, $waiting_month, $waiting_day,
-        C4::Context->preference('ReservesMaxPickUpDelay'));
+        $max_pickup_delay);
     my $calcDate = Date_to_Days( $waiting_year, $waiting_month, $waiting_day );
 
     $getreserv{'itemtype'}       = $itemtypeinfo->{'description'};
@@ -157,7 +161,7 @@ $template->param(
     overloop    => \@overloop,
     overcount   => $overcount,
     show_date   => output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }),
-    ReservesMaxPickUpDelay => C4::Context->preference('ReservesMaxPickUpDelay')
+    ReservesMaxPickUpDelay => $max_pickup_delay,
 );
 
 if ($item && $tab eq 'holdsover') {
index 1028033..5c871fe 100644 (file)
     [% ELSE %]
         <div id="resultlist" class="toptabs">
             <ul>
-                <li><a href="#holdswaiting">[% reservecount %] Hold(s) waiting</a></li>
-                <li><a href="#holdsover">[% overcount %] Hold(s) over</a></li>
+                <li><a href="#holdswaiting">Holds waiting: [% reservecount %]</a></li>
+                <li>
+                    <a href="#holdsover">
+                        Holds waiting over [% ReservesMaxPickUpDelay %] days: [% overcount %]
+                    </a>
+                </li>
             </ul>
             <div id="holdswaiting">
             [% IF ( reserveloop ) %]