From 6af1ca0759e8da8751895f78aa982b5ff6f9dec6 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 8 Jul 2014 10:49:50 -0500 Subject: [PATCH] Bug 14134 - Make "Holds over" show holds expiring tomorrow if ExpireReservesMaxPickUpDelay is set 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 Signed-off-by: Jonathan Druart Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com --- circ/waitingreserves.pl | 8 ++++++-- .../intranet-tmpl/prog/en/modules/circ/waitingreserves.tt | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/circ/waitingreserves.pl b/circ/waitingreserves.pl index 268213a523..0050ce3ac5 100755 --- a/circ/waitingreserves.pl +++ b/circ/waitingreserves.pl @@ -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') { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt index 1028033514..5c871fe033 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt @@ -71,8 +71,12 @@ [% ELSE %]