Lines 330-336
sub CanBookBeReserved{
Link Here
|
330 |
my $canReserve = { status => '' }; |
330 |
my $canReserve = { status => '' }; |
331 |
foreach my $itemnumber (@itemnumbers) { |
331 |
foreach my $itemnumber (@itemnumbers) { |
332 |
$canReserve = CanItemBeReserved( $borrowernumber, $itemnumber, $pickup_branchcode, $params ); |
332 |
$canReserve = CanItemBeReserved( $borrowernumber, $itemnumber, $pickup_branchcode, $params ); |
333 |
my $opacitemholds = $canReserve->{rights}->{opacitemholds}; |
333 |
my $opacitemholds = $canReserve->{rights}->{opacitemholds} // 'Y'; |
334 |
return { status => 'RecordHoldNotAllowed' } if $opacitemholds eq 'F'; |
334 |
return { status => 'RecordHoldNotAllowed' } if $opacitemholds eq 'F'; |
335 |
return { status => 'OK' } if ( $canReserve->{status} eq 'notReservable' && $opacitemholds eq 'N' ); |
335 |
return { status => 'OK' } if ( $canReserve->{status} eq 'notReservable' && $opacitemholds eq 'N' ); |
336 |
return { status => 'OK' } if $canReserve->{status} eq 'OK'; |
336 |
return { status => 'OK' } if $canReserve->{status} eq 'OK'; |
Lines 370-375
sub CanItemBeReserved {
Link Here
|
370 |
my $holds_per_record = 1; # Total number of holds allowed for this one given record |
370 |
my $holds_per_record = 1; # Total number of holds allowed for this one given record |
371 |
my $holds_per_day; # Default to unlimited |
371 |
my $holds_per_day; # Default to unlimited |
372 |
my $opacitemholds = 'Y'; # Itemlevel holds default to allowed |
372 |
my $opacitemholds = 'Y'; # Itemlevel holds default to allowed |
|
|
373 |
my $context = $params->{context} // ''; |
373 |
|
374 |
|
374 |
# we retrieve borrowers and items informations # |
375 |
# we retrieve borrowers and items informations # |
375 |
# item->{itype} will come for biblioitems if necessery |
376 |
# item->{itype} will come for biblioitems if necessery |
Lines 436-442
sub CanItemBeReserved {
Link Here
|
436 |
|
437 |
|
437 |
my $holds = Koha::Holds->search($search_params); |
438 |
my $holds = Koha::Holds->search($search_params); |
438 |
|
439 |
|
439 |
if ( $opacitemholds eq "N" ) { |
440 |
if ( $opacitemholds eq "N" && $context ne 'staff' ) { |
440 |
return { status => "notReservable", rights => $rights }; |
441 |
return { status => "notReservable", rights => $rights }; |
441 |
} |
442 |
} |
442 |
|
443 |
|