[Koha-patches] [PATCH] Bug 2394: Use syspref canreservefromotherbranches in CanItemBeReserved
Srdjan
srdjan at catalyst.net.nz
Wed Jul 17 02:11:06 CEST 2013
From: Julian Maurice <julian.maurice at biblibre.com>
Signed-off-by: Srdjan <srdjan at catalyst.net.nz>
---
C4/Reserves.pm | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/C4/Reserves.pm b/C4/Reserves.pm
index c8b0cdd..87ffaff 100644
--- a/C4/Reserves.pm
+++ b/C4/Reserves.pm
@@ -491,11 +491,22 @@ sub CanItemBeReserved{
}
# we check if it's ok or not
- if( $reservecount < $allowedreserves ){
- return 1;
- }else{
+ if( $reservecount >= $allowedreserves ){
return 0;
}
+
+ # If reservecount is ok, we check item branch if IndependantBranches is ON
+ # and canreservefromotherbranches is OFF
+ if ( C4::Context->preference('IndependantBranches')
+ and !C4::Context->preference('canreservefromotherbranches') )
+ {
+ my $itembranch = $item->{homebranch};
+ if ($itembranch ne $borrower->{branchcode}) {
+ return 0;
+ }
+ }
+
+ return 1;
}
#--------------------------------------------------------------------------------
=head2 GetReserveCount
--
1.8.1.2
More information about the Koha-patches
mailing list