From 2a0c82652b13b357389e14ad2d3c5bfb1b671797 Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Sat, 1 May 2010 00:19:53 +0200 Subject: [PATCH] (bug #4319) allow reserves on waiting items This add a function to check the reserve status, and add a check in IsAvailableForItemLevelRequest() to allow request on items that are waiting Conflicts solved: C4/Reserves.pm Signed-off-by: Henri-Damien LAURENT Signed-off-by: Galen Charlton --- C4/Reserves.pm | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index 6328d174fd..e347295da9 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -100,7 +100,8 @@ BEGIN { &GetReserveCount &GetReserveFee &GetReserveInfo - + &GetReserveStatus + &GetOtherReserves &ModReserveFill @@ -780,6 +781,18 @@ sub GetReservesForBranch { return (@transreserv); } +sub GetReserveStatus { + my ($itemnumber) = @_; + + my $dbh = C4::Context->dbh; + + my $itemstatus = $dbh->prepare("SELECT found FROM reserves WHERE itemnumber = ?"); + + $itemstatus->execute($itemnumber); + my ($found) = $itemstatus->fetchrow_array; + return $found; +} + =item CheckReserves ($status, $reserve) = &CheckReserves($itemnumber); @@ -1415,7 +1428,7 @@ sub IsAvailableForItemLevelRequest { if (C4::Context->preference('AllowOnShelfHolds')) { return $available_per_item; } else { - return ($available_per_item and $item->{onloan}); + return ($available_per_item and ($item->{onloan} or GetReserveStatus($itemnumber) eq "W")); } } -- 2.39.5