Lines 420-425
sub CanBookBeReserved {
Link Here
|
420 |
|
420 |
|
421 |
my $canReserve = { status => '' }; |
421 |
my $canReserve = { status => '' }; |
422 |
my $patron = Koha::Patrons->find($borrowernumber); |
422 |
my $patron = Koha::Patrons->find($borrowernumber); |
|
|
423 |
my $holds = $patron->holds; |
424 |
|
425 |
# Check if borrower has reached the maximum number of holds allowed |
426 |
my $maxreserves = C4::Context->preference('maxreserves'); |
427 |
if ( $maxreserves && $holds->count >= $maxreserves ) { |
428 |
return { status => 'tooManyReserves', limit => $maxreserves }; |
429 |
} |
430 |
|
423 |
while ( my $item = $items->next ) { |
431 |
while ( my $item = $items->next ) { |
424 |
$canReserve = CanItemBeReserved( $patron, $item, $pickup_branchcode, $params ); |
432 |
$canReserve = CanItemBeReserved( $patron, $item, $pickup_branchcode, $params ); |
425 |
return { status => 'OK' } if $canReserve->{status} eq 'OK'; |
433 |
return { status => 'OK' } if $canReserve->{status} eq 'OK'; |
Lines 516-521
sub CanItemBeReserved {
Link Here
|
516 |
return _cache { status => 'recall' } |
524 |
return _cache { status => 'recall' } |
517 |
if $patron->recalls->filter_by_current->search( { item_id => $item->itemnumber } )->count; |
525 |
if $patron->recalls->filter_by_current->search( { item_id => $item->itemnumber } )->count; |
518 |
|
526 |
|
|
|
527 |
# Check if borrower has reached the maximum number of holds allowed |
528 |
my $maxreserves = C4::Context->preference('maxreserves'); |
529 |
if ( $maxreserves && $patron->holds->count >= $maxreserves ) { |
530 |
return { status => 'tooManyReserves', limit => $maxreserves }; |
531 |
} |
532 |
|
519 |
my $controlbranch = C4::Context->preference('ReservesControlBranch'); |
533 |
my $controlbranch = C4::Context->preference('ReservesControlBranch'); |
520 |
|
534 |
|
521 |
my $reserves_control_branch; |
535 |
my $reserves_control_branch; |
522 |
- |
|
|