From c0edb3adefa2bab526ba7d4721d1bfd122b62a5f Mon Sep 17 00:00:00 2001 From: Nahuel ANGELINETTI Date: Fri, 11 Dec 2009 10:16:46 +0100 Subject: [PATCH] (bug #3897) hold policies and circcontrol 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 c5b665bc68..be3c77ae1e 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 26e229f9a6..908a626b24 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'}; -- 2.39.5