|
Lines 484-494
sub CanItemBeReserved {
Link Here
|
| 484 |
} |
484 |
} |
| 485 |
} |
485 |
} |
| 486 |
|
486 |
|
|
|
487 |
# must check the notforloan setting of the itemtype |
| 488 |
# FIXME - a lot of places in the code do this |
| 489 |
# or something similar - need to be |
| 490 |
# consolidated |
| 491 |
my $itemtype = $item->effective_itemtype; |
| 492 |
return { status => 'missing_itemtype' } |
| 493 |
unless defined $itemtype; |
| 494 |
my $notforloan_per_itemtype = Koha::ItemTypes->find($itemtype)->notforloan; |
| 495 |
|
| 496 |
return { status => 'notforloan' } if ( $item->notforloan > 0 || $notforloan_per_itemtype ); |
| 497 |
return { status => 'itemlost' } if $item->itemlost; |
| 498 |
return { status => 'withdrawn' } if $item->withdrawn; |
| 487 |
# If an item is damaged and we don't allow holds on damaged items, we can stop right here |
499 |
# If an item is damaged and we don't allow holds on damaged items, we can stop right here |
| 488 |
return _cache { status =>'damaged' } |
500 |
return _cache { status =>'damaged' } |
| 489 |
if ( $item->damaged |
501 |
if ( $item->damaged |
| 490 |
&& !C4::Context->preference('AllowHoldsOnDamagedItems') ); |
502 |
&& !C4::Context->preference('AllowHoldsOnDamagedItems') ); |
| 491 |
|
503 |
|
|
|
504 |
# we retrieve borrowers information # |
| 505 |
my $borrower = $patron->unblessed; |
| 506 |
|
| 492 |
if( GetMarcFromKohaField('biblioitems.agerestriction') ){ |
507 |
if( GetMarcFromKohaField('biblioitems.agerestriction') ){ |
| 493 |
my $biblio = $item->biblio; |
508 |
my $biblio = $item->biblio; |
| 494 |
# Check for the age restriction |
509 |
# Check for the age restriction |
|
Lines 1330-1352
sub IsAvailableForItemLevelRequest {
Link Here
|
| 1330 |
my $patron = shift; |
1345 |
my $patron = shift; |
| 1331 |
my $pickup_branchcode = shift; |
1346 |
my $pickup_branchcode = shift; |
| 1332 |
|
1347 |
|
| 1333 |
my $dbh = C4::Context->dbh; |
|
|
| 1334 |
# must check the notforloan setting of the itemtype |
| 1335 |
# FIXME - a lot of places in the code do this |
| 1336 |
# or something similar - need to be |
| 1337 |
# consolidated |
| 1338 |
my $itemtype = $item->effective_itemtype; |
| 1339 |
return 0 |
| 1340 |
unless defined $itemtype; |
| 1341 |
my $notforloan_per_itemtype = Koha::ItemTypes->find($itemtype)->notforloan; |
| 1342 |
|
| 1343 |
return 0 if |
| 1344 |
$notforloan_per_itemtype || |
| 1345 |
$item->itemlost || |
| 1346 |
$item->notforloan > 0 || # item with negative or zero notforloan value is holdable |
| 1347 |
$item->withdrawn || |
| 1348 |
($item->damaged && !C4::Context->preference('AllowHoldsOnDamagedItems')); |
| 1349 |
|
| 1350 |
if ($pickup_branchcode) { |
1348 |
if ($pickup_branchcode) { |
| 1351 |
my $destination = Koha::Libraries->find($pickup_branchcode); |
1349 |
my $destination = Koha::Libraries->find($pickup_branchcode); |
| 1352 |
return 0 unless $destination; |
1350 |
return 0 unless $destination; |