[Koha-patches] [PATCH 61/92] (bug #3897) hold policies and circcontrol

Henri-Damien LAURENT henridamien.laurent at biblibre.com
Tue Dec 22 01:20:54 CET 2009


From: Nahuel ANGELINETTI <nahuel.angelinetti at biblibre.com>

This patch fix hold policies way to do, make it using circcontrol syspref to know the branch the rule must be based.
---
 opac/opac-reserve.pl |    4 +++-
 reserve/request.pl   |    4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl
index c5b665b..be3c77a 100755
--- a/opac/opac-reserve.pl
+++ b/opac/opac-reserve.pl
@@ -426,7 +426,9 @@ foreach my $biblioNum (@biblionumbers) {
         # If there is no loan, return and transfer, we show a checkbox.
         $itemLoopIter->{notforloan} = $itemLoopIter->{notforloan} || 0;
 
-        my $branchitemrule = GetBranchItemRule( $borr->{'branchcode'}, $itemInfo->{'itype'} );
+        my $branch = C4::Circulation::_GetCircControlBranch($itemLoopIter, $borr);
+
+        my $branchitemrule = GetBranchItemRule( $branch, $itemInfo->{'itype'} );
         my $policy_holdallowed = 1;
 
         if ( $branchitemrule->{'holdallowed'} == 0 ||
diff --git a/reserve/request.pl b/reserve/request.pl
index 26e229f..908a626 100755
--- a/reserve/request.pl
+++ b/reserve/request.pl
@@ -397,7 +397,9 @@ foreach my $biblionumber (@biblionumbers) {
                 }
             }
             
-            my $branchitemrule = GetBranchItemRule( $item->{'homebranch'}, $item->{'itype'} );
+            my $branch = C4::Circulation::_GetCircControlBranch($item, $borrowerinfo);
+
+            my $branchitemrule = GetBranchItemRule( $branch, $item->{'itype'} );
             my $policy_holdallowed = 1;
             
             $item->{'holdallowed'} = $branchitemrule->{'holdallowed'};
-- 
1.6.3.3



More information about the Koha-patches mailing list