Browse Source

continuing bug fixes

master
chris 25 years ago
parent
commit
9453fe6086
  1. 2
      C4/Circulation/Fines.pm
  2. 2
      C4/Output.pm
  3. 11
      C4/Search.pm
  4. 16
      opac-search.pl
  5. 6
      request.pl
  6. 19
      search.pl

2
C4/Circulation/Fines.pm

@ -93,7 +93,7 @@ sub CalcFine {
$amount=$data->{'fine'}*2; $amount=$data->{'fine'}*2;
$printout="Second Notice"; $printout="Second Notice";
} }
if ($difference == $data->{'accountsent'}){ if ($difference == $data->{'accountsent'} && $data->{'fine'} > 0){
$amount=5; $amount=5;
$printout="Final Notice"; $printout="Final Notice";
} }

2
C4/Output.pm

@ -268,7 +268,7 @@ sub endpage{
sub mklink { sub mklink {
my ($url,$text)=@_; my ($url,$text)=@_;
my $string="<a href=$url>$text</a>"; my $string="<a href=\"$url\">$text</a>";
return ($string); return ($string);
} }

11
C4/Search.pm

@ -850,6 +850,8 @@ sub itemcount {
my $fcount=0; my $fcount=0;
my $scount=0; my $scount=0;
my $lostcount=0; my $lostcount=0;
my $mending=0;
my $transit=0;
while (my $data=$sth->fetchrow_hashref){ while (my $data=$sth->fetchrow_hashref){
$count++; $count++;
my $query2="select * from issues,items where issues.itemnumber= my $query2="select * from issues,items where issues.itemnumber=
@ -872,13 +874,18 @@ sub itemcount {
if ($data->{'itemlost'} eq '1'){ if ($data->{'itemlost'} eq '1'){
$lostcount++; $lostcount++;
} }
if ($data->{'holdingbranch'} eq 'FM'){
$mending++;
}
if ($data->{'holdingbranch'} eq 'TR'){
$transit++;
}
} }
$sth2->finish; $sth2->finish;
} }
$sth->finish; $sth->finish;
$dbh->disconnect; $dbh->disconnect;
return ($count,$lcount,$nacount,$fcount,$scount,$lostcount); return ($count,$lcount,$nacount,$fcount,$scount,$lostcount,$mending,$transit);
} }
sub ItemType { sub ItemType {

16
opac-search.pl

@ -67,7 +67,7 @@ while ($i < $count2){
$word=~ s/\n//g; $word=~ s/\n//g;
my $url="/cgi-bin/koha/search.pl?author=$word&type=opac"; my $url="/cgi-bin/koha/search.pl?author=$word&type=opac";
$stuff[0]=mklink($url,$stuff[0]); $stuff[0]=mklink($url,$stuff[0]);
my ($count,$lcount,$nacount,$fcount,$scount)=itemcount($env,$stuff[2]); my ($count,$lcount,$nacount,$fcount,$scount,$lostcount,$mending,$transit)=itemcount($env,$stuff[2]);
$stuff[3]=$count; $stuff[3]=$count;
if ($nacount > 0){ if ($nacount > 0){
$stuff[4]=$stuff[4]."On Loan"; $stuff[4]=$stuff[4]."On Loan";
@ -97,6 +97,20 @@ while ($i < $count2){
} }
$stuff[4].=" "; $stuff[4].=" ";
} }
if ($mending > 0){
$stuff[4]=$stuff[4]."Mending";
if ($mending >1 ){
$stuff[4]=$stuff[4]." ($mending)";
}
$stuff[4].=" ";
}
if ($transit > 0){
$stuff[4]=$stuff[4]."In Transit";
if ($transit >1 ){
$stuff[4]=$stuff[4]." ($transit)";
}
$stuff[4].=" ";
}
if ($colour == 1){ if ($colour == 1){
print mktablerow(4,'#efe5ef',$stuff[1],$stuff[0],$stuff[3],$stuff[4]); print mktablerow(4,'#efe5ef',$stuff[1],$stuff[0],$stuff[3],$stuff[4]);
$colour=0; $colour=0;

6
request.pl

@ -67,7 +67,7 @@ print <<printend
<TD><input type=text size=20 name=member></td> <TD><input type=text size=20 name=member></td>
<TD>$date</td> <TD>$date</td>
<TD><select name=pickup> <TD><select name=pickup>
<option value=L>Levin <option value=C>Levin
<option value=F>Foxton <option value=F>Foxton
<option value=S>Shannon <option value=S>Shannon
<option value=T>Tokomaru <option value=T>Tokomaru
@ -173,8 +173,8 @@ print "</select>
<TD><a href=/cgi-bin/koha/member.pl?member=$bor>$reserves->[$i]{'firstname'} $reserves->[$i]{'surname'}</a></td> <TD><a href=/cgi-bin/koha/member.pl?member=$bor>$reserves->[$i]{'firstname'} $reserves->[$i]{'surname'}</a></td>
<TD>$date</td> <TD>$date</td>
<TD><select name=pickup> <TD><select name=pickup>
<option value=L"; <option value=C";
if ($reserves->[$i]{'branchcode'} eq 'L'){ if ($reserves->[$i]{'branchcode'} eq 'C'){
print " selected"; print " selected";
} }
print ">Levin print ">Levin

19
search.pl

@ -123,7 +123,7 @@ my $colour=1;
while ($i < $count2){ while ($i < $count2){
# print $results[$i]."\n"; # print $results[$i]."\n";
my @stuff=split('\t',$results[$i]); my @stuff=split('\t',$results[$i]);
$stuff[1]=~ s/\`/\'/g; $stuff[1]=~ s/\`/\\\'/g;
my $title2=$stuff[1]; my $title2=$stuff[1];
$title2=~ s/ /%20/g; $title2=~ s/ /%20/g;
if ($subject eq ''){ if ($subject eq ''){
@ -138,7 +138,7 @@ while ($i < $count2){
$word=~ s/\n//g; $word=~ s/\n//g;
my $url="/cgi-bin/koha/search.pl?author=$word&type=$type"; my $url="/cgi-bin/koha/search.pl?author=$word&type=$type";
$stuff[0]=mklink($url,$stuff[0]); $stuff[0]=mklink($url,$stuff[0]);
my ($count,$lcount,$nacount,$fcount,$scount,$lostcount)=itemcount($env,$stuff[2],$type); my ($count,$lcount,$nacount,$fcount,$scount,$lostcount,$mending,$transit)=itemcount($env,$stuff[2],$type);
$stuff[4]=$count; $stuff[4]=$count;
if ($nacount > 0){ if ($nacount > 0){
$stuff[5]=$stuff[5]."On Loan"; $stuff[5]=$stuff[5]."On Loan";
@ -175,6 +175,21 @@ while ($i < $count2){
} }
$stuff[5].=" "; $stuff[5].=" ";
} }
if ($mending > 0){
$stuff[5]=$stuff[5]."Mending";
if ($mending >1 ){
$stuff[5]=$stuff[5]." ($mending)";
}
$stuff[5].=" ";
}
if ($transit > 0){
$stuff[5]=$stuff[5]."In Transiit";
if ($transit >1 ){
$stuff[5]=$stuff[5]." ($transit)";
}
$stuff[5].=" ";
}
if ($type ne 'opac'){ if ($type ne 'opac'){
$stuff[6]=mklink("/cgi-bin/koha/request.pl?bib=$stuff[2]","Request"); $stuff[6]=mklink("/cgi-bin/koha/request.pl?bib=$stuff[2]","Request");
} }

Loading…
Cancel
Save