From 49169d1cee1c506dd3bb7d1b48a14cb2878deb2c 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 Signed-off-by: Barbara Johnson --- 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 567caf4118..5408cc3a0f 100755 --- a/opac/opac-ISBDdetail.pl +++ b/opac/opac-ISBDdetail.pl @@ -178,6 +178,7 @@ while ( my $item = $items->next ) { if $norequests && !$item->withdrawn && !$item->itemlost + && ( !$item->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 69578be6aa..2fb3915098 100755 --- a/opac/opac-MARCdetail.pl +++ b/opac/opac-MARCdetail.pl @@ -152,6 +152,7 @@ while ( my $item = $items->next ) { if $norequests && !$item->withdrawn && !$item->itemlost + && ( !$item->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 cbb216e291..32790bb509 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -742,6 +742,7 @@ if ( not $viewallitems and @items > $max_items_to_display ) { if $norequests && !$itm->{'withdrawn'} && !$itm->{'itemlost'} + && ( !$itm->{'damaged'} || C4::Context->preference('AllowHoldsOnDamagedItems') ) && ($itm->{'itemnotforloan'}<0 || not $itm->{'itemnotforloan'}) && !$itemtypes->{$itm->{'itype'}}->{notforloan} && $itm->{'itemnumber'}; -- 2.20.1