From rangi@users.sourceforge.net Mon May 6 17:09:09 2002 From: Chris Cormack To: koha-devel@lists.koha-community.org Subject: [Koha-devel] CVS: koha/acqui newbasket2.pl,1.1.1.1,1.2 Date: Mon, 06 May 2002 17:10:02 +0000 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6669168060596631111==" --===============6669168060596631111== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Update of /cvsroot/koha/koha/acqui In directory usw-pr-cvs1:/tmp/cvs-serv15194/acqui Modified Files: newbasket2.pl=20 Log Message: Now use the new hash based results returned from Search.pm Index: newbasket2.pl =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/koha/koha/acqui/newbasket2.pl,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** newbasket2.pl 19 Dec 2000 23:45:56 -0000 1.1.1.1 --- newbasket2.pl 7 May 2002 00:09:06 -0000 1.2 *************** *** 30,36 **** my $title=3D$input->param('search'); $search{'title'}=3D$title; ! my $keyword=3D$input->param('search'); $search{'keyword'}=3D$keyword; ! my $author=3D$input->param('search'); $search{'author'}=3D$author; =20 --- 30,36 ---- my $title=3D$input->param('search'); $search{'title'}=3D$title; ! my $keyword=3D$input->param('d'); $search{'keyword'}=3D$keyword; ! my $author=3D$input->param('author'); $search{'author'}=3D$author; =20 *************** *** 46,52 **** my $id=3D$input->param('id'); my $basket=3D$input->param('basket'); !=20 my ($count,@booksellers)=3Dbookseller($id); - print startpage(); =20 =20 print startpage(); --- 46,56 ---- my $id=3D$input->param('id'); my $basket=3D$input->param('basket'); ! my $sub=3D$input->param('sub'); ! my $donation; ! if ($id =3D=3D 72){ ! $donation=3D'yes'; ! } ! #print $sub; my ($count,@booksellers)=3Dbookseller($id); =20 print startpage(); *************** *** 54,60 **** print mkheadr(1,"Shopping Basket For: $booksellers[0]->{'name'}"); =20 print <3D"Add 3D"View =20 --- 58,68 ---- print mkheadr(1,"Shopping Basket For: $booksellers[0]->{'name'}"); =20 + if ($donation ne 'yes'){ + print ""; + } else { + print ""; + } print < 3D"View =20 *************** *** 72,84 **** my @results; =20 ! if ($keyword ne ''){ ! # print "hey"; ! ($count,@results)=3D&KeywordSearch(\$blah,'intra',\%search,$num,$offs= et); ! } elsif ($search{'front'} ne '') { ! ($count,@results)&FrontSearch(\$blah,'intra',\%search,$num,$offset); ! }else { ($count,@results)=3D&CatSearch(\$blah,'loose',\%search,$num,$offset); ! # print "hey"; ! } =20 print "You searched on "; --- 80,86 ---- my @results; =20 !=20 ($count,@results)=3D&CatSearch(\$blah,'loose',\%search,$num,$offset); !=20 =20 print "You searched on "; *************** *** 111,125 **** while ($i < $count2){ # print $results[$i]."\n"; ! my @stuff=3Dsplit('\t',$results[$i]); ! $stuff[1]=3D~ s/\`/\\\'/g; ! my $title2=3D$stuff[1]; ! my $author2=3D$stuff[0]; ! my $copyright=3D$stuff[3]; $author2=3D~ s/ /%20/g; $title2=3D~ s/ /%20/g; $title2=3D~ s/\#/\&\#x23;/g; ! $stuff[1]=3Dmklink("/cgi-bin/koha/acqui/newbiblio.pl?title=3D$title2&= author=3D$author2©right=3D$copyright&id=3D$id&basket=3D$basket&biblio=3D$= stuff[2]",$stuff[1]); ! my $word=3D$stuff[0]; ! # print $word; $word=3D~ s/([a-z]) +([a-z])/$1%20$2/ig; $word=3D~ s/ //g; --- 113,134 ---- while ($i < $count2){ # print $results[$i]."\n"; ! # my @stuff=3Dsplit('\t',$results[$i]); ! my $result=3D$results[$i]; ! $result->{'title'}=3D~ s/\`/\\\'/g; ! my $title2=3D$result->{'title'}; ! my $author2=3D$result->{'author'}; ! my $copyright=3D$result->{'copyrightdate'}; $author2=3D~ s/ /%20/g; $title2=3D~ s/ /%20/g; $title2=3D~ s/\#/\&\#x23;/g; ! $title2=3D~ s/\"/\"\;/g; ! my $itemcount; ! my $location=3D''; ! if ($donation eq 'yes'){ ! $result->{'title'}=3Dmklink("/cgi-bin/koha/acqui/newdonation.pl?autho= r=3D$author2©right=3D$copyright&id=3D$id&basket=3D$basket&biblio=3D$resul= t->{'biblionumber'}&title=3D$title2",$result->{'title'}); ! } else { ! $result->{'title'}=3Dmklink("/cgi-bin/koha/acqui/newbiblio.pl?sub=3D$= sub&author=3D$author2©right=3D$copyright&id=3D$id&basket=3D$basket&biblio= =3D$result->{'biblionumber'}&title=3D$title2",$result->{'title'}); ! } =20 ! my $word=3D$result->{'author'}; $word=3D~ s/([a-z]) +([a-z])/$1%20$2/ig; $word=3D~ s/ //g; *************** *** 128,189 **** $word=3D~ s/\n//g; my $url=3D"/cgi-bin/koha/search.pl?author=3D$word&type=3D$type"; ! $stuff[0]=3Dmklink($url,$stuff[0]); ! my ($count,$lcount,$nacount,$fcount,$scount,$lostcount,$mending,$tran= sit)=3Ditemcount($env,$stuff[2],$type); ! $stuff[4]=3D$count; if ($nacount > 0){ ! $stuff[5]=3D$stuff[5]."On Loan"; if ($nacount >1 ){ = =20 ! $stuff[5]=3D$stuff[5]." ($nacount)"; = =20 } = =20 ! $stuff[5].=3D" "; } if ($lcount > 0){ ! $stuff[5]=3D$stuff[5]."Levin"; if ($lcount >1 ){ = =20 ! $stuff[5]=3D$stuff[5]." ($lcount)"; = =20 } = =20 ! $stuff[5].=3D" "; } if ($fcount > 0){ ! $stuff[5]=3D$stuff[5]."Foxton"; if ($fcount >1 ){ = =20 ! $stuff[5]=3D$stuff[5]." ($fcount)"; = =20 } = =20 ! $stuff[5].=3D" ";=09 } if ($scount > 0){ ! $stuff[5]=3D$stuff[5]."Shannon"; if ($scount >1 ){ = =20 ! $stuff[5]=3D$stuff[5]." ($scount)"; = =20 } = =20 ! $stuff[5].=3D" ";=09 } if ($lostcount > 0){ ! $stuff[5]=3D$stuff[5]."Lost"; if ($lostcount >1 ){ = =20 ! $stuff[5]=3D$stuff[5]." ($lostcount)"; = =20 } = =20 ! $stuff[5].=3D" ";=09 } if ($mending > 0){ ! $stuff[5]=3D$stuff[5]."Mending"; if ($mending >1 ){ = =20 ! $stuff[5]=3D$stuff[5]." ($mending)"; = =20 } = =20 ! $stuff[5].=3D" ";=09 } if ($transit > 0){ ! $stuff[5]=3D$stuff[5]."In Transiit"; if ($transit >1 ){ = =20 ! $stuff[5]=3D$stuff[5]." ($transit)"; = =20 } = =20 ! $stuff[5].=3D" ";=09 } =20 if ($colour =3D=3D 1){ ! print mktablerow(6,$secondary,$stuff[1],$stuff[0],$stuff[3],$stuff[4]= ,$stuff[5],$stuff[6]); $colour=3D0; } else{ ! print mktablerow(6,'white',$stuff[1],$stuff[0],$stuff[3],$stuff[4],$s= tuff[5],$stuff[6]); $colour=3D1; } --- 137,198 ---- $word=3D~ s/\n//g; my $url=3D"/cgi-bin/koha/search.pl?author=3D$word&type=3D$type"; ! $result->{'author'}=3Dmklink($url,$result->{'author'}); ! my ($count,$lcount,$nacount,$fcount,$scount,$lostcount,$mending,$tran= sit)=3Ditemcount($env,$result->{'biblionumber'},$type); ! $itemcount=3D$count; if ($nacount > 0){ ! $location=3D$location."On Loan"; if ($nacount >1 ){ = =20 ! $location=3D$location." ($nacount)"; = =20 } = =20 ! $location.=3D" "; } if ($lcount > 0){ ! $location=3D$location."Levin"; if ($lcount >1 ){ = =20 ! $location=3D$location." ($lcount)"; = =20 } = =20 ! $location.=3D" "; } if ($fcount > 0){ ! $location=3D$location."Foxton"; if ($fcount >1 ){ = =20 ! $location=3D$location." ($fcount)"; = =20 } = =20 ! $location.=3D" ";=09 } if ($scount > 0){ ! $location=3D$location."Shannon"; if ($scount >1 ){ = =20 ! $location=3D$location." ($scount)"; = =20 } = =20 ! $location.=3D" ";=09 } if ($lostcount > 0){ ! $location=3D$location."Lost"; if ($lostcount >1 ){ = =20 ! $location=3D$location." ($lostcount)"; = =20 } = =20 ! $location.=3D" ";=09 } if ($mending > 0){ ! $location=3D$location."Mending"; if ($mending >1 ){ = =20 ! $location=3D$location." ($mending)"; = =20 } = =20 ! $location.=3D" ";=09 } if ($transit > 0){ ! $location=3D$location."In Transiit"; if ($transit >1 ){ = =20 ! $location=3D$location." ($transit)"; = =20 } = =20 ! $location.=3D" ";=09 } =20 if ($colour =3D=3D 1){ ! print mktablerow(6,$secondary,$result->{'title'},$result->{'author'},= $result->{'copyrightdate'},$itemcount,$location); $colour=3D0; } else{ ! print mktablerow(6,'white',$result->{'title'},$result->{'author'},$re= sult->{'copyrightdate'},$itemcount,$location); $colour=3D1; } *************** *** 196,200 **** print mktableft(); if ($offset < $count){ ! my $search=3D"num=3D$num&offset=3D$offset&type=3D$type&id=3D$id&basket= =3D$basket&search=3D$keyword"; my $stuff=3Dmklink("/cgi-bin/koha/acqui/newbasket2.pl?$search",'Next'); print $stuff; --- 205,209 ---- print mktableft(); if ($offset < $count){ ! my $search=3D"num=3D$num&offset=3D$offset&type=3D$type&id=3D$id&basket= =3D$basket&search=3D$title&author=3D$author"; my $stuff=3Dmklink("/cgi-bin/koha/acqui/newbasket2.pl?$search",'Next'); print $stuff; --===============6669168060596631111==--