Lines 341-347
sub CanBookBeReserved{
Link Here
|
341 |
|
341 |
|
342 |
foreach my $itemnumber (@itemnumbers) { |
342 |
foreach my $itemnumber (@itemnumbers) { |
343 |
$canReserve = CanItemBeReserved( $borrowernumber, $itemnumber, $pickup_branchcode, $params ); |
343 |
$canReserve = CanItemBeReserved( $borrowernumber, $itemnumber, $pickup_branchcode, $params ); |
344 |
return { status => 'recordHoldNotAllowed' } if $canReserve->{rights}->{opacitemholds} eq 'F'; |
344 |
my $opacitemholds = $canReserve->{rights}->{opacitemholds} // 'Y'; |
|
|
345 |
return { status => 'recordHoldNotAllowed' } if $opacitemholds eq 'F'; |
345 |
return { status => 'OK' } if $canReserve->{status} eq 'OK'; |
346 |
return { status => 'OK' } if $canReserve->{status} eq 'OK'; |
346 |
return { status => 'OK' } if $canReserve->{status} eq 'recordHoldsOnly'; |
347 |
return { status => 'OK' } if $canReserve->{status} eq 'recordHoldsOnly'; |
347 |
} |
348 |
} |
Lines 384-389
sub CanItemBeReserved {
Link Here
|
384 |
my $biblio = $item->biblio; |
385 |
my $biblio = $item->biblio; |
385 |
my $patron = Koha::Patrons->find( $borrowernumber ); |
386 |
my $patron = Koha::Patrons->find( $borrowernumber ); |
386 |
my $borrower = $patron->unblessed; |
387 |
my $borrower = $patron->unblessed; |
|
|
388 |
my $context = $params->{context} // ''; |
387 |
|
389 |
|
388 |
# If an item is damaged and we don't allow holds on damaged items, we can stop right here |
390 |
# If an item is damaged and we don't allow holds on damaged items, we can stop right here |
389 |
return { status =>'damaged' } |
391 |
return { status =>'damaged' } |
Lines 591-597
sub CanItemBeReserved {
Link Here
|
591 |
} |
593 |
} |
592 |
} |
594 |
} |
593 |
|
595 |
|
594 |
if ( $opacitemholds eq "N" ) { |
596 |
if ( $opacitemholds eq "N" && $context ne 'staff') { |
595 |
return { status => "recordHoldsOnly", right => $rights }; |
597 |
return { status => "recordHoldsOnly", right => $rights }; |
596 |
} |
598 |
} |
597 |
|
599 |
|