View | Details | Raw Unified | Return to bug 34886
Collapse All | Expand All

(-)a/opac/opac-detail.pl (-8 / +13 lines)
Lines 658-664 if ( C4::Context->preference('OPACAcquisitionDetails' ) ) { Link Here
658
    };
658
    };
659
}
659
}
660
660
661
my $can_item_be_reserved = 0;
661
# Count the number of items that allow holds
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
664
# If we have a patron and there are holdable items we set to no - and we need to check each item specifically
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;
667
662
my ( $itemloop_has_images, $otheritemloop_has_images );
668
my ( $itemloop_has_images, $otheritemloop_has_images );
663
if ( not $viewallitems and $items->count > $max_items_to_display ) {
669
if ( not $viewallitems and $items->count > $max_items_to_display ) {
664
    $template->param(
670
    $template->param(
Lines 682-688 else { Link Here
682
        $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;
683
        $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;
684
690
685
        $can_item_be_reserved = $can_item_be_reserved || $patron && IsAvailableForItemLevelRequest($item, $patron, undef);
691
        # We only need to check if we haven't determined holds can be place, and there are items that can
692
        # be held, and we have a patron to determine holdability
693
        if( !$can_holds_be_placed && $holdable_items && $patron ){
694
            $can_holds_be_placed = IsAvailableForItemLevelRequest($item, $patron, undef);
695
        }
686
696
687
        # get collection code description, too
697
        # get collection code description, too
688
        my $ccode = $item->ccode;
698
        my $ccode = $item->ccode;
Lines 758-766 else { Link Here
758
    }
768
    }
759
}
769
}
760
770
761
if( $can_item_be_reserved || CountItemsIssued($biblionumber) || $biblio->has_items_waiting_or_intransit ) {
771
$template->param( ReservableItems => $can_holds_be_placed );
762
    $template->param( ReservableItems => 1 );
763
}
764
772
765
$template->param(
773
$template->param(
766
    itemloop_has_images      => $itemloop_has_images,
774
    itemloop_has_images      => $itemloop_has_images,
Lines 788-797 if( C4::Context->preference('ArticleRequests') ) { Link Here
788
    $template->param( artreqpossible => $artreqpossible );
796
    $template->param( artreqpossible => $artreqpossible );
789
}
797
}
790
798
791
my $norequests = ! $biblio->items->filter_by_for_hold->count;
792
    $template->param(
799
    $template->param(
793
                     MARCNOTES               => $marcnotesarray,
800
                     MARCNOTES               => $marcnotesarray,
794
                     norequests              => $norequests,
795
                     itemdata_ccode          => $itemfields{ccode},
801
                     itemdata_ccode          => $itemfields{ccode},
796
                     itemdata_materials      => $itemfields{materials},
802
                     itemdata_materials      => $itemfields{materials},
797
                     itemdata_enumchron      => $itemfields{enumchron},
803
                     itemdata_enumchron      => $itemfields{enumchron},
798
- 

Return to bug 34886