From 7cd7350fc7d15d7165246f42d6c79cf2000e511a Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Sat, 19 Aug 2017 03:31:29 +0000 Subject: [PATCH] Bug 2946: Added some missing logic The norequests logic affects the opac-details-sidebar.inc logic which is shared in ISBD and MARC views. It is correct in ISBD and this brings it into MARC detailed view. --- opac/opac-MARCdetail.pl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/opac/opac-MARCdetail.pl b/opac/opac-MARCdetail.pl index 6970f82..e7cdc59 100755 --- a/opac/opac-MARCdetail.pl +++ b/opac/opac-MARCdetail.pl @@ -127,15 +127,25 @@ if(my $cart_list = $query->cookie("bib_list")){ } } +my $norequests = 1; my $allow_onshelf_holds; my $patron = Koha::Patrons->find( $loggedinuser ); for my $itm (@all_items) { + $norequests = 0 + if $norequests + && !$itm->{'withdrawn'} + && !$itm->{'itemlost'} + && ($itm->{'itemnotforloan'}<0 || not $itm->{'itemnotforloan'}) + && !$itemtypes->{$itm->{'itype'}}->{notforloan} + && $itm->{'itemnumber'}; + $allow_onshelf_holds = C4::Reserves::OnShelfHoldsAllowed( $itm, ( $patron ? $patron->unblessed : {} ) ); last if $allow_onshelf_holds; } $template->param( 'AllowOnShelfHolds' => $allow_onshelf_holds ); $template->param( 'ItemsIssued' => CountItemsIssued( $biblionumber ) ); +$template->param( 'norequests' => $norequests ); # adding the $RequestOnOpac param my $RequestOnOpac; -- 2.1.4