From 1a8481051c562315db9bfe0509ed68eeefd26d65 Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Wed, 5 Nov 2014 20:00:39 +1300 Subject: [PATCH] [PASSED QA] Bug 12892 : Alternate fix to restore the deleted code This doesn't depend on anything other patch. 1. Create a reservation for a Borrower with pickup branch 2. Check-in the corresponding Item in the pickup branch and confirm the hold for the Borrower 3. Go to circ/circulation.pl for the Borrower and verify that the reservation is "Waiting for pickup" 4. In the Borrower -> Check Out -tab (circ/circulation.pl) on the right of the big "Checking out to borrowername" should be a notification about holds ready for pickup. Signed-off-by: Martin Renvoize Signed-off-by: Rafal Kopaczka Signed-off-by: Katrin Fischer Passes all tests and QA script, restores the old code and behaviour. --- circ/circulation.pl | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index 2a1f211..2cf88b8 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -390,8 +390,33 @@ if ($borrowernumber) { $template->param( holds_count => Koha::Database->new()->schema()->resultset('Reserve') ->count( { borrowernumber => $borrowernumber } ) ); - - $template->param( adultborrower => 1 ) if ( $borrower->{'category_type'} eq 'A' ); + my @borrowerreserv = GetReservesFromBorrowernumber($borrowernumber); + + my @WaitingReserveLoop; + foreach my $num_res (@borrowerreserv) { + if ( $num_res->{'found'} && $num_res->{'found'} eq 'W' ) { + my $getiteminfo = GetBiblioFromItemNumber( $num_res->{'itemnumber'} ); + my $itemtypeinfo = getitemtypeinfo( (C4::Context->preference('item-level_itypes')) ? $getiteminfo->{'itype'} : $getiteminfo->{'itemtype'} ); + my %getWaitingReserveInfo; + $getWaitingReserveInfo{title} = $getiteminfo->{'title'}; + $getWaitingReserveInfo{biblionumber} = + $getiteminfo->{'biblionumber'}; + $getWaitingReserveInfo{itemtype} = $itemtypeinfo->{'description'}; + $getWaitingReserveInfo{author} = $getiteminfo->{'author'}; + $getWaitingReserveInfo{itemcallnumber} = + $getiteminfo->{'itemcallnumber'}; + $getWaitingReserveInfo{reservedate} = + format_date( $num_res->{'reservedate'} ); + $getWaitingReserveInfo{waitingat} = + GetBranchName( $num_res->{'branchcode'} ); + $getWaitingReserveInfo{waitinghere} = 1 + if $num_res->{'branchcode'} eq $branch; + push( @WaitingReserveLoop, \%getWaitingReserveInfo ); + } + } + $template->param( WaitingReserveLoop => \@WaitingReserveLoop ); + $template->param( adultborrower => 1 ) + if ( $borrower->{'category_type'} eq 'A' ); } my @values; -- 1.9.1