Lines 275-280
sub CanBookBeReserved{
Link Here
|
275 |
foreach my $item (@$items) { |
275 |
foreach my $item (@$items) { |
276 |
$canReserve = CanItemBeReserved( $borrowernumber, $item ); |
276 |
$canReserve = CanItemBeReserved( $borrowernumber, $item ); |
277 |
return 'OK' if $canReserve eq 'OK'; |
277 |
return 'OK' if $canReserve eq 'OK'; |
|
|
278 |
return $canReserve if $canReserve eq 'debarred'; # no need to continue |
278 |
} |
279 |
} |
279 |
return $canReserve; |
280 |
return $canReserve; |
280 |
} |
281 |
} |
Lines 307-317
sub CanItemBeReserved {
Link Here
|
307 |
my $item = GetItem($itemnumber); |
308 |
my $item = GetItem($itemnumber); |
308 |
my $biblio = Koha::Biblios->find( $item->{biblionumber} ); |
309 |
my $biblio = Koha::Biblios->find( $item->{biblionumber} ); |
309 |
my $patron = Koha::Patrons->find( $borrowernumber ); |
310 |
my $patron = Koha::Patrons->find( $borrowernumber ); |
310 |
my $borrower = $patron->unblessed; |
311 |
if( !$patron || $patron->is_debarred ) { |
311 |
|
|
|
312 |
if ($patron->is_debarred) { |
313 |
return 'debarred'; |
312 |
return 'debarred'; |
314 |
} |
313 |
} |
|
|
314 |
my $borrower = $patron->unblessed; |
315 |
|
315 |
|
316 |
# If an item is damaged and we don't allow holds on damaged items, we can stop right here |
316 |
# If an item is damaged and we don't allow holds on damaged items, we can stop right here |
317 |
return 'damaged' |
317 |
return 'damaged' |