View | Details | Raw Unified | Return to bug 27068
Collapse All | Expand All

(-)a/C4/HoldsQueue.pm (-11 / +3 lines)
Lines 370-397 sub GetItemsAvailableToFillHoldRequestsForBib { Link Here
370
370
371
=cut
371
=cut
372
372
373
our $libraries = {};
374
sub _checkHoldPolicy {
373
sub _checkHoldPolicy {
375
    my ($item, $request) = @_;
374
    my ($item, $request) = @_;
376
375
377
    return 0 unless $item->{holdallowed};
376
    return 0 unless $item->{holdallowed};
378
    return 0 if $item->{holdallowed} == 1 && $item->{homebranch} ne $request->{borrowerbranch};
377
    return 0 if $item->{holdallowed} == 1 && $item->{homebranch} ne $request->{borrowerbranch};
379
378
380
    $libraries->{$item->{homebranch}} ||= Koha::Libraries->find($item->{homebranch});
379
    return 0 if $item->{'holdallowed'} == 3 && !Koha::Libraries->find($item->{homebranch})->validate_hold_sibling({branchcode => $request->{borrowerbranch}});
381
    my $library = $libraries->{$item->{homebranch}};
382
383
    return 0 if $item->{'holdallowed'} == 3 && !$library->validate_hold_sibling({branchcode => $request->{borrowerbranch}});
384
380
385
    my $hold_fulfillment_policy = $item->{hold_fulfillment_policy};
381
    my $hold_fulfillment_policy = $item->{hold_fulfillment_policy};
386
382
387
    return 0 if $hold_fulfillment_policy eq 'holdgroup' && !$library->validate_hold_sibling({branchcode => $request->{branchcode}});
383
    return 0 if $hold_fulfillment_policy eq 'holdgroup' && !Koha::Libraries->find($item->{homebranch})->validate_hold_sibling({branchcode => $request->{branchcode}});
388
    return 0 if $hold_fulfillment_policy eq 'homebranch' && $request->{branchcode} ne $item->{$hold_fulfillment_policy};
384
    return 0 if $hold_fulfillment_policy eq 'homebranch' && $request->{branchcode} ne $item->{$hold_fulfillment_policy};
389
    return 0 if $hold_fulfillment_policy eq 'holdingbranch' && $request->{branchcode} ne $item->{$hold_fulfillment_policy};
385
    return 0 if $hold_fulfillment_policy eq 'holdingbranch' && $request->{branchcode} ne $item->{$hold_fulfillment_policy};
390
386
391
    $libraries->{$request->{borrowerbranch}} ||= Koha::Libraries->find($request->{borrowerbranch});
387
    return 0 if $hold_fulfillment_policy eq 'patrongroup' && !Koha::Libraries->find($request->{borrowerbranch})->validate_hold_sibling({branchcode => $request->{branchcode}});
392
    my $patronLibrary = $libraries->{$request->{borrowerbranch}};
393
394
    return 0 if $hold_fulfillment_policy eq 'patrongroup' && !$patronLibrary->validate_hold_sibling({branchcode => $request->{branchcode}});
395
388
396
    return 1;
389
    return 1;
397
390
398
- 

Return to bug 27068