From eff606ba56974255deb5a6f97605005d2c2ff9c6 Mon Sep 17 00:00:00 2001 From: arensb Date: Sun, 13 Oct 2002 11:32:14 +0000 Subject: [PATCH] Replaced expressions of the form "$x = $x $y" with "$x = $y". Thus, $x = $x+2 becomes $x += 2, and so forth. --- C4/Accounts.pm | 6 +-- C4/Accounts2.pm | 12 ++--- C4/Acquisitions.pm | 8 ++-- C4/Biblio.pm | 10 ++-- C4/Circulation/Circ2.pm | 6 +-- C4/Circulation/Issues.pm | 9 ++-- C4/Circulation/Renewals.pm | 12 ++--- C4/Circulation/Renewals2.pm | 3 +- C4/Format.pm | 6 +-- C4/Input.pm | 9 +--- C4/Maintainance.pm | 2 +- C4/Output.pm | 83 +++++++++++++++------------------- C4/Search.pm | 44 ++++++++---------- C4/Stats.pm | 4 +- acqui.simple/processz3950queue | 2 +- acqui/finishreceive.pl | 2 +- acqui/newbasket2.pl | 28 ++++++------ deletemem.pl | 2 +- memberentry.pl | 3 +- search.pl | 14 +++--- thesaurus_popup.pl | 2 +- 21 files changed, 119 insertions(+), 148 deletions(-) diff --git a/C4/Accounts.pm b/C4/Accounts.pm index ac7dcc5fae..ec4265aa27 100755 --- a/C4/Accounts.pm +++ b/C4/Accounts.pm @@ -132,8 +132,7 @@ sub reconcileaccount { $line= $data->{'accountno'}." ".$data->{'date'}." ".$data->{'accounttype'}." "; my $title = $itemdata->{'title'}; if (length($title) > 15 ) {$title = substr($title,0,15);} - $line= $line.$itemdata->{'barcode'}." $title ".$data->{'description'}; - # FIXME - .= + $line .= $itemdata->{'barcode'}." $title ".$data->{'description'}; $line = fmtstr($env,$line,"L65")." ".fmtdec($env,$amount,"52"); push @accountlines,$line; $i++; @@ -173,8 +172,7 @@ sub recordpayment{ while (($accdata=$sth->fetchrow_hashref) and ($amountleft>0)){ if ($accdata->{'amountoutstanding'} < $amountleft) { $newamtos = 0; - $amountleft = $amountleft - $accdata->{'amountoutstanding'}; - # FIXME - -= + $amountleft -= $accdata->{'amountoutstanding'}; } else { $newamtos = $accdata->{'amountoutstanding'} - $amountleft; $amountleft = 0; diff --git a/C4/Accounts2.pm b/C4/Accounts2.pm index 56564f4f9a..40e81ae7a8 100755 --- a/C4/Accounts2.pm +++ b/C4/Accounts2.pm @@ -98,8 +98,7 @@ sub recordpayment{ while (($accdata=$sth->fetchrow_hashref) and ($amountleft>0)){ if ($accdata->{'amountoutstanding'} < $amountleft) { $newamtos = 0; - $amountleft = $amountleft - $accdata->{'amountoutstanding'}; - # FIXME - -= + $amountleft -= $accdata->{'amountoutstanding'}; } else { $newamtos = $accdata->{'amountoutstanding'} - $amountleft; $amountleft = 0; @@ -375,8 +374,7 @@ sub fixcredit{ $sth->finish; if ($accdata->{'amountoutstanding'} < $amountleft) { $newamtos = 0; - $amountleft = $amountleft - $accdata->{'amountoutstanding'}; - # FIXME - -= + $amountleft -= $accdata->{'amountoutstanding'}; } else { $newamtos = $accdata->{'amountoutstanding'} - $amountleft; $amountleft = 0; @@ -407,8 +405,7 @@ sub fixcredit{ while (($accdata=$sth->fetchrow_hashref) and ($amountleft>0)){ if ($accdata->{'amountoutstanding'} < $amountleft) { $newamtos = 0; - $amountleft = $amountleft - $accdata->{'amountoutstanding'}; - # FIXME - -= + $amountleft -= $accdata->{'amountoutstanding'}; } else { $newamtos = $accdata->{'amountoutstanding'} - $amountleft; $amountleft = 0; @@ -460,8 +457,7 @@ sub refund{ while (($accdata=$sth->fetchrow_hashref) and ($amountleft<0)){ if ($accdata->{'amountoutstanding'} > $amountleft) { $newamtos = 0; - $amountleft = $amountleft - $accdata->{'amountoutstanding'}; - # FIXME - -= + $amountleft -= $accdata->{'amountoutstanding'}; } else { $newamtos = $accdata->{'amountoutstanding'} - $amountleft; $amountleft = 0; diff --git a/C4/Acquisitions.pm b/C4/Acquisitions.pm index 92bae36460..529297a635 100644 --- a/C4/Acquisitions.pm +++ b/C4/Acquisitions.pm @@ -822,7 +822,7 @@ or catalogueentry like '% $subject[$i]')"; $sth2->execute; while (my $data = $sth2->fetchrow_hashref) { - $error = $error."
$data->{'catalogueentry'}"; # FIXME - .= + $error .= "
$data->{'catalogueentry'}"; } # while $sth2->finish; } # else @@ -1266,7 +1266,7 @@ sub curconvert { if ($cur==0){ $cur=1; } - $price=$price / $cur; # FIXME - /= + $price /= $cur; return($price); } @@ -1578,7 +1578,7 @@ sub delitem{ $sth->finish; $query="Insert into deleteditems values ("; foreach my $temp (@data){ - $query=$query."'$temp',"; # FIXME - .= + $query .= "'$temp',"; } $query=~ s/\,$/\)/; # print $query; @@ -1665,7 +1665,7 @@ sub delbiblio{ $query="Insert into deletedbiblio values ("; foreach my $temp (@data){ $temp=~ s/\'/\\\'/g; - $query=$query."'$temp',"; # FIXME - .= + $query .= "'$temp',"; } $query=~ s/\,$/\)/; # print $query; diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 72ff0abfc8..16bb804364 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -1,6 +1,10 @@ package C4::Biblio; # $Id$ # $Log$ +# Revision 1.21 2002/10/13 11:34:14 arensb +# Replaced expressions of the form "$x = $x $y" with "$x = $y". +# Thus, $x = $x+2 becomes $x += 2, and so forth. +# # Revision 1.20 2002/10/13 08:28:32 arensb # Deleted unused variables. # Removed trailing whitespace. @@ -1202,7 +1206,7 @@ sub OLDmodsubject { $sth2->execute; while (my $data = $sth2->fetchrow_hashref) { - $error = $error."
$data->{'catalogueentry'}"; # FIXME - .= + $error .= "
$data->{'catalogueentry'}"; } # while $sth2->finish; } # else @@ -1466,7 +1470,7 @@ sub OLDdelitem{ $sth->finish; $query="Insert into deleteditems values ("; foreach my $temp (@data){ - $query=$query."'$temp',"; # FIXME - .= + $query .= "'$temp',"; } $query=~ s/\,$/\)/; # print $query; @@ -1535,7 +1539,7 @@ sub OLDdelbiblio{ $query="Insert into deletedbiblio values ("; foreach my $temp (@data){ $temp=~ s/\'/\\\'/g; - $query=$query."'$temp',"; # FIXME - .= + $query .= "'$temp',"; } $query=~ s/\,$/\)/; # print $query; diff --git a/C4/Circulation/Circ2.pm b/C4/Circulation/Circ2.pm index 3e1ae50d18..fa4bd3c4ad 100755 --- a/C4/Circulation/Circ2.pm +++ b/C4/Circulation/Circ2.pm @@ -1107,8 +1107,7 @@ sub fixaccountforlostandreturned { while (($accdata=$msth->fetchrow_hashref) and ($amountleft>0)){ if ($accdata->{'amountoutstanding'} < $amountleft) { $newamtos = 0; - # FIXME - -= - $amountleft = $amountleft - $accdata->{'amountoutstanding'}; + $amountleft -= $accdata->{'amountoutstanding'}; } else { $newamtos = $accdata->{'amountoutstanding'} - $amountleft; $amountleft = 0; @@ -1569,8 +1568,7 @@ sub checkaccount { $sth->execute; my $total=0; while (my $data=$sth->fetchrow_hashref){ - # FIXME = += - $total=$total+$data->{'sum(amountoutstanding)'}; + $total += $data->{'sum(amountoutstanding)'}; } $sth->finish; # output(1,2,"borrower owes $total"); diff --git a/C4/Circulation/Issues.pm b/C4/Circulation/Issues.pm index 0cf7bcb1ae..c78919f91c 100755 --- a/C4/Circulation/Issues.pm +++ b/C4/Circulation/Issues.pm @@ -199,13 +199,13 @@ sub formatitem { my $dewey = $item->{'dewey'}; $dewey =~ s/0*$//; $dewey =~ s/\.$//; - $iclass = $iclass.$dewey.$item->{'subclass'}; # FIXME - .= + $iclass .= $dewey.$item->{'subclass'}; }; my $llen = 65 - length($iclass); my $line = fmtstr($env,$line,"L".$llen); # FIXME - Use sprintf() instead of &fmtstr. - my $line = $line." $iclass "; # FIXME - .= - my $line = $line.fmtdec($env,$charge,"22"); # FIXME - .= + my $line .= " $iclass "; + my $line .= fmtdec($env,$charge,"22"); return $line; } @@ -284,8 +284,7 @@ sub issueitem{ $btsh->execute; my $resborrower = $btsh->fetchrow_hashref; my $msgtxt = chr(7)."Res for $resborrower->{'cardnumber'},"; - $msgtxt = $msgtxt." $resborrower->{'initials'} $resborrower->{'surname'}"; - # FIXME - .= + $msgtxt .= " $resborrower->{'initials'} $resborrower->{'surname'}"; my $ans = msg_ny($env,$msgtxt,"Allow issue?"); if ($ans eq "N") { # print a docket; diff --git a/C4/Circulation/Renewals.pm b/C4/Circulation/Renewals.pm index 65a1e16da7..809718d5f2 100755 --- a/C4/Circulation/Renewals.pm +++ b/C4/Circulation/Renewals.pm @@ -202,19 +202,17 @@ sub bulkrenew { my ($resbor,$resrec) = C4::Circulation::Main::checkreserve($env, $dbh,$issrec->{'itemnumber'}); if ($resbor ne "") { - $line = $line."R"; # FIXME - .= + $line .= "R"; $rstatuses[$x] ="R"; } elsif ($renewstatus == 0) { - $line = $line."N"; # FIXME - .= + $line .= "N"; $rstatuses[$x] = "N"; } else { - $line = $line."Y"; # FIXME - .= + $line .= "Y"; $rstatuses[$x] = "Y"; } - $line = $line.fmtdec($env,$issrec->{'renewals'},"20")." "; - # FIXME - .= - $line = $line.$itemdata->{'barcode'}." ".$itemdata->{'itemtype'}." ".$itemdata->{'title'}; - # FIXME - .= + $line .= fmtdec($env,$issrec->{'renewals'},"20")." "; + $line .= $itemdata->{'barcode'}." ".$itemdata->{'itemtype'}." ".$itemdata->{'title'}; $items[$x] = $line; #debug_msg($env,$line); $issues[$x] = $issrec; diff --git a/C4/Circulation/Renewals2.pm b/C4/Circulation/Renewals2.pm index 5b41587be0..be3393c445 100755 --- a/C4/Circulation/Renewals2.pm +++ b/C4/Circulation/Renewals2.pm @@ -287,8 +287,7 @@ sub calc_charges { $sth2->execute; if (my$data2=$sth2->fetchrow_hashref) { my $discount = $data2->{'rentaldiscount'}; - # FIXME - *= - $charge = ($charge *(100 - $discount)) / 100; + $charge *= (100 - $discount) / 100; } $sth2->finish; } diff --git a/C4/Format.pm b/C4/Format.pm index f7d6ed90a9..0bf917bbe5 100755 --- a/C4/Format.pm +++ b/C4/Format.pm @@ -213,11 +213,11 @@ sub fmtdec { } # Right-pad the decimal part to the given number of digits. if ($right > 0) { - $tempdec = $tempdec.("0"x$right); # FIXME - .= + $tempdec .= "0"x$right; $tempdec = substr($tempdec,0,$right); - $fnumb = $fnumb.".".$tempdec; # FIXME - .= + $fnumb .= ".".$tempdec; } - return ($fnumb); # FIXME - Shouldn't return a list. + return $fnumb; # FIXME - Shouldn't return a list. } 1; diff --git a/C4/Input.pm b/C4/Input.pm index 87abce138c..d50cc2a0b0 100644 --- a/C4/Input.pm +++ b/C4/Input.pm @@ -136,15 +136,10 @@ sub checkvalidisbn { my $digit=substr($q,$i,1); $c+=$digit*(10-$i); } - $c=$c%11; # % is the modulus function - # FIXME - %= + $c %= 11; ($c==10) && ($c='X'); # FIXME - $isbngood = $c eq $checksum; - if ($c eq $checksum) { - $isbngood=1; - } else { - $isbngood=0; - } + $isbngood = $c eq $checksum; } else { # FIXME - Put "return 0 if $length($q) != 10" near the # top, so we don't have to indent the rest of the function diff --git a/C4/Maintainance.pm b/C4/Maintainance.pm index af9cca5e21..965db67262 100644 --- a/C4/Maintainance.pm +++ b/C4/Maintainance.pm @@ -196,7 +196,7 @@ sub undeletebib{ $query="Insert into biblio values ("; foreach my $temp (@data){ $temp=~ s/\'/\\\'/g; - $query=$query."'$temp',"; # FIXME - .= + $query .= "'$temp',"; } $query=~ s/\,$/\)/; # print $query; diff --git a/C4/Output.pm b/C4/Output.pm index 787c3a3c01..facf0fb34f 100644 --- a/C4/Output.pm +++ b/C4/Output.pm @@ -459,7 +459,7 @@ sub mktablerow { } $i++; } - $string=$string."\n"; # FIXME - .= + $string .= "\n"; return($string); } @@ -481,7 +481,7 @@ sub mktableft() { sub mkform{ my ($action,%inputs)=@_; my $string="
\n"; - $string=$string.mktablehdr(); # FIXME - .= + $string .= mktablehdr(); my $key; my @keys=sort keys %inputs; @@ -492,8 +492,7 @@ sub mkform{ my @data=split('\t',$value); #my $posn = shift(@data); if ($data[0] eq 'hidden'){ - $string=$string."\n"; - # FIXME - .= + $string .= "\n"; } else { my $text; if ($data[0] eq 'radio') { @@ -511,22 +510,20 @@ sub mkform{ my $i=1; while ($data[$i] ne "") { my $val = $data[$i+1]; - $text = $text."
"; # FIXME - .= + $string .= mktablerow(2,'white','',''); + $string .= mktableft; + $string .= ""; } =item mkform3 @@ -633,10 +630,10 @@ sub mkform3 { my $i=1; while ($data[$i] ne "") { my $val = $data[$i+1]; - $text = $text."