From 7eab6cbfdab9a80c57b2258b05d780d8df815761 Mon Sep 17 00:00:00 2001 From: finlayt Date: Mon, 19 Aug 2002 06:29:36 +0000 Subject: [PATCH] fixed up the CheckReserves.pm routine so that it does not put Referece items into "waiting" status if there is a reserve. Also fixed a bug in detail.pl. --- C4/Reserves2.pm | 11 +++++++++-- detail.pl | 3 ++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/C4/Reserves2.pm b/C4/Reserves2.pm index b3a7f03f61..18a6044937 100755 --- a/C4/Reserves2.pm +++ b/C4/Reserves2.pm @@ -102,11 +102,18 @@ sub CheckReserves { my $dbh=C4Connect; my $qitem=$dbh->quote($item); # get the biblionumber... - my $sth=$dbh->prepare("select biblionumber, biblioitemnumber from items where itemnumber=$qitem"); + my $sth=$dbh->prepare("SELECT items.biblionumber, items.biblioitemnumber, itemtypes.notforloan + FROM items, biblioitems, itemtypes + WHERE items.biblioitemnumber = biblioitems.biblioitemnumber + AND biblioitems.itemtype = itemtypes.itemtype + AND itemnumber=$qitem"); $sth->execute; - my ($biblio, $bibitem) = $sth->fetchrow_array; + my ($biblio, $bibitem, $notforloan) = $sth->fetchrow_array; $sth->finish; $dbh->disconnect; +# if item is not for loan it cannot be reserved either..... +warn "Not for loan: $notforloan"; + return (0, 0) if ($notforloan); # get the reserves... my ($count, @reserves) = Findgroupreserve($bibitem, $biblio); my $priority = 10000000; diff --git a/detail.pl b/detail.pl index 5e0f4c3298..6c8605989a 100755 --- a/detail.pl +++ b/detail.pl @@ -59,6 +59,7 @@ foreach my $itm (@items) { $norequests = 0 unless $itm->{'notforloan'}; } + warn "Biblionumber: $biblionumber"; warn "Norequests: $norequests"; @@ -69,6 +70,7 @@ my ($webbiblioitemcount, @webbiblioitems) = &getwebbiblioitems($biblionumber); my ($websitecount, @websites) = &getwebsites($biblionumber); $dat->{'count'}=@items; +$dat->{'norequests'} = $norequests; $dat->{'additional'}=$addauthor->[0]->{'author'}; for (my $i = 1; $i < $authorcount; $i++) { @@ -110,7 +112,6 @@ $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.2