@@ -, +, @@ --- opac/opac-ISBDdetail.pl | 3 ++- opac/opac-MARCdetail.pl | 3 ++- opac/opac-detail.pl | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) --- a/opac/opac-ISBDdetail.pl +++ a/opac/opac-ISBDdetail.pl @@ -176,12 +176,13 @@ my $res = GetISBDView({ }); my $items = $biblio->items; +my $allow_damaged_holds = C4::Context->preference('AllowHoldsOnDamagedItems'); while ( my $item = $items->next ) { $norequests = 0 if $norequests && !$item->withdrawn && !$item->itemlost - && ( !$item->damaged || C4::Context->preference('AllowHoldsOnDamagedItems') ) + && ( !$item->damaged || $allow_damaged_holds ) && ($item->notforloan < 0 || not $item->notforloan ) && !Koha::ItemTypes->find($item->effective_itemtype)->notforloan && $item->itemnumber; --- a/opac/opac-MARCdetail.pl +++ a/opac/opac-MARCdetail.pl @@ -146,13 +146,14 @@ $template->param( my $norequests = 1; my $allow_onshelf_holds; my $items = $biblio->items; +my $allow_damaged_holds = C4::Context->preference('AllowHoldsOnDamagedItems'); while ( my $item = $items->next ) { $norequests = 0 if $norequests && !$item->withdrawn && !$item->itemlost - && ( !$item->damaged || C4::Context->preference('AllowHoldsOnDamagedItems') ) + && ( !$item->damaged || $allow_damaged_holds ) && ($item->notforloan < 0 || not $item->notforloan ) && !Koha::ItemTypes->find($item->effective_itemtype)->notforloan && $item->itemnumber; --- a/opac/opac-detail.pl +++ a/opac/opac-detail.pl @@ -701,6 +701,7 @@ if ( not $viewallitems and @items > $max_items_to_display ) { items_count => scalar( @items ), ); } else { + my $allow_damaged_holds = C4::Context->preference('AllowHoldsOnDamagedItems'); for my $itm (@items) { my $item = Koha::Items->find( $itm->{itemnumber} ); $itm->{holds_count} = $item_reserves{ $itm->{itemnumber} }; @@ -709,7 +710,7 @@ if ( not $viewallitems and @items > $max_items_to_display ) { if $norequests && !$itm->{'withdrawn'} && !$itm->{'itemlost'} - && ( !$itm->{'damaged'} || C4::Context->preference('AllowHoldsOnDamagedItems') ) + && ( !$itm->{'damaged'} || $allow_damaged_holds ) && ($itm->{'itemnotforloan'}<0 || not $itm->{'itemnotforloan'}) && !$itemtypes->{$itm->{'itype'}}->{notforloan} && $itm->{'itemnumber'}; --