From d00e8be6c34f34fe9366829de09f5125b81a948e Mon Sep 17 00:00:00 2001 From: Paul Poulain Date: Wed, 15 Dec 2010 13:33:51 +0100 Subject: [PATCH] Bug 5875 : waitingreserves highlighting now depends on maxpickupdate --- circ/waitingreserves.pl | 32 ++++++++------- .../prog/en/includes/reserves_waiting.inc | 44 ++++++++++++++++++++ 2 files changed, 61 insertions(+), 15 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/reserves_waiting.inc diff --git a/circ/waitingreserves.pl b/circ/waitingreserves.pl index 0183f19..c1843db 100755 --- a/circ/waitingreserves.pl +++ b/circ/waitingreserves.pl @@ -26,6 +26,7 @@ use C4::Branch; # GetBranchName use C4::Auth; use C4::Dates qw/format_date/; use C4::Circulation; +use C4::Reserves; # qw/GetMaxPickUpDelay/; use C4::Members; use C4::Biblio; use C4::Items; @@ -112,14 +113,23 @@ foreach my $num (@getreserves) { $gettitle->{'itemtype'} = C4::Context->preference('item-level_itypes') ? $gettitle->{'itype'} : $gettitle->{'itemtype'}; my $getborrower = GetMemberDetails( $num->{'borrowernumber'} ); my $itemtypeinfo = getitemtypeinfo( $gettitle->{'itemtype'} ); # using the fixed up itype/itemtype - $getreserv{'waitingdate'} = format_date( $num->{'waitingdate'} ); + if ($num->{waitingdate}){ + my @maxpickupdate=GetMaxPickupDate($num->{'waitingdate'},$borrowernumber, $num); + $getreserv{'waitingdate'} = format_date( $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')); - my $calcDate = Date_to_Days( $waiting_year, $waiting_month, $waiting_day ); + $getreserv{'maxpickupdate'} = sprintf("%d-%02d-%02d", @maxpickupdate); + my $calcDate = Date_to_Days( @maxpickupdate ); + + if ( $today > $calcDate ) { + $getreserv{'messcompa'} = 1; + push @overloop, \%getreserv; + $overcount++; + } else { + push @reservloop, \%getreserv; + $reservcount++; + } + } $getreserv{'itemtype'} = $itemtypeinfo->{'description'}; $getreserv{'title'} = $gettitle->{'title'}; $getreserv{'itemnumber'} = $gettitle->{'itemnumber'}; @@ -128,6 +138,7 @@ foreach my $num (@getreserves) { $getreserv{'homebranch'} = GetBranchName($gettitle->{'homebranch'}); $getreserv{'holdingbranch'} = $gettitle->{'holdingbranch'}; $getreserv{'itemcallnumber'} = $gettitle->{'itemcallnumber'}; + if ( $gettitle->{'homebranch'} ne $gettitle->{'holdingbranch'} ) { $getreserv{'dotransfer'} = 1; } @@ -138,15 +149,6 @@ foreach my $num (@getreserves) { if ( $getborrower->{'emailaddress'} ) { $getreserv{'borrowermail'} = $getborrower->{'emailaddress'}; } - - if ($today > $calcDate) { - push @overloop, \%getreserv; - $overcount++; - }else{ - push @reservloop, \%getreserv; - $reservcount++; - } - } $template->param( diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/reserves_waiting.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/reserves_waiting.inc new file mode 100644 index 0000000..f3cf244 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/reserves_waiting.inc @@ -0,0 +1,44 @@ + + +
"> +

Hold Found: ">

+

Notes:

+
Hold for:
+ + +

Transfer to:

+ +

Hold at

+ +
" class="confirm"> + + + &biblionumber=&op=slip'); $('#reserve').hide(); return false;" /> + + + &biblionumber=&op=slip'); $('#reserve').hide(); return false;" /> + + " /> + " /> + " /> + " /> + " /> + " /> + " /> +
+
+ + + + -- 1.7.1