Lines 335-343
sub CanBookBeReserved{
Link Here
|
335 |
} |
335 |
} |
336 |
|
336 |
|
337 |
my $canReserve = { status => '' }; |
337 |
my $canReserve = { status => '' }; |
|
|
338 |
|
338 |
foreach my $itemnumber (@itemnumbers) { |
339 |
foreach my $itemnumber (@itemnumbers) { |
339 |
$canReserve = CanItemBeReserved( $borrowernumber, $itemnumber, $pickup_branchcode, $params ); |
340 |
$canReserve = CanItemBeReserved( $borrowernumber, $itemnumber, $pickup_branchcode, $params ); |
|
|
341 |
my $opacitemholds = $canReserve->{rights}->{opacitemholds} // 'Y'; |
342 |
return { status => 'recordHoldNotAllowed' } if $opacitemholds eq 'F'; |
340 |
return { status => 'OK' } if $canReserve->{status} eq 'OK'; |
343 |
return { status => 'OK' } if $canReserve->{status} eq 'OK'; |
|
|
344 |
return { status => 'OK' } if $canReserve->{status} eq 'recordHoldsOnly'; |
341 |
} |
345 |
} |
342 |
return $canReserve; |
346 |
return $canReserve; |
343 |
} |
347 |
} |
Lines 445-454
sub CanItemBeReserved {
Link Here
|
445 |
categorycode => $borrower->{'categorycode'}, |
449 |
categorycode => $borrower->{'categorycode'}, |
446 |
itemtype => $item->effective_itemtype, |
450 |
itemtype => $item->effective_itemtype, |
447 |
branchcode => $branchcode, |
451 |
branchcode => $branchcode, |
448 |
rules => ['holds_per_record','holds_per_day'] |
452 |
rules => ['holds_per_record','holds_per_day','opacitemholds'] |
449 |
}); |
453 |
}); |
450 |
my $holds_per_record = $rights->{holds_per_record} // 1; |
454 |
my $holds_per_record = $rights->{holds_per_record} // 1; |
451 |
my $holds_per_day = $rights->{holds_per_day}; |
455 |
my $holds_per_day = $rights->{holds_per_day}; |
|
|
456 |
my $opacitemholds = $rights->{opacitemholds} // 'Y'; |
452 |
|
457 |
|
453 |
my $search_params = { |
458 |
my $search_params = { |
454 |
borrowernumber => $borrowernumber, |
459 |
borrowernumber => $borrowernumber, |
Lines 585-591
sub CanItemBeReserved {
Link Here
|
585 |
} |
590 |
} |
586 |
} |
591 |
} |
587 |
|
592 |
|
588 |
return { status => 'OK' }; |
593 |
if ( $opacitemholds eq "N" && C4::Context->interface eq 'opac') { |
|
|
594 |
return { status => "recordHoldsOnly", rights => $rights }; |
595 |
} |
596 |
|
597 |
return { status => 'OK', rights => $rights }; |
589 |
} |
598 |
} |
590 |
|
599 |
|
591 |
=head2 CanReserveBeCanceledFromOpac |
600 |
=head2 CanReserveBeCanceledFromOpac |