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