From c3820fa998a5cafef00bf72d5c52d45e5abc8924 Mon Sep 17 00:00:00 2001 From: finlayt Date: Thu, 6 Jun 2002 04:15:18 +0000 Subject: [PATCH] fixed bug http://bugzilla.katipo.co.nz/show_bug.cgi?id=1284 If an item doesnt have a holdingbranch it just shows blank instead of not appearing at all. --- C4/Search.pm | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index 1615c0160f..a730430a04 100755 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -639,18 +639,17 @@ sub subsearch { sub ItemInfo { my ($env,$biblionumber,$type) = @_; my $dbh = &C4Connect; - my $query = "Select * from items, biblio, biblioitems, branches -where (items.biblioitemnumber = biblioitems.biblioitemnumber) -and biblioitems.biblionumber = biblio.biblionumber -and biblio.biblionumber = '$biblionumber' -and branches.branchcode = items.holdingbranch"; - + my $query = "SELECT * FROM items, biblio, biblioitems + WHERE items.biblionumber = '$biblionumber' + AND biblioitems.biblioitemnumber = items.biblioitemnumber + AND biblio.biblionumber = items.biblionumber"; if ($type ne 'intra'){ $query .= " and ((items.itemlost<>1 and items.itemlost <> 2) or items.itemlost is NULL) and (wthdrawn <> 1 or wthdrawn is NULL)"; } $query .= " order by items.dateaccessioned desc"; + warn $query; my $sth=$dbh->prepare($query); $sth->execute; my $i=0; @@ -675,13 +674,21 @@ and branches.branchcode = items.holdingbranch"; } if ($datedue eq ''){ $datedue="Available"; - my ($rescount,$reserves)=Findgroupreserve($data->{'biblioitemnumber'},$biblionumber); - - if ($rescount >0){ - $datedue='Request'; + my ($restype,$reserves)=CheckReserves($data->{'itemnumber'}); + if ($restype){ + $datedue=$restype; } } $isth->finish; +#get branch information..... + my $bquery = "SELECT * FROM branches + WHERE branchcode = '$data->{'holdingbranch'}'"; + my $bsth=$dbh->prepare($bquery); + $bsth->execute; + if (my $bdata=$bsth->fetchrow_hashref){ + $data->{'branchname'} = $bdata->{'branchname'}; + } + my $class = $data->{'classification'}; my $dewey = $data->{'dewey'}; $dewey =~ s/0+$//; -- 2.20.1