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

(-)a/C4/Reserves.pm (-3 / +12 lines)
Lines 347-352 sub CanBookBeReserved{ Link Here
347
    my $patron = Koha::Patrons->find( $borrowernumber );
347
    my $patron = Koha::Patrons->find( $borrowernumber );
348
    while ( my $item = $items->next ) {
348
    while ( my $item = $items->next ) {
349
        $canReserve = CanItemBeReserved( $patron, $item, $pickup_branchcode, $params );
349
        $canReserve = CanItemBeReserved( $patron, $item, $pickup_branchcode, $params );
350
        if ( C4::Context->interface eq 'opac' ) {
351
            my $opacitemholds = $canReserve->{rights}->{opacitemholds} // 'Y';
352
            return { status => 'recordHoldNotAllowed' } if $opacitemholds eq 'F';
353
            return { status => 'OK' } if $canReserve->{status} eq 'recordHoldsOnly';
354
        }
350
        return { status => 'OK' } if $canReserve->{status} eq 'OK';
355
        return { status => 'OK' } if $canReserve->{status} eq 'OK';
351
    }
356
    }
352
    return $canReserve;
357
    return $canReserve;
Lines 459-468 sub CanItemBeReserved { Link Here
459
        categorycode => $borrower->{'categorycode'},
464
        categorycode => $borrower->{'categorycode'},
460
        itemtype     => $item->effective_itemtype,
465
        itemtype     => $item->effective_itemtype,
461
        branchcode   => $reserves_control_branch,
466
        branchcode   => $reserves_control_branch,
462
        rules        => ['holds_per_record','holds_per_day']
467
        rules        => ['holds_per_record','holds_per_day','opacitemholds']
463
    });
468
    });
464
    my $holds_per_record = $rights->{holds_per_record} // 1;
469
    my $holds_per_record = $rights->{holds_per_record} // 1;
465
    my $holds_per_day    = $rights->{holds_per_day};
470
    my $holds_per_day    = $rights->{holds_per_day};
471
    my $opacitemholds    = $rights->{opacitemholds} // 'Y';
466
472
467
    if (   defined $holds_per_record && $holds_per_record ne '' ){
473
    if (   defined $holds_per_record && $holds_per_record ne '' ){
468
        if ( $holds_per_record == 0 ) {
474
        if ( $holds_per_record == 0 ) {
Lines 591-597 sub CanItemBeReserved { Link Here
591
        }
597
        }
592
    }
598
    }
593
599
594
    return { status => 'OK' };
600
    if ( $opacitemholds eq "N" && C4::Context->interface eq 'opac') {
601
        return { status => "recordHoldsOnly", rights => $rights };
602
    }
603
604
    return { status => 'OK', rights => $rights };
595
}
605
}
596
606
597
=head2 CanReserveBeCanceledFromOpac
607
=head2 CanReserveBeCanceledFromOpac
598
- 

Return to bug 25408