earling completion

This commit is contained in:
chris 2000-01-12 09:04:58 +00:00
parent 9b4fdda582
commit 1f3a88cffb
9 changed files with 156 additions and 86 deletions

View file

@ -53,6 +53,7 @@ sub remoteprint {
my $file=time;
my $queue = $env->{'queue'};
open(PRINTER, "| lpr -P $queue") or die "Couldn't write to queue:$!\n";
# print $queue;
#open (FILE,">/tmp/$file");
my $i=0;
print PRINTER "$borrower->{'cardnumber'}\r\n";

View file

@ -65,6 +65,7 @@ biblio.biblionumber=$bib";
reserves.borrowernumber=borrowers.borrowernumber and reserves.biblionumber
=biblio.biblionumber";
}
$query.=" order by priority";
my $sth=$dbh->prepare($query);
$sth->execute;
my $i=0;

View file

@ -83,6 +83,10 @@ sub OpacSearch {
$query=$query." and (author like '$key[$i]%' or author like '% $key[$i]%')";
$i++;
}
$query.=") or ((seriestitle like '$key[0]%' or seriestitle like '% $key[0]%')";
for ($i=1;$i<$count;$i++){
$query.=" and (seriestitle like '$key[$i]%' or seriestitle like '% $key[$i]%')";
}
$query=$query.") order by title";
my $sth=$dbh->prepare($query);
$sth->execute;
@ -188,12 +192,20 @@ sub KeywordSearch {
my @results;
my $query ="Select * from biblio,bibliosubtitle where
biblio.biblionumber=bibliosubtitle.biblionumber and
((title like '%$key[0]%' or subtitle like '%$key[0]%')";
(((title like '$key[0]%' or title like '% $key[0]%')";
while ($i < $count){
$query=$query." and (title like '%$key[$i]%' or subtitle like '%$key[$i]%')";
$query=$query." and (title like '$key[$i]%' or title like '% $key[$i]%')";
$i++;
}
$query=$query.") group by biblio.biblionumber order by author,title";
$query.= ") or ((subtitle like '$key[0]%' or subtitle like '% $key[0]%')";
for ($i=1;$i<$count;$i++){
$query.= " and (subtitle like '$key[$i]%' or subtitle like '% $key[$i]%')";
}
$query.= ") or ((seriestitle like '$key[0]%' or seriestitle like '% $key[0]%')";
for ($i=1;$i<$count;$i++){
$query.=" and (seriestitle like '$key[$i]%' or seriestitle like '% $key[$i]%')";
}
$query=$query.")) group by biblio.biblionumber order by author,title";
# print $query;
my $sth=$dbh->prepare($query);
$sth->execute;
@ -213,7 +225,7 @@ sub KeywordSearch {
$sth2->execute;
while (my $data2=$sth2->fetchrow_hashref){
$results[$i]="$data2->{'author'}\t$data2->{'title'}\t$data2->{'biblionumber'}\t$data->{'copyrightdate'}";
$results[$i]="$data2->{'author'}\t$data2->{'title'}\t$data2->{'biblionumber'}\t$data2->{'copyrightdate'}";
# print $results[$i];
$i++;
}
@ -224,7 +236,9 @@ $results[$i]="$data2->{'author'}\t$data2->{'title'}\t$data2->{'biblionumber'}\t$
my @res;
my $count=@results;
$i=1;
$res[0]=$results[0];
if ($count > 0){
$res[0]=$results[0];
}
while ($i2 < $count){
if ($results[$i2] ne $res[$i-1]){
$res[$i]=$results[$i2];
@ -242,6 +256,7 @@ $results[$i]="$data2->{'author'}\t$data2->{'title'}\t$data2->{'biblionumber'}\t$
}
$sth->finish;
$dbh->disconnect;
$i--;
return($i,@res2);
}
@ -282,14 +297,20 @@ sub CatSearch {
$query="select count(*) from biblio,bibliosubtitle
where
(biblio.biblionumber=bibliosubtitle.biblionumber) and
((title like '$key[0]%' or title like '% $key[0]%'
or subtitle like '$key[0]%' or title like '% $key[0]%')";
(((title like '$key[0]%' or title like '% $key[0]%')";
while ($i<$count){
$query=$query." and (title like '$key[$i]%' or title like '% $key[$i]%' or
subtitle like '$key[$i]%' or subtitle like '% $key[$i]%')";
$query=$query." and (title like '$key[$i]%' or title like '% $key[$i]%')";
$i++;
}
$query=$query.")";
$query.=") or ((subtitle like '$key[0]%' or subtitle like '% $key[0]%')";
for ($i=1;$i<$count;$i++){
$query.=" and (subtitle like '$key[$i]%' or subtitle like '% $key[$i]%')";
}
$query.=") or ((seriestitle like '$key[0]%' or seriestitle like '% $key[0]%')";
for ($i=1;$i<$count;$i++){
$query.=" and (seriestitle like '$key[$i]%' or seriestitle like '% $key[$i]%')";
}
$query=$query."))";
# if ($search->{'class'} ne ''){
# $query.=" and biblioitems.itemtype='$search->{'class'}'";
# }
@ -301,8 +322,15 @@ sub CatSearch {
}
}
if ($type eq 'subject'){
$query="select distinct(subject) from bibliosubject where subject like
'$search->{'subject'}%'";
my @key=split(' ',$search->{'subject'});
my $count=@key;
my $i=1;
$query="select distinct(subject) from bibliosubject where( subject like
'$key[0]%' or subject like '% $key[0]%')";
while ($i<$count){
$query.=" and (subject like '$key[$i]]%' or subject like '% $key[$i]%')";
$i++;
}
}
if ($type eq 'precise'){
$query="select count(*) from items,biblio ";
@ -465,7 +493,7 @@ sub ItemInfo {
# $results[$i]="$data->{'title'}\t$data->{'barcode'}\t$datedue\t$data->{'branchname'}\t$data->{'dewey'}";
my @temp=split('-',$data->{'datelastseen'});
my $date="$temp[2]/$temp[1]/$temp[0]";
$results[$i]="$data->{'title'}\t$data->{'barcode'}\t$datedue\t$data->{'branchname'}\t$class\t$data->{'itemnumber'}\t$data->{'itemtype'}\t$date\t$data->{'biblioitemnumber'}";
$results[$i]="$data->{'title'}\t$data->{'barcode'}\t$datedue\t$data->{'branchname'}\t$class\t$data->{'itemnumber'}\t$data->{'itemtype'}\t$date\t$data->{'biblioitemnumber'}\t$data->{'volumeddesc'}";
$i++;
}
@ -532,15 +560,23 @@ sub itemdata {
sub bibdata {
my ($bibnum,$type)=@_;
my $dbh=C4Connect;
my $query="Select * from biblio,biblioitems,bibliosubject,bibliosubtitle where biblio.biblionumber=$bibnum
and biblioitems.biblionumber=$bibnum and
(bibliosubject.biblionumber=$bibnum or bibliosubject.biblionumber=1) and
my $query="Select * from biblio,biblioitems,bibliosubtitle where biblio.biblionumber=$bibnum
and biblioitems.biblionumber=$bibnum and
(bibliosubtitle.biblionumber=$bibnum)";
# print $query;
my $sth=$dbh->prepare($query);
$sth->execute;
my $data=$sth->fetchrow_hashref;
$sth->finish;
$query="Select * from bibliosubject where biblionumber='$bibnum'";
$sth=$dbh->prepare($query);
$sth->execute;
while (my $dat=$sth->fetchrow_hashref){
$data->{'subject'}.=", $dat->{'subject'}";
}
#print $query;
$sth->finish;
$dbh->disconnect;
return($data);
}
@ -631,8 +667,8 @@ sub BornameSearch {
";
for (my $i=1;$i<$count;$i++){
$query=$query." and (surname like '%$data[$i]%'
or firstname like '%$data[$i]%'
or othernames like '%$data[$i]%')";
or firstname like '$data[$i]%'
or othernames like '$data[$i]%')";
}
$query=$query.") or cardnumber = '$searchstring'
order by surname,firstname";

View file

@ -73,51 +73,51 @@ printend
;
if ($type ne 'opac'){
print <<printend
Subtitle: $dat->{'subtitle'}<br>
Author: $dat->{'author'}<br>
Additional Author: <br>
Seriestitle: $dat->{'seriestitle'}<br>
Subject: $dat->{'subject'}<br>
Copyright:$dat->{'copyrightdate'}<br>
Notes: $dat->{'notes'}<br>
Unititle: $dat->{'unititle'}<br>
Analytical Author: <br>
Analytical Title: <br>
Serial: $dat->{'serial'}<br>
Total Number of Items: $count
<b>Subtitle:</b> $dat->{'subtitle'}<br>
<b>Author:</b> $dat->{'author'}<br>
<b>Additional Author:</b> <br>
<b>Series Title:</b> $dat->{'seriestitle'}<br>
<b>Subject:</b> $dat->{'subject'}<br>
<b>Copyright:</b> $dat->{'copyrightdate'}<br>
<b>Notes:</b> $dat->{'notes'}<br>
<b>Unititle:</b> $dat->{'unititle'}<br>
<b>Analytical Author:</b> <br>
<b>Analytical Title:</b> <br>
<b>Serial:</b> $dat->{'serial'}<br>
<b>Total Number of Items:</b> $count
<p>
printend
;
}
else {
if ($dat->{'subtitle'} ne ''){
print "Subtitle: $dat->{'subtitle'}<br>";
print "<b>Subtitle:</b> $dat->{'subtitle'}<br>";
}
if ($dat->{'author'} ne ''){
print "Author: $dat->{'author'}<br>";
print "<b>Author:</b> $dat->{'author'}<br>";
}
#Additional Author: <br>
if ($dat->{'seriestitle'} ne ''){
print "Seriestitle: $dat->{'seriestitle'}<br>";
print "<b>Seriestitle:</b> $dat->{'seriestitle'}<br>";
}
if ($dat->{'subject'} ne ''){
print "Subject: $dat->{'subject'}<br>";
print "<b>Subject:</b> $dat->{'subject'}<br>";
}
if ($dat->{'copyrightdate'} ne ''){
print "Copyright:$dat->{'copyrightdate'}<br>";
print "<b>Copyright:</b> $dat->{'copyrightdate'}<br>";
}
if ($dat->{'notes'} ne ''){
print "Notes: $dat->{'notes'}<br>";
print "<b>Notes:</b> $dat->{'notes'}<br>";
}
if ($dat->{'unititle'} ne ''){
print "Unititle: $dat->{'unititle'}<br>";
print "<b>Unititle:</b> $dat->{'unititle'}<br>";
}
#Analytical Author: <br>
#Analytical Title: <br>
if ($dat->{'serial'} ne '0'){
print "Serial: Yes<br>";
print "<b>Serial:</b> Yes<br>";
}
print "Total Number of Items: $count
print "<b>Total Number of Items:</b> $count
<p>
";
@ -142,9 +142,10 @@ my $i=0;
print center();
print mktablehdr;
if ($type eq 'opac'){
print mktablerow(5,$main,'Itemtype','Class','Branch','DateDue','Lastseen');
print mktablerow(5,$main,'Item Type','Class','Branch','Date Due','Last Seen');
} else {
print mktablerow(6,$main,'Itemtype','Class','Location','DateDue','Lastseen','Barcode',"/images/background-mem.gif");
print mktablerow(6,$main,'Itemtype','Class','Location','Date Due','Last Seen','Barcode',"/images/background-mem.gif");
}
my $colour=1;
while ($i < $count){
@ -157,18 +158,34 @@ while ($i < $count){
}
if ($colour == 1){
if ($type ne 'opac'){
print mktablerow(6,$secondary,$results[6],$results[4],$results[3],$results[2],$results[7],$results[1]);
if ($results[6] eq 'PER'){
print mktablerow(7,$secondary,$results[6],$results[4],$results[3],$results[2],$results[7],$results[1],$results[9]);
} else {
print mktablerow(6,$secondary,$results[6],$results[4],$results[3],$results[2],$results[7],$results[1]);
}
} else {
$results[6]=ItemType($results[6]);
print mktablerow(5,$secondary,$results[6],$results[4],$results[3],$results[2],$results[7]);
if ($results[6] =~ /Periodical/){
print mktablerow(6,$secondary,$results[6],$results[4],$results[3],$results[2],$results[7],$results[9]);
} else {
print mktablerow(5,$secondary,$results[6],$results[4],$results[3],$results[2],$results[7]);
}
}
$colour=0;
} else{
if ($type ne 'opac'){
print mktablerow(6,'white',$results[6],$results[4],$results[3],$results[2],$results[7],$results[1]);
if ($results[6] eq 'PER'){
print mktablerow(7,'white',$results[6],$results[4],$results[3],$results[2],$results[7],$results[1],$results[9]);
}else{
print mktablerow(6,'white',$results[6],$results[4],$results[3],$results[2],$results[7],$results[1]);
}
} else {
$results[6]=ItemType($results[6]);
print mktablerow(5,'white',$results[6],$results[4],$results[3],$results[2],$results[7]);
if ($results[6] =~ /Periodical/){
print mktablerow(6,'white',$results[6],$results[4],$results[3],$results[2],$results[7],$results[9]);
} else {
print mktablerow(5,'white',$results[6],$results[4],$results[3],$results[2],$results[7]);
}
}
$colour=1;
}

View file

@ -265,8 +265,13 @@ print ">X - Temporary Visitor
if ($data->{'area'} eq 'Z'){
print " Selected";
}
print ">Z - Interloan Libraries
<OPTION value=V";
if ($data->{'area'} eq 'V'){
print " Selected";
}
print ">V - Villlage";
print <<printend
>Z - Interloan Libraries
</SELECT></td></tr>
<tr valign=top bgcolor=white>
<td COLSPAN=3><FONT SIZE=2>Postal Address*</FONT></td>

View file

@ -56,18 +56,18 @@ print <<printend
<INPUT TYPE="image" name="submit" VALUE="modify" height=42 WIDTH=93 BORDER=0 src="/images/delete-mem.gif">
<br>
<FONT SIZE=2 face="arial, helvetica">
Biblionumber:$bib<br>
Item Type:$data->{'itemtype'}<br>
Loan Length: $data->{'loanlength'}<br>
Rental Charge: $data->{'rentalscharge'}<br>
Classification:$data->{'classification'}$data->{'dewey'}$data->{'subclass'}<br>
ISBN: $data->{'isbn'}<br>
Publisher: <br>
Place:<br>
Date:$data->{'publicationdate'}<br>
Pages:$data->{'pages'}<br>
Illus:$data->{'illus'}<br>
No. of Items:$count
<b>Biblionumber:</b> $bib<br>
<b>Item Type:</b> $data->{'itemtype'}<br>
<b>Loan Length:</b> $data->{'loanlength'}<br>
<b>Rental Charge:</b> $data->{'rentalscharge'}<br>
<b>Classification:</b> $data->{'classification'}$data->{'dewey'}$data->{'subclass'}<br>
<b>ISBN:</b> $data->{'isbn'}<br>
<b>Publisher:</b> $data->{'publishercode'} <br>
<b>Place:</b><br>
<b>Date:</b> $data->{'publicationdate'}<br>
<b>Pages:</b> $data->{'pages'}<br>
<b>Illus:</b> $data->{'illus'}<br>
<b>No. of Items:</b> $count
</font>
</TD>
</tr>
@ -102,25 +102,25 @@ my @temp=split('-',$items[$i]->{'dateaccessioned'});
$items[$i]->{'dateaccessioned'}="$temp[2]/$temp[1]/$temp[0]";
print <<printend
<FONT SIZE=2 face="arial, helvetica">
Home Branch: $items[$i]->{'homebranch'}<br>
Last seen: $items[$i]->{'datelastseen'}<br>
Last borrowed: $items[$i]->{'timestamp0'}<br>
Currently on issue to: $items[$i]->{'card0'}<br>
Last Borrower 1: $items[$i]->{'card0'}<br>
Last Borrower 2: $items[$i]->{'card1'}<br>
Current Branch: $items[$i]->{'holdingbranch'}<br>
Replacement Price: $items[$i]->{'replacementprice'}<br>
Item lost:$items[$i]->{'itemlost'}<br>
paid by:<br>
Notes: $items[$i]->{'itemnotes'}<br>
Renewals: $items[$i]->{'renewals'}<br>
Requests: put in current reserves<br>
<b>Home Branch:</b> $items[$i]->{'homebranch'}<br>
<b>Last seen:</b> $items[$i]->{'datelastseen'}<br>
<b>Last borrowed:</b> $items[$i]->{'timestamp0'}<br>
<b>Currently on issue to:</b> $items[$i]->{'card0'}<br>
<b>Last Borrower 1:</b> $items[$i]->{'card0'}<br>
<b>Last Borrower 2:</b> $items[$i]->{'card1'}<br>
<b>Current Branch:</b> $items[$i]->{'holdingbranch'}<br>
<b>Replacement Price:</b> $items[$i]->{'replacementprice'}<br>
<b>Item lost:</b> $items[$i]->{'itemlost'}<br>
<b>paid by:</b><br>
<b>Notes:</b> $items[$i]->{'itemnotes'}<br>
<b>Renewals:</b> $items[$i]->{'renewals'}<br>
<b>Requests:</b> put in current reserves<br>
waiting: <br>
Accession Date: $items[$i]->{'dateaccessioned'}<br>
Cancelled: $items[$i]->{'withdrawn'}<br>
Total Issues: $items[$i]->{'issues'}<br>
Group Number: $bi <br>
Biblio number: $bib <br>
<b>Accession Date: $items[$i]->{'dateaccessioned'}<br>
<b>Cancelled: $items[$i]->{'withdrawn'}<br>
<b>Total Issues:</b> $items[$i]->{'issues'}<br>
<b>Group Number:</b> $bi <br>
<b>Biblio number:</b> $bib <br>

View file

@ -58,7 +58,7 @@ if ($insert eq ''){
$ok=1;
}
#we are printing confirmation page
print mkheadr(1,'Confirm New Adult Member');
print mkheadr(1,'Confirm Record');
if ($ok ==0){
print mktablehdr;
print mktablerow(2,$main,bold('NEW MEMBER'),"",$image);
@ -73,7 +73,7 @@ if ($insert eq ''){
print mktablerow(2,$main,bold('MEMBERSHIP DETAILS'),"",$image);
print mktablerow(2,'white',bold('Membership Number'),$data{'borrowernumber'});
print mktablerow(2,'white',bold('Cardnumber'),$data{'cardnumber'});
print mktablerow(2,'white',bold('Membership Category'),$data{'category'});
print mktablerow(2,'white',bold('Membership Category'),$data{'categorycode'});
print mktablerow(2,'white',bold('Area'),$data{'area'});
print mktablerow(2,'white',bold('Fee'),$data{'fee'});
if ($data{'joining'} eq ''){
@ -114,7 +114,7 @@ if ($insert eq ''){
print mktablerow(2,$main,bold('ALTERNATIVE CONTACT DETAILS'),"",$image);
print mktablerow(2,'white',bold('Name'),$data{'contactname'});
print mktablerow(2,'white',bold('Phone'),$data{'altphone'});
print mktablerow(2,'white',bold('Relationship'),$data{'relation'});
print mktablerow(2,'white',bold('Relationship'),$data{'altrelationship'});
print mktablerow(2,'white',bold('Notes'),$data{'altnotes'});
print mktablerow(2,$main,bold('Notes'),"",$image);
print mktablerow(2,'white',bold('General Notes'),$data{'borrowernotes'});

View file

@ -33,19 +33,19 @@ if ($num eq ''){
}
print startpage();
print startmenu('opac');
print mkheadr(1,'Opac Search Results');
print mkheadr(1,"Opac Search Results for $keyword");
print center();
my $count;
my @results;
($count,@results)=&OpacSearch(\$blah,'loose',\%search,$num,$offset);
print "You searched on <b>$keyword</b>";
#print "You searched on <b>$keyword</b>";
print " $count results found";
my $offset2=$num+$offset;
my $disp=$offset+1;
print "<br> Results $disp to $offset2 displayed";
print ", Results $disp to $offset2 displayed";
print mktablehdr;
print mktablerow(4,'#99cccc','<b>TITLE</b>','<b>AUTHOR</b>','<b>COUNT</b>',bold('BRANCH'));
@ -107,13 +107,17 @@ while ($i < $count2){
$i++;
}
$offset=$num+$offset;
print mktablerow(4,'#99cccc',' &nbsp; ',' &nbsp; ',' &nbsp;',' &nbsp;');
print mktableft();
if ($offset < $count){
my $search="num=$num&offset=$offset&keyword=$keyword";
my $stuff=mklink("/cgi-bin/koha/opac-search.pl?$search",'Next');
print $stuff;
my $stuff=mklink("/cgi-bin/koha/opac-search.pl?$search",'Next Results');
# print $stuff;
print "<tr valign=top bgcolor=#99cccc><td colspan=4>$stuff
</td></tr>";
} else {
print mktablerow(4,'#99cccc',' &nbsp; ',' &nbsp; ',' &nbsp;',' &nbsp;');
}
print mktableft();
print endcenter();
print endmenu('opac');

View file

@ -108,6 +108,12 @@ if ($type ne 'opac'){
}
}
my $count2=@results;
if ($keyword ne '' && $offset > 0){
$count2=$count-$offset;
if ($count2 > 10){
$count2=10;
}
}
#print $count2;
my $i=0;
my $colour=1;