Lines 446-460
sub CanItemBeReserved {
Link Here
|
446 |
} |
446 |
} |
447 |
} |
447 |
} |
448 |
|
448 |
|
449 |
# we retrieve borrowers and items informations # |
|
|
450 |
# item->{itype} will come for biblioitems if necessery |
451 |
my $borrower = $patron->unblessed; |
452 |
|
449 |
|
|
|
450 |
# must check the notforloan setting of the itemtype |
451 |
# FIXME - a lot of places in the code do this |
452 |
# or something similar - need to be |
453 |
# consolidated |
454 |
my $itemtype = $item->effective_itemtype; |
455 |
return { status => 'missing_itemtype' } |
456 |
unless defined $itemtype; |
457 |
my $notforloan_per_itemtype = Koha::ItemTypes->find($itemtype)->notforloan; |
458 |
|
459 |
return { status => 'notforloan' } if ( $item->notforloan || $notforloan_per_itemtype ); |
460 |
return { status => 'itemlost' } if $item->itemlost; |
461 |
return { status => 'withdrawn' } if $item->withdrawn; |
453 |
# If an item is damaged and we don't allow holds on damaged items, we can stop right here |
462 |
# If an item is damaged and we don't allow holds on damaged items, we can stop right here |
454 |
return { status =>'damaged' } |
463 |
return { status =>'damaged' } |
455 |
if ( $item->damaged |
464 |
if ( $item->damaged |
456 |
&& !C4::Context->preference('AllowHoldsOnDamagedItems') ); |
465 |
&& !C4::Context->preference('AllowHoldsOnDamagedItems') ); |
457 |
|
466 |
|
|
|
467 |
# we retrieve borrowers information # |
468 |
my $borrower = $patron->unblessed; |
469 |
|
458 |
if( GetMarcFromKohaField('biblioitems.agerestriction') ){ |
470 |
if( GetMarcFromKohaField('biblioitems.agerestriction') ){ |
459 |
my $biblio = $item->biblio; |
471 |
my $biblio = $item->biblio; |
460 |
# Check for the age restriction |
472 |
# Check for the age restriction |
Lines 1370-1392
sub IsAvailableForItemLevelRequest {
Link Here
|
1370 |
# looped outside of IsAvailableForItemLevelRequest to avoid nested loops: |
1382 |
# looped outside of IsAvailableForItemLevelRequest to avoid nested loops: |
1371 |
my $items_any_available = shift; |
1383 |
my $items_any_available = shift; |
1372 |
|
1384 |
|
1373 |
my $dbh = C4::Context->dbh; |
|
|
1374 |
# must check the notforloan setting of the itemtype |
1375 |
# FIXME - a lot of places in the code do this |
1376 |
# or something similar - need to be |
1377 |
# consolidated |
1378 |
my $itemtype = $item->effective_itemtype; |
1379 |
return 0 |
1380 |
unless defined $itemtype; |
1381 |
my $notforloan_per_itemtype = Koha::ItemTypes->find($itemtype)->notforloan; |
1382 |
|
1383 |
return 0 if |
1384 |
$notforloan_per_itemtype || |
1385 |
$item->itemlost || |
1386 |
$item->notforloan > 0 || # item with negative or zero notforloan value is holdable |
1387 |
$item->withdrawn || |
1388 |
($item->damaged && !C4::Context->preference('AllowHoldsOnDamagedItems')); |
1389 |
|
1390 |
if ($pickup_branchcode) { |
1385 |
if ($pickup_branchcode) { |
1391 |
my $destination = Koha::Libraries->find($pickup_branchcode); |
1386 |
my $destination = Koha::Libraries->find($pickup_branchcode); |
1392 |
return 0 unless $destination; |
1387 |
return 0 unless $destination; |
1393 |
- |
|
|