Lines 370-382
sub GetItemsAvailableToFillHoldRequestsForBib {
Link Here
|
370 |
|
370 |
|
371 |
=cut |
371 |
=cut |
372 |
|
372 |
|
|
|
373 |
our $libraries = { map { $_->branchcode => $_ } Koha::Libraries->search()->as_list() }; |
373 |
sub _checkHoldPolicy { |
374 |
sub _checkHoldPolicy { |
374 |
my ($item, $request) = @_; |
375 |
my ($item, $request) = @_; |
375 |
|
376 |
|
376 |
return 0 unless $item->{holdallowed}; |
377 |
return 0 unless $item->{holdallowed}; |
377 |
return 0 if $item->{holdallowed} == 1 && $item->{homebranch} ne $request->{borrowerbranch}; |
378 |
return 0 if $item->{holdallowed} == 1 && $item->{homebranch} ne $request->{borrowerbranch}; |
378 |
|
379 |
|
379 |
my $library = Koha::Libraries->find($item->{homebranch}); |
380 |
my $library = $libraries->{$item->{homebranch}}; |
380 |
|
381 |
|
381 |
return 0 if $item->{'holdallowed'} == 3 && !$library->validate_hold_sibling({branchcode => $request->{borrowerbranch}}); |
382 |
return 0 if $item->{'holdallowed'} == 3 && !$library->validate_hold_sibling({branchcode => $request->{borrowerbranch}}); |
382 |
|
383 |
|
Lines 386-392
sub _checkHoldPolicy {
Link Here
|
386 |
return 0 if $hold_fulfillment_policy eq 'homebranch' && $request->{branchcode} ne $item->{$hold_fulfillment_policy}; |
387 |
return 0 if $hold_fulfillment_policy eq 'homebranch' && $request->{branchcode} ne $item->{$hold_fulfillment_policy}; |
387 |
return 0 if $hold_fulfillment_policy eq 'holdingbranch' && $request->{branchcode} ne $item->{$hold_fulfillment_policy}; |
388 |
return 0 if $hold_fulfillment_policy eq 'holdingbranch' && $request->{branchcode} ne $item->{$hold_fulfillment_policy}; |
388 |
|
389 |
|
389 |
my $patronLibrary = Koha::Libraries->find($request->{borrowerbranch}); |
390 |
my $patronLibrary = $libraries->{$request->{borrowerbranch}}; |
390 |
|
391 |
|
391 |
return 0 if $hold_fulfillment_policy eq 'patrongroup' && !patronLibrary->validate_hold_sibling({branchcode => $request->{branchcode}}); |
392 |
return 0 if $hold_fulfillment_policy eq 'patrongroup' && !patronLibrary->validate_hold_sibling({branchcode => $request->{branchcode}}); |
392 |
|
393 |
|
393 |
- |
|
|