Lines 486-491
sub CanItemBeReserved {
Link Here
|
486 |
} |
486 |
} |
487 |
} |
487 |
} |
488 |
|
488 |
|
|
|
489 |
# must check the notforloan setting of the itemtype |
490 |
# FIXME - a lot of places in the code do this |
491 |
# or something similar - need to be |
492 |
# consolidated |
493 |
my $itemtype = $item->effective_itemtype; |
494 |
return { status => 'missing_itemtype' } |
495 |
unless defined $itemtype; |
496 |
my $notforloan_per_itemtype = Koha::ItemTypes->find($itemtype)->notforloan; |
497 |
|
498 |
return { status => 'notforloan' } if ( $item->notforloan > 0 || $notforloan_per_itemtype ); |
499 |
return { status => 'itemlost' } if $item->itemlost; |
500 |
return { status => 'withdrawn' } if $item->withdrawn; |
501 |
|
489 |
# If an item is damaged and we don't allow holds on damaged items, we can stop right here |
502 |
# If an item is damaged and we don't allow holds on damaged items, we can stop right here |
490 |
return _cache { status => 'damaged' } |
503 |
return _cache { status => 'damaged' } |
491 |
if ( $item->damaged |
504 |
if ( $item->damaged |
Lines 1356-1380
sub IsAvailableForItemLevelRequest {
Link Here
|
1356 |
my $patron = shift; |
1369 |
my $patron = shift; |
1357 |
my $pickup_branchcode = shift; |
1370 |
my $pickup_branchcode = shift; |
1358 |
|
1371 |
|
1359 |
my $dbh = C4::Context->dbh; |
|
|
1360 |
|
1361 |
# must check the notforloan setting of the itemtype |
1362 |
# FIXME - a lot of places in the code do this |
1363 |
# or something similar - need to be |
1364 |
# consolidated |
1365 |
my $itemtype = $item->effective_itemtype; |
1366 |
return 0 |
1367 |
unless defined $itemtype; |
1368 |
my $notforloan_per_itemtype = Koha::ItemTypes->find($itemtype)->notforloan; |
1369 |
|
1370 |
return 0 |
1371 |
if $notforloan_per_itemtype |
1372 |
|| $item->itemlost |
1373 |
|| $item->notforloan > 0 |
1374 |
|| # item with negative or zero notforloan value is holdable |
1375 |
$item->withdrawn |
1376 |
|| ( $item->damaged && !C4::Context->preference('AllowHoldsOnDamagedItems') ); |
1377 |
|
1378 |
if ($pickup_branchcode) { |
1372 |
if ($pickup_branchcode) { |
1379 |
my $destination = Koha::Libraries->find($pickup_branchcode); |
1373 |
my $destination = Koha::Libraries->find($pickup_branchcode); |
1380 |
return 0 unless $destination; |
1374 |
return 0 unless $destination; |