From 230e51eb20fb1642319ec7508acd4322461a1c92 Mon Sep 17 00:00:00 2001 From: Nahuel ANGELINETTI Date: Fri, 11 Dec 2009 09:53:34 +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 | 5 ++++- reserve/request.pl | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl index 194a28e2c8..846a59e1fe 100755 --- a/opac/opac-reserve.pl +++ b/opac/opac-reserve.pl @@ -331,7 +331,10 @@ foreach my $biblioitemnumber (@biblioitemnumbers) { # If there is no loan, return and transfer, we show a checkbox. $item->{notforloan} = $item->{notforloan} || 0; - my $branchitemrule = GetBranchItemRule( $borr->{'branchcode'}, $item->{'itemtype'} ); + my $branch = C4::Circulation::_GetCircControlBranch($item, $borr); + + my $branchitemrule = GetBranchItemRule( $branch, $item->{'itemtype'} ); + my $policy_holdallowed = 1; if ( $branchitemrule->{'holdallowed'} == 0 || diff --git a/reserve/request.pl b/reserve/request.pl index 67ef180974..63b735d05a 100755 --- a/reserve/request.pl +++ b/reserve/request.pl @@ -344,8 +344,9 @@ foreach my $biblioitemnumber (@biblioitemnumbers) { } } + my $branch = C4::Circulation::_GetCircControlBranch($item, $borr); - my $branchitemrule = GetBranchItemRule( $item->{'homebranch'}, $item->{'itype'} ); + my $branchitemrule = GetBranchItemRule( $branch, $item->{'itype'} ); my $policy_holdallowed = 1; $item->{'holdallowed'} = $branchitemrule->{'holdallowed'}; -- 2.20.1