Lines 44-49
use Koha::Holds;
Link Here
|
44 |
use Koha::Libraries; |
44 |
use Koha::Libraries; |
45 |
use Koha::Items; |
45 |
use Koha::Items; |
46 |
use Koha::ItemTypes; |
46 |
use Koha::ItemTypes; |
|
|
47 |
use Koha::Patrons; |
47 |
|
48 |
|
48 |
use List::MoreUtils qw( firstidx any ); |
49 |
use List::MoreUtils qw( firstidx any ); |
49 |
use Carp; |
50 |
use Carp; |
Lines 456-461
sub CanBookBeReserved{
Link Here
|
456 |
cannotReserveFromOtherBranches, if syspref 'canreservefromotherbranches' is OK. |
457 |
cannotReserveFromOtherBranches, if syspref 'canreservefromotherbranches' is OK. |
457 |
tooManyReserves, if the borrower has exceeded his maximum reserve amount. |
458 |
tooManyReserves, if the borrower has exceeded his maximum reserve amount. |
458 |
notReservable, if holds on this item are not allowed |
459 |
notReservable, if holds on this item are not allowed |
|
|
460 |
debarred, if patron is debarred |
459 |
|
461 |
|
460 |
=cut |
462 |
=cut |
461 |
|
463 |
|
Lines 472-477
sub CanItemBeReserved{
Link Here
|
472 |
my $biblioData = C4::Biblio::GetBiblioData( $item->{biblionumber} ); |
474 |
my $biblioData = C4::Biblio::GetBiblioData( $item->{biblionumber} ); |
473 |
my $borrower = C4::Members::GetMember('borrowernumber'=>$borrowernumber); |
475 |
my $borrower = C4::Members::GetMember('borrowernumber'=>$borrowernumber); |
474 |
|
476 |
|
|
|
477 |
if (Koha::Patrons->find($borrowernumber)->is_debarred) { |
478 |
return 'debarred'; |
479 |
} |
480 |
|
475 |
# If an item is damaged and we don't allow holds on damaged items, we can stop right here |
481 |
# If an item is damaged and we don't allow holds on damaged items, we can stop right here |
476 |
return 'damaged' if ( $item->{damaged} && !C4::Context->preference('AllowHoldsOnDamagedItems') ); |
482 |
return 'damaged' if ( $item->{damaged} && !C4::Context->preference('AllowHoldsOnDamagedItems') ); |
477 |
|
483 |
|