From affb0629f8dbc171021744c71e586269e5c83b27 Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Mon, 5 Jul 2021 21:44:21 -1000 Subject: [PATCH] Bug 28667: Check damaged item can be reserved in OPAC detail pages In OPAC detail pages, damaged items must impact the "place hold" link. This behavior depends on preference AllowHoldsOnDamagedItems. Test plan : 1) Create a record with one damaged item 2) Set AllowHoldsOnDamagedItems to 'Allow' 3) Go to OPAC record detail page : opac-detail.pl 4) Check you see "Place hold" link 5) Set AllowHoldsOnDamagedItems to 'Don't allow' 6) Refresh page 7) Check you don't see "Place hold" link Same tests 2 to 7 for pages opac-ISBDdetail.pl and opac-MARCdetail.pl --- opac/opac-ISBDdetail.pl | 1 + opac/opac-MARCdetail.pl | 1 + opac/opac-detail.pl | 1 + 3 files changed, 3 insertions(+) diff --git a/opac/opac-ISBDdetail.pl b/opac/opac-ISBDdetail.pl index 9f3bb869e2..ba28c0984f 100755 --- a/opac/opac-ISBDdetail.pl +++ b/opac/opac-ISBDdetail.pl @@ -169,6 +169,7 @@ while ( my $item = $items->next ) { if $norequests && !$item->withdrawn && !$item->itemlost + && ( !$i->damaged || C4::Context->preference('AllowHoldsOnDamagedItems') ) && ($item->notforloan < 0 || not $item->notforloan ) && !Koha::ItemTypes->find($item->effective_itemtype)->notforloan && $item->itemnumber; diff --git a/opac/opac-MARCdetail.pl b/opac/opac-MARCdetail.pl index 0dac97d4b4..a402bcb63e 100755 --- a/opac/opac-MARCdetail.pl +++ b/opac/opac-MARCdetail.pl @@ -146,6 +146,7 @@ while ( my $item = $items->next ) { if $norequests && !$item->withdrawn && !$item->itemlost + && ( !$i->damaged || C4::Context->preference('AllowHoldsOnDamagedItems') ) && ($item->notforloan < 0 || not $item->notforloan ) && !Koha::ItemTypes->find($item->effective_itemtype)->notforloan && $item->itemnumber; diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index 249de81618..ac3537b543 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -722,6 +722,7 @@ if ( not $viewallitems and @items > $max_items_to_display ) { if $norequests && !$itm->{'withdrawn'} && !$itm->{'itemlost'} + && ( !$i->{'damaged'} || C4::Context->preference('AllowHoldsOnDamagedItems') ) && ($itm->{'itemnotforloan'}<0 || not $itm->{'itemnotforloan'}) && !$itemtypes->{$itm->{'itype'}}->{notforloan} && $itm->{'itemnumber'}; -- 2.32.0