Lines 1282-1298
sub IsAvailableForItemLevelRequest {
Link Here
|
1282 |
|
1282 |
|
1283 |
if ( $on_shelf_holds == 1 ) { |
1283 |
if ( $on_shelf_holds == 1 ) { |
1284 |
return 1; |
1284 |
return 1; |
1285 |
} elsif ( $on_shelf_holds == 2 ) { |
1285 |
} elsif ( $on_shelf_holds == 2 ) { # On shelf holds == "If all unavailable" |
1286 |
|
1286 |
|
1287 |
# if we have this param predefined from outer caller sub, we just need |
1287 |
# if we have this param predefined from outer caller sub, we just need |
1288 |
# to return it, so we saving from having loop inside other loop: |
1288 |
# to return it, so we saving from having loop inside other loop: |
1289 |
return $items_any_available ? 0 : 1 |
1289 |
$items_any_available //= ItemsAnyAvailableForHold( { biblionumber => $item->biblionumber, patron => $patron }); |
1290 |
if defined $items_any_available; |
|
|
1291 |
|
1290 |
|
1292 |
my $any_available = ItemsAnyAvailableForHold( { biblionumber => $item->biblionumber, patron => $patron }); |
1291 |
return !$items_any_available; |
1293 |
return $any_available ? 0 : 1; |
|
|
1294 |
} else { # on_shelf_holds == 0 "If any unavailable" (the description is rather cryptic and could still be improved) |
1292 |
} else { # on_shelf_holds == 0 "If any unavailable" (the description is rather cryptic and could still be improved) |
1295 |
return $item->onloan || IsItemOnHoldAndFound( $item->itemnumber ); |
1293 |
return $item->notforloan < 0 || $item->onloan || IsItemOnHoldAndFound( $item->itemnumber ); |
1296 |
} |
1294 |
} |
1297 |
} |
1295 |
} |
1298 |
|
1296 |
|
Lines 1322-1328
sub ItemsAnyAvailableForHold {
Link Here
|
1322 |
|
1320 |
|
1323 |
$any_available = 1 |
1321 |
$any_available = 1 |
1324 |
unless $i->itemlost |
1322 |
unless $i->itemlost |
1325 |
|| $i->notforloan > 0 |
1323 |
|| $i->notforloan != 0 |
1326 |
|| $i->withdrawn |
1324 |
|| $i->withdrawn |
1327 |
|| $i->onloan |
1325 |
|| $i->onloan |
1328 |
|| IsItemOnHoldAndFound( $i->id ) |
1326 |
|| IsItemOnHoldAndFound( $i->id ) |