@@ -, +, @@ a) check two of the items out to patrons b) set one of the items as a waiting hold c) leave the fourth item as available --- C4/Reserves.pm | 12 +++--------- C4/Search.pm | 2 +- 2 files changed, 4 insertions(+), 10 deletions(-) --- a/C4/Reserves.pm +++ a/C4/Reserves.pm @@ -852,9 +852,9 @@ sub GetReservesForBranch { =head2 GetReserveStatus - $reservestatus = GetReserveStatus($itemnumber, $biblionumber); + $reservestatus = GetReserveStatus($itemnumber); -Take an itemnumber or a biblionumber and return the status of the reserve places on it. +Takes an itemnumber and returns the status of the reserve placed on it. If several reserves exist, the reserve with the lower priority is given. =cut @@ -864,7 +864,7 @@ If several reserves exist, the reserve with the lower priority is given. ## multiple reserves for that bib can have the itemnumber set ## the sub is only used once in the codebase. sub GetReserveStatus { - my ($itemnumber, $biblionumber) = @_; + my ($itemnumber) = @_; my $dbh = C4::Context->dbh; @@ -875,12 +875,6 @@ sub GetReserveStatus { ($found, $priority) = $sth->fetchrow_array; } - if ( $biblionumber and not defined $found and not defined $priority ) { - $sth = $dbh->prepare("SELECT found, priority FROM reserves WHERE biblionumber = ? order by priority LIMIT 1"); - $sth->execute($biblionumber); - ($found, $priority) = $sth->fetchrow_array; - } - if(defined $found) { return 'Waiting' if $found eq 'W' and $priority == 0; return 'Finished' if $found eq 'F'; --- a/C4/Search.pm +++ a/C4/Search.pm @@ -2147,7 +2147,7 @@ sub searchResults { # should map transit status to record indexed in Zebra. # ($transfertwhen, $transfertfrom, $transfertto) = C4::Circulation::GetTransfers($item->{itemnumber}); - $reservestatus = C4::Reserves::GetReserveStatus( $item->{itemnumber}, $oldbiblio->{biblionumber} ); + $reservestatus = C4::Reserves::GetReserveStatus( $item->{itemnumber} ); } # item is withdrawn, lost, damaged, not for loan, reserved or in transit --