Lines 428-442
See CanItemBeReserved() for possible return values.
Link Here
|
428 |
sub CanBookBeReserved{ |
428 |
sub CanBookBeReserved{ |
429 |
my ($borrowernumber, $biblionumber) = @_; |
429 |
my ($borrowernumber, $biblionumber) = @_; |
430 |
|
430 |
|
431 |
# Check if borrower already has reserved the same biblio. |
|
|
432 |
my @reserves = GetReservesFromBorrowernumber($borrowernumber); |
433 |
foreach my $reserve (@reserves) { |
434 |
if ($reserve->{biblionumber} == $biblionumber) { |
435 |
return 'alreadyReserved'; |
436 |
} |
437 |
} |
438 |
|
439 |
# Check if borrower has reached the maximum number of holds allowed |
431 |
# Check if borrower has reached the maximum number of holds allowed |
|
|
432 |
my @reserves = GetReservesFromBorrowernumber($borrowernumber); |
440 |
my $maxreserves = C4::Context->preference('maxreserves'); |
433 |
my $maxreserves = C4::Context->preference('maxreserves'); |
441 |
if ($maxreserves && scalar(@reserves) >= $maxreserves) { |
434 |
if ($maxreserves && scalar(@reserves) >= $maxreserves) { |
442 |
return 'tooManyReserves'; |
435 |
return 'tooManyReserves'; |
Lines 619-625
sub CanItemBeReserved {
Link Here
|
619 |
if ( C4::Context->preference('IndependentBranches') |
612 |
if ( C4::Context->preference('IndependentBranches') |
620 |
and !C4::Context->preference('canreservefromotherbranches') ) |
613 |
and !C4::Context->preference('canreservefromotherbranches') ) |
621 |
{ |
614 |
{ |
622 |
my $itembranch = $item->{homebranch}; |
615 |
my $itembranch = $item->homebranch; |
623 |
if ( $itembranch ne $borrower->{branchcode} ) { |
616 |
if ( $itembranch ne $borrower->{branchcode} ) { |
624 |
return 'cannotReserveFromOtherBranches'; |
617 |
return 'cannotReserveFromOtherBranches'; |
625 |
} |
618 |
} |