Lines 658-669
if ( C4::Context->preference('OPACAcquisitionDetails' ) ) {
Link Here
|
658 |
}; |
658 |
}; |
659 |
} |
659 |
} |
660 |
|
660 |
|
661 |
# Count the number of items that allow holds |
661 |
# Count the number of items that allow holds at the 'All libraries' rule level |
662 |
my $holdable_items = $biblio->items->filter_by_for_hold->count; |
662 |
my $holdable_items = $biblio->items->filter_by_for_hold->count; |
663 |
# If we have a patron and there are no holdable items - we set to no |
663 |
|
664 |
# If we have a patron and there are holdable items we set to no - and we need to check each item specifically |
664 |
# If we have a patron we need to check their policies for holds in the loop below |
665 |
# If we don't have a patron, then holdable items determines holdability |
665 |
# If we don't have a patron, then holdable items determines holdability |
666 |
my $can_holds_be_placed = $patron && $holdable_items ? 0 : $holdable_items; |
666 |
my $can_holds_be_placed = $patron ? 0 : $holdable_items; |
667 |
|
667 |
|
668 |
my ( $itemloop_has_images, $otheritemloop_has_images ); |
668 |
my ( $itemloop_has_images, $otheritemloop_has_images ); |
669 |
if ( not $viewallitems and $items->count > $max_items_to_display ) { |
669 |
if ( not $viewallitems and $items->count > $max_items_to_display ) { |
Lines 688-698
else {
Link Here
|
688 |
$item_info->{holding_library_info} = $opac_info_holding->content if $opac_info_holding; |
688 |
$item_info->{holding_library_info} = $opac_info_holding->content if $opac_info_holding; |
689 |
$item_info->{home_library_info} = $opac_info_home->content if $opac_info_home; |
689 |
$item_info->{home_library_info} = $opac_info_home->content if $opac_info_home; |
690 |
|
690 |
|
691 |
# We only need to check if we haven't determined holds can be place, and there are items that can |
691 |
# We only need to check if we haven't determined holds can be placed |
692 |
# be held, and we have a patron to determine holdability |
692 |
# and if we don't have patron, we have already decided |
693 |
if( !$can_holds_be_placed && $holdable_items && $patron ){ |
693 |
$can_holds_be_placed = |
694 |
$can_holds_be_placed = IsAvailableForItemLevelRequest($item, $patron, undef); |
694 |
$can_holds_be_placed || $patron && IsAvailableForItemLevelRequest( $item, $patron, undef ); |
695 |
} |
|
|
696 |
|
695 |
|
697 |
# get collection code description, too |
696 |
# get collection code description, too |
698 |
my $ccode = $item->ccode; |
697 |
my $ccode = $item->ccode; |
Lines 768-776
else {
Link Here
|
768 |
} |
767 |
} |
769 |
} |
768 |
} |
770 |
|
769 |
|
771 |
$template->param( ReservableItems => $can_holds_be_placed ); |
|
|
772 |
|
773 |
$template->param( |
770 |
$template->param( |
|
|
771 |
ReservableItems => $can_holds_be_placed, |
774 |
itemloop_has_images => $itemloop_has_images, |
772 |
itemloop_has_images => $itemloop_has_images, |
775 |
otheritemloop_has_images => $otheritemloop_has_images, |
773 |
otheritemloop_has_images => $otheritemloop_has_images, |
776 |
); |
774 |
); |
777 |
- |
|
|