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