Lines 459-469
sub CanItemBeReserved {
Link Here
|
459 |
return { status => 'cannotReserveFromOtherBranches' }; |
459 |
return { status => 'cannotReserveFromOtherBranches' }; |
460 |
} |
460 |
} |
461 |
|
461 |
|
462 |
my $branch_control = C4::Context->preference('HomeOrHoldingBranch'); |
462 |
my $item_library = Koha::Libraries->find( {branchcode => $item->homebranch} ); |
463 |
my $itembranchcode = $branch_control eq 'holdingbranch' ? $item->holdingbranch : $item->homebranch; |
|
|
464 |
my $item_library = Koha::Libraries->find( {branchcode => $itembranchcode} ); |
465 |
if ( $branchitemrule->{holdallowed} == 3) { |
463 |
if ( $branchitemrule->{holdallowed} == 3) { |
466 |
if($borrower->{branchcode} ne $itembranchcode && !$item_library->validate_hold_sibling( {branchcode => $borrower->{branchcode}} )) { |
464 |
if($borrower->{branchcode} ne $item->homebranch && !$item_library->validate_hold_sibling( {branchcode => $borrower->{branchcode}} )) { |
467 |
return { status => 'branchNotInHoldGroup' }; |
465 |
return { status => 'branchNotInHoldGroup' }; |
468 |
} |
466 |
} |
469 |
} |
467 |
} |
Lines 811-817
sub CheckReserves {
Link Here
|
811 |
my $branchitemrule = C4::Circulation::GetBranchItemRule($branch,$item->effective_itemtype); |
809 |
my $branchitemrule = C4::Circulation::GetBranchItemRule($branch,$item->effective_itemtype); |
812 |
next if ($branchitemrule->{'holdallowed'} == 0); |
810 |
next if ($branchitemrule->{'holdallowed'} == 0); |
813 |
next if (($branchitemrule->{'holdallowed'} == 1) && ($branch ne $patron->branchcode)); |
811 |
next if (($branchitemrule->{'holdallowed'} == 1) && ($branch ne $patron->branchcode)); |
814 |
my $library = Koha::Libraries->find({branchcode=>$branch}); |
812 |
my $library = Koha::Libraries->find({branchcode=>$item->homebranch}); |
815 |
next if (($branchitemrule->{'holdallowed'} == 3) && (!$library->validate_hold_sibling({branchcode => $patron->branchcode}) )); |
813 |
next if (($branchitemrule->{'holdallowed'} == 3) && (!$library->validate_hold_sibling({branchcode => $patron->branchcode}) )); |
816 |
my $hold_fulfillment_policy = $branchitemrule->{hold_fulfillment_policy}; |
814 |
my $hold_fulfillment_policy = $branchitemrule->{hold_fulfillment_policy}; |
817 |
next if ( ($hold_fulfillment_policy eq 'holdgroup') && (!$library->validate_hold_sibling({branchcode => $res->{branchcode}})) ); |
815 |
next if ( ($hold_fulfillment_policy eq 'holdgroup') && (!$library->validate_hold_sibling({branchcode => $res->{branchcode}})) ); |
Lines 1224-1232
sub IsAvailableForItemLevelRequest {
Link Here
|
1224 |
foreach my $i (@items) { |
1222 |
foreach my $i (@items) { |
1225 |
my $reserves_control_branch = GetReservesControlBranch( $i->unblessed(), $patron->unblessed ); |
1223 |
my $reserves_control_branch = GetReservesControlBranch( $i->unblessed(), $patron->unblessed ); |
1226 |
my $branchitemrule = C4::Circulation::GetBranchItemRule( $reserves_control_branch, $i->itype ); |
1224 |
my $branchitemrule = C4::Circulation::GetBranchItemRule( $reserves_control_branch, $i->itype ); |
1227 |
my $branch_control = C4::Context->preference('HomeOrHoldingBranch'); |
1225 |
my $item_library = Koha::Libraries->find( {branchcode => $i->homebranch} ); |
1228 |
my $itembranchcode = $branch_control eq 'holdingbranch' ? $item->holdingbranch : $item->homebranch; |
|
|
1229 |
my $item_library = Koha::Libraries->find( {branchcode => $itembranchcode} ); |
1230 |
|
1226 |
|
1231 |
|
1227 |
|
1232 |
$any_available = 1 |
1228 |
$any_available = 1 |
Lines 1239-1245
sub IsAvailableForItemLevelRequest {
Link Here
|
1239 |
&& !C4::Context->preference('AllowHoldsOnDamagedItems') ) |
1235 |
&& !C4::Context->preference('AllowHoldsOnDamagedItems') ) |
1240 |
|| Koha::ItemTypes->find( $i->effective_itemtype() )->notforloan |
1236 |
|| Koha::ItemTypes->find( $i->effective_itemtype() )->notforloan |
1241 |
|| $branchitemrule->{holdallowed} == 1 && $patron->branchcode ne $i->homebranch |
1237 |
|| $branchitemrule->{holdallowed} == 1 && $patron->branchcode ne $i->homebranch |
1242 |
|| $branchitemrule->{holdallowed} == 3 && !$item_library->validate_hold_sibling( {branchcode => $pickup_branchcode} ); |
1238 |
|| $branchitemrule->{holdallowed} == 3 && !$item_library->validate_hold_sibling( {branchcode => $patron->branchcode} ); |
1243 |
} |
1239 |
} |
1244 |
|
1240 |
|
1245 |
return $any_available ? 0 : 1; |
1241 |
return $any_available ? 0 : 1; |
1246 |
- |
|
|