Update of /cvsroot/koha/koha/C4 In directory usw-pr-cvs1:/tmp/cvs-serv3802/C4 Modified Files: Search.pm Log Message: Fixing a glitch that was showing the biblio notes field where the biblioitems notes should have been displaying Index: Search.pm =================================================================== RCS file: /cvsroot/koha/koha/C4/Search.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** Search.pm 2001/06/20 03:36:01 1.3 --- Search.pm 2001/09/10 23:37:09 1.4 *************** *** 20,24 **** &OpacSearch &borrdata2 &NewBorrowerNumber &bibitemdata &borrissues &getboracctrecord &ItemType &itemissues &FrontSearch &subject &subtitle ! &addauthor &bibitems &barcodes &findguarantees &allissues &systemprefs); %EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ], --- 20,25 ---- &OpacSearch &borrdata2 &NewBorrowerNumber &bibitemdata &borrissues &getboracctrecord &ItemType &itemissues &FrontSearch &subject &subtitle ! &addauthor &bibitems &barcodes &findguarantees &allissues &systemprefs ! &findguarantor); %EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ], *************** *** 73,76 **** --- 74,95 ---- } + sub findguarantor{ + my ($bornum)=@_; + my $dbh=C4Connect; + my $query="select guarantor from borrowers where + borrowernumber='$bornum'"; + my $sth=$dbh->prepare($query); + $sth->execute; + my $data=$sth->fetchrow_hashref; + $sth->finish; + $query="Select * from borrowers where borrowernumber='$data->{'guarantor'}'"; + $sth=$dbh->prepare($query); + $sth->execute; + $data=$sth->fetchrow_hashref; + $sth->finish; + $dbh->disconnect; + return($data); + } + sub NewBorrowerNumber { my $dbh=C4Connect; *************** *** 215,221 **** my $i=1; my @results; ! my $query ="Select * from biblio,bibliosubtitle,biblioitems where ! biblio.biblionumber=bibliosubtitle.biblionumber and ! biblioitems.biblionumber=biblio.biblionumber and (((title like '$key[0]%' or title like '% $key[0]%')"; while ($i < $count){ --- 234,243 ---- my $i=1; my @results; ! my $query ="Select * from biblio ! left join bibliosubtitle on ! bibliosubtitle.biblionumber=biblio.biblionumber ! left join biblioitems on ! biblioitems.biblionumber=biblio.biblionumber ! where (((title like '$key[0]%' or title like '% $key[0]%')"; while ($i < $count){ *************** *** 345,353 **** my $i=1; $query="select *,biblio.author,biblio.biblionumber from ! biblioitems,biblio left join additionalauthors on additionalauthors.biblionumber =biblio.biblionumber ! where biblioitems.biblionumber=biblio.biblionumber ! and ((biblio.author like '$key[0]%' or biblio.author like '% $key[0]%' or additionalauthors.author like '$key[0]%' or additionalauthors.author --- 367,375 ---- my $i=1; $query="select *,biblio.author,biblio.biblionumber from ! biblio left join additionalauthors on additionalauthors.biblionumber =biblio.biblionumber ! left join biblioitems on biblioitems.biblionumber=biblio.biblionumber ! where ((biblio.author like '$key[0]%' or biblio.author like '% $key[0]%' or additionalauthors.author like '$key[0]%' or additionalauthors.author *************** *** 397,404 **** my $count=@key; my $i=1; ! $query="select * from biblio,bibliosubtitle,biblioitems where - (biblio.biblionumber=bibliosubtitle.biblionumber and - biblioitems.biblionumber=biblio.biblionumber) and (((title like '$key[0]%' or title like '% $key[0]%' or title like '% $key[0]')"; while ($i<$count){ --- 419,427 ---- my $count=@key; my $i=1; ! $query="select * from biblio ! left join bibliosubtitle on ! bibliosubtitle.biblionumber=biblio.biblionumber ! left join biblioitems on biblioitems.biblionumber=biblio.biblionumber where (((title like '$key[0]%' or title like '% $key[0]%' or title like '% $key[0]')"; while ($i<$count){ *************** *** 714,718 **** my ($bibitem)=@_; my $dbh=C4Connect; ! my $query="Select * from biblio,biblioitems,itemtypes where biblio.biblionumber= biblioitems.biblionumber and biblioitemnumber=$bibitem and biblioitems.itemtype=itemtypes.itemtype"; --- 737,742 ---- my ($bibitem)=@_; my $dbh=C4Connect; ! my $query="Select *, biblioitems.notes as bnotes ! from biblio,biblioitems,itemtypes where biblio.biblionumber= biblioitems.biblionumber and biblioitemnumber=$bibitem and biblioitems.itemtype=itemtypes.itemtype"; *************** *** 1043,1048 **** biblionumber=$bibnum "; if ($type eq 'opac'){ ! $query.=" and (itemlost <>1 or itemlost is NULL) and ! (wthdrawn <> 1 or wthdrawn is NULL)"; } my $sth=$dbh->prepare($query); --- 1067,1072 ---- biblionumber=$bibnum "; if ($type eq 'opac'){ ! $query.=" and (itemlost =0 or itemlost is NULL) and ! (wthdrawn = 0 or wthdrawn is NULL)"; } my $sth=$dbh->prepare($query); *************** *** 1078,1082 **** $scount++; } ! if ($data->{'itemlost'} eq '1'){ $lostcount++; } --- 1102,1106 ---- $scount++; } ! if ($data->{'itemlost'} eq '1' || $data->{'itemlost'} eq '2'){ $lostcount++; }