From: Chris Cormack Date: Mon, 14 Dec 2009 01:07:21 +0000 (+1300) Subject: Fixing bug with CanBookBeReserved ... rules for default borrower codes were being... X-Git-Tag: v3.02.00-alpha~45^2~102 X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=7a4f725c8b9e8cc7e2b47cb1fe42f972119292db;p=koha.git Fixing bug with CanBookBeReserved ... rules for default borrower codes were being ignored --- diff --git a/C4/Reserves.pm b/C4/Reserves.pm index 031ca32358..d98b838ed4 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -352,7 +352,7 @@ sub CanBookBeReserved{ my @args; my $rightsquery = "SELECT categorycode, itemtype, branchcode, reservesallowed FROM issuingrules - WHERE categorycode = ?"; + WHERE categorycode IN (?, '*')"; push @args,$borrower->{categorycode}; if($controlbranch eq "ItemHomeLibrary"){ @@ -370,7 +370,6 @@ sub CanBookBeReserved{ } $rightsquery .= " ORDER BY categorycode DESC, itemtype DESC, branchcode DESC"; - my $sthrights = $dbh->prepare($rightsquery); $sthrights->execute(@args); @@ -405,7 +404,6 @@ sub CanBookBeReserved{ if(my $row = $sthcount->fetchrow_hashref()){ $reservescount = $row->{count}; } - if($reservescount < $reservesrights){ return 1; }else{