diff --git a/opac/opac-MARCdetail.pl b/opac/opac-MARCdetail.pl index 39cb10eecf..c80a66d4ac 100755 --- a/opac/opac-MARCdetail.pl +++ b/opac/opac-MARCdetail.pl @@ -136,9 +136,19 @@ $template->param( ) if $tagslib->{$bt_tag}->{$bt_subtag}->{hidden} <= 0 && # <=0 OPAC visible. $tagslib->{$bt_tag}->{$bt_subtag}->{hidden} > -8; # except -8; +my $norequests = 1; my $allow_onshelf_holds; + for my $itm (@all_items) { my $item = Koha::Items->find( $itm->{itemnumber} ); + $norequests = 0 + if $norequests + && !$item->withdrawn + && !$item->itemlost + && ($item->notforloan < 0 || not $item->notforloan ) + && !Koha::ItemTypes->find($item->effective_itemtype)->notforloan + && $item->itemnumber; + $allow_onshelf_holds = Koha::CirculationRules->get_onshelfholds_policy( { item => $item, patron => $patron } ); last if $allow_onshelf_holds; } @@ -379,6 +389,7 @@ $template->param( item_header_loop => \@item_header_loop, item_subfield_codes => \@item_subfield_codes, biblio => $biblio, + norequests => $norequests, ); output_html_with_http_headers $query, $cookie, $template->output;