From b7a18e80352e797e42e892ec38ca33e8ca655ec3 Mon Sep 17 00:00:00 2001 From: finlayt Date: Mon, 19 Aug 2002 05:37:15 +0000 Subject: [PATCH] added a Boolean: $norequests whhich is set on the template detail.tmpl so that the "requests" button only apears if it is actually possible to make a request. This is set by checking against the "notforloan" field on the itemtypes table. --- detail.pl | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/detail.pl b/detail.pl index bb6fff61ce..5e0f4c3298 100755 --- a/detail.pl +++ b/detail.pl @@ -45,14 +45,24 @@ while () { $value=~s/^\s*//g; $value=~s/\s*$//g; $configfile{$variable}=$value; - } } +} my $biblionumber=$query->param('bib'); my $type='intra'; + # change back when ive fixed request.pl my @items = ItemInfo(undef, $biblionumber, $type); +my $norequests = 1; +foreach my $itm (@items) { + $norequests = 0 unless $itm->{'notforloan'}; +} + +warn "Biblionumber: $biblionumber"; +warn "Norequests: $norequests"; + + my $dat=bibdata($biblionumber); my ($authorcount, $addauthor)= &addauthor($biblionumber); my ($webbiblioitemcount, @webbiblioitems) = &getwebbiblioitems($biblionumber); @@ -100,6 +110,7 @@ $template->param(prevstartfrom => $prevstartfrom); $template->param(includesdir => $includes); $template->param(BIBLIO_RESULTS => $resultsarray); $template->param(ITEM_RESULTS => $itemsarray); +$template->param(norequests => $norequests); $template->param(WEB_RESULTS => $webarray); $template->param(SITE_RESULTS => $sitearray); print "Content-Type: text/html\n\n", $template->output; -- 2.39.5