[Koha-patches] [PATCH] (bug #3772) show place hold button in isbd view

Nahuel ANGELINETTI nahuel.angelinetti at biblibre.com
Thu Nov 5 16:59:07 CET 2009


This fix the isbd view to show the "place hold" button.
---
 opac/opac-ISBDdetail.pl |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/opac/opac-ISBDdetail.pl b/opac/opac-ISBDdetail.pl
index cbb9877..88d373a 100755
--- a/opac/opac-ISBDdetail.pl
+++ b/opac/opac-ISBDdetail.pl
@@ -50,6 +50,7 @@ use C4::Output;
 use CGI;
 use MARC::Record;
 use C4::Biblio;
+use C4::Items;
 use C4::Acquisition;
 use C4::External::Amazon;
 use C4::Review;
@@ -97,9 +98,19 @@ $template->param(
     subscriptionsnumber => $subscriptionsnumber,
 );
 
-# my @blocs = split /\@/,$ISBD;
-# my @fields = $record->fields();
+my $norequests = 1;
 my $res = GetISBDView($biblionumber, "opac");
+my @items = &GetItemsInfo($biblionumber, 'opac');
+
+my $itemtypes = GetItemTypes();
+for my $itm (@items) {
+    $norequests = 0
+       if ( (not $itm->{'wthdrawn'} )
+         && (not $itm->{'itemlost'} )
+         && ($itm->{'itemnotforloan'}<0 || not $itm->{'itemnotforloan'} )
+		 && (not $itemtypes->{$itm->{'itype'}}->{notforloan} )
+         && ($itm->{'itemnumber'} ) );
+}
 
 my $reviews = getreviews( $biblionumber, 1 );
 foreach ( @$reviews ) {
@@ -113,6 +124,9 @@ foreach ( @$reviews ) {
 
 
 $template->param(
+    RequestOnOpac       => C4::Context->preference("RequestOnOpac"),
+    AllowOnShelfHolds   => C4::Context->preference('AllowOnShelfHolds'),
+    norequests   => $norequests,
     ISBD         => $res,
     biblionumber => $biblionumber,
     reviews             => $reviews,
-- 
1.6.3.3




More information about the Koha-patches mailing list