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