From eb2c966e48fc93306b13f1667fc42823e0f8aab3 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 25 May 2010 11:44:46 -0400 Subject: [PATCH] BugFix 4812 - Reserves for a specific copy of a book say book is available even though it it still checked out When you place a reserve on a specific copy of a book a note is immediately put on the card of the person for whom the book is being reserved that says the book is available even though it is still checked out to someone else. The code is in placerequest.pl & opac-reserve.pl holdingbranch if ($checkitem ne ''){ $rank[0] = '0' unless C4::Context->preference('ReservesNeedReturns'); my $item = $checkitem; $item = GetItem($item); if ( $item->{'holdingbranch'} eq $branch ){ $found = 'W' unless C4::Context->preference('ReservesNeedReturns'); } } This code does not bother to check to see if an item is actually on the shelf, it sets it to 'W' reguardless. --- opac/opac-reserve.pl | 2 +- reserve/placerequest.pl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl index d5d39db..876001f 100755 --- a/opac/opac-reserve.pl +++ b/opac/opac-reserve.pl @@ -200,7 +200,7 @@ if ( $query->param('place_reserve') ) { $rank = '0' unless C4::Context->preference('ReservesNeedReturns'); my $item = GetItem($itemNum); if ( $item->{'holdingbranch'} eq $branch ){ - $found = 'W' unless C4::Context->preference('ReservesNeedReturns'); + $found = 'W' unless ( C4::Context->preference('ReservesNeedReturns') || GetItemIssue($itemNum) ); } } else { diff --git a/reserve/placerequest.pl b/reserve/placerequest.pl index 36f8ecd..6ad78ab 100755 --- a/reserve/placerequest.pl +++ b/reserve/placerequest.pl @@ -75,7 +75,7 @@ if ($checkitem ne ''){ my $item = $checkitem; $item = GetItem($item); if ( $item->{'holdingbranch'} eq $branch ){ - $found = 'W' unless C4::Context->preference('ReservesNeedReturns'); + $found = 'W' unless ( C4::Context->preference('ReservesNeedReturns') || GetItemIssue($checkitem) ); } } -- 1.5.6.5