Lines 482-500
foreach my $biblioNum (@biblionumbers) {
Link Here
|
482 |
|
482 |
|
483 |
my $branch = Koha::Policy::Holds->holds_control_library( $item, $patron ); |
483 |
my $branch = Koha::Policy::Holds->holds_control_library( $item, $patron ); |
484 |
|
484 |
|
485 |
my $policy_holdallowed = |
485 |
my $item_status = CanItemBeReserved( $patron, $item, undef, { get_from_cache => 1 } )->{status}; |
486 |
CanItemBeReserved( $patron, $item, undef, { get_from_cache => 1 } )->{status} eq 'OK' && |
486 |
|
487 |
IsAvailableForItemLevelRequest($item, $patron, undef); |
487 |
if ( $item_status eq 'recordHoldsOnly' ) { |
|
|
488 |
$biblioLoopIter{force_hold} = 1; |
489 |
$biblioLoopIter{itemholdable} = 0; |
490 |
$biblioLoopIter{forced_hold_level} = 'record'; |
491 |
} |
492 |
|
493 |
my $policy_holdallowed = IsAvailableForItemLevelRequest( $item, $patron, undef ) |
494 |
&& ( $item_status eq 'OK' or $item_status eq 'recordHoldsOnly' ); |
488 |
|
495 |
|
489 |
if ($policy_holdallowed) { |
496 |
if ($policy_holdallowed) { |
490 |
my $opac_hold_policy = Koha::CirculationRules->get_opacitemholds_policy( { item => $item, patron => $patron } ); |
497 |
$numCopiesAvailable++; |
491 |
if ( $opac_hold_policy ne 'N' ) { # If Y or F |
498 |
if ( $item_status ne 'recordHoldsOnly' ) { |
492 |
$item_info->{available} = 1; |
|
|
493 |
$numCopiesOPACAvailable++; |
499 |
$numCopiesOPACAvailable++; |
494 |
$biblioLoopIter{force_hold} = 1 if $opac_hold_policy eq 'F'; |
500 |
$item_info->{available} = 1; |
495 |
} |
501 |
} |
496 |
$numCopiesAvailable++; |
|
|
497 |
|
498 |
unless ( $can_place_hold_if_available_at_pickup ) { |
502 |
unless ( $can_place_hold_if_available_at_pickup ) { |
499 |
my $items_in_this_library = Koha::Items->search({ biblionumber => $item->biblionumber, holdingbranch => $item->holdingbranch, notforloan => 0 }); |
503 |
my $items_in_this_library = Koha::Items->search({ biblionumber => $item->biblionumber, holdingbranch => $item->holdingbranch, notforloan => 0 }); |
500 |
my $nb_of_items_issued = $items_in_this_library->search({ 'issue.itemnumber' => { not => undef }}, { join => 'issue' })->count; |
504 |
my $nb_of_items_issued = $items_in_this_library->search({ 'issue.itemnumber' => { not => undef }}, { join => 'issue' })->count; |
Lines 544-552
foreach my $biblioNum (@biblionumbers) {
Link Here
|
544 |
} |
548 |
} |
545 |
} |
549 |
} |
546 |
|
550 |
|
547 |
my $status = CanBookBeReserved( $borrowernumber, $biblioNum )->{status}; |
551 |
my $record_status = CanBookBeReserved( $borrowernumber, $biblioNum )->{status}; |
548 |
$biblioLoopIter{holdable} &&= $status eq 'OK'; |
552 |
if ($record_status eq 'recordHoldNotAllowed') { |
549 |
$biblioLoopIter{$status} = 1; |
553 |
$biblioLoopIter{force_hold} = 1; |
|
|
554 |
$biblioLoopIter{itemholdable} = 1; |
555 |
$biblioLoopIter{forced_hold_level} = 'item'; |
556 |
$biblioLoopIter{holdable} &&= 1; |
557 |
} |
558 |
else { |
559 |
$biblioLoopIter{holdable} &&= $record_status eq 'OK'; |
560 |
} |
550 |
|
561 |
|
551 |
if ( $biblioLoopIter{holdable} and C4::Context->preference('AllowHoldItemTypeSelection') ) { |
562 |
if ( $biblioLoopIter{holdable} and C4::Context->preference('AllowHoldItemTypeSelection') ) { |
552 |
# build the allowed item types loop |
563 |
# build the allowed item types loop |
Lines 564-570
foreach my $biblioNum (@biblionumbers) {
Link Here
|
564 |
$biblioLoopIter{allowed_item_types} = \@item_types; |
575 |
$biblioLoopIter{allowed_item_types} = \@item_types; |
565 |
} |
576 |
} |
566 |
|
577 |
|
567 |
if ( $status eq 'recall' ) { |
578 |
if ( $record_status eq 'recall' ) { |
568 |
$biblioLoopIter{recall} = 1; |
579 |
$biblioLoopIter{recall} = 1; |
569 |
} |
580 |
} |
570 |
|
581 |
|
571 |
- |
|
|