fixed variable masking warnings found by perl -w

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
Galen Charlton 2008-01-03 18:43:38 -06:00 committed by Joshua Ferraro
parent 0c087b87ef
commit 8c60e82605
12 changed files with 55 additions and 87 deletions

View File

@ -400,8 +400,8 @@ sub SetActiveTemplate {
my $sth = $dbh->prepare($query);
$sth->execute();
my $query = "UPDATE labels_templates SET active = 1 WHERE tmpl_id = ?";
my $sth = $dbh->prepare($query);
$query = "UPDATE labels_templates SET active = 1 WHERE tmpl_id = ?";
$sth = $dbh->prepare($query);
$sth->execute($tmpl_id);
$sth->finish;
}
@ -414,8 +414,8 @@ sub set_active_layout {
my $sth = $dbh->prepare($query);
$sth->execute();
my $query = "UPDATE labels_conf SET active = 1 WHERE id = ?";
my $sth = $dbh->prepare($query);
$query = "UPDATE labels_conf SET active = 1 WHERE id = ?";
$sth = $dbh->prepare($query);
$sth->execute($layout_id);
$sth->finish;
}
@ -511,12 +511,12 @@ sub add_layout {
my $query2 = "update labels_conf set active = NULL";
my $sth2 = $dbh->prepare($query2);
$sth2->execute();
my $query2 = "INSERT INTO labels_conf
$query2 = "INSERT INTO labels_conf
( barcodetype, title, subtitle, isbn,issn, itemtype, barcode,
dewey, class, subclass, itemcallnumber, author, printingtype,
guidebox, startlabel, layoutname, active )
values ( ?, ?, ?, ?, ?, ?, ?, ?,?, ?, ?, ?, ?, ?,?,?, 1 )";
my $sth2 = $dbh->prepare($query2);
$sth2 = $dbh->prepare($query2);
$sth2->execute(
$barcodetype, $title, $subtitle, $isbn, $issn,
@ -1196,7 +1196,7 @@ sub draw_boundaries {
) = @_;
my $y_pos_initial = ( ( 792 - 36 ) - 90 );
my $y_pos = $y_pos_initial;
$y_pos = $y_pos_initial; # FIXME - why are we ignoring the y_pos parameter by redefining it?
my $i = 1;
for ( $i = 1 ; $i <= 8 ; $i++ ) {

View File

@ -83,8 +83,8 @@ my $htdocs = C4::Context->config('intrahtdocs');
my $section='intranet';
my ($theme, $lang) = themelanguage($htdocs, $columns_def_file, $section);
my $columns_def_file="$htdocs/$theme/$lang/$columns_def_file";
open (COLUMNS,$columns_def_file);
my $full_path_to_columns_def_file="$htdocs/$theme/$lang/$columns_def_file";
open (COLUMNS,$full_path_to_columns_def_file);
while (my $input = <COLUMNS>){
my @row =split(/\t/,$input);
$columns{$row[0]}=$row[1];

View File

@ -1432,12 +1432,12 @@ sub ReNewSubscription {
);
# renew subscription
my $query = qq|
$query = qq|
UPDATE subscription
SET startdate=?,numberlength=?,weeklength=?,monthlength=?
WHERE subscriptionid=?
|;
my $sth = $dbh->prepare($query);
$sth = $dbh->prepare($query);
$sth->execute( format_date_in_iso($startdate),
$numberlength, $weeklength, $monthlength, $subscriptionid );

View File

@ -141,7 +141,6 @@ foreach my $item (@items) {
$template->param( norequests => $norequests );
## get notes and subjects from MARC record
my $dbh = C4::Context->dbh;
my $marcflavour = C4::Context->preference("marcflavour");
my $record = GetMarcBiblio($biblionumber);
my $marcnotesarray = GetMarcNotes( $record, $marcflavour );

View File

@ -71,7 +71,6 @@ sub plugin_javascript {
$hour = "0".$sec;
}
my $dbh = C4::Context->dbh;
my $date = "$year";
my ($tag,$subfield) = GetMarcFromKohaField("items.barcode");

View File

@ -131,9 +131,6 @@ plugin : the true value_builded. The screen that is open in the popup window.
sub plugin {
my ($input) = @_;
my $index = $input->param("index");
my $result = $input->param("result");
my $query=new CGI;
my $op = $query->param('op');
my $authtypecode = $query->param('authtypecode');

View File

@ -46,7 +46,7 @@ my $i=0;
my $starttime = time();
$|=1; # flushes output
my $starttime = gettimeofday;
$starttime = gettimeofday;
#1st of all, find item MARC tag.
my ($tagfield,$tagsubfield) = &GetMarcFromKohaField("items.itemnumber",'');

View File

@ -82,7 +82,7 @@ $b1->add_run($run1);
$b->add_run($run1);
# send HTTP request sequences to server and time responses
my $ro = $b1->execute;
$ro = $b1->execute;
# calculate hits/sec
print ("\t".$b1->total_time."ms\t".(1000*$b1->total_requests/$b1->total_time)." biblios/sec\n");
print "ALERT : ".$b1->total_responses_failed." failures\n" if $b1->total_responses_failed;
@ -107,7 +107,7 @@ $b2->add_run($run2);
$b->add_run($run2);
# send HTTP request sequences to server and time responses
my $ro = $b2->execute;
$ro = $b2->execute;
# calculate hits/sec
print ("\t".$b2->total_time."ms\t".(1000*$b2->total_requests/$b2->total_time)." borrowers/sec\n");
@ -123,7 +123,7 @@ $b4->concurrency( $concurrency );
my @issues;
my @returns;
print "Issues detail ";
my $sth = $dbh->prepare("SELECT barcode FROM items WHERE itemnumber=?");
$sth = $dbh->prepare("SELECT barcode FROM items WHERE itemnumber=?");
my $sth2 = $dbh->prepare("SELECT borrowernumber FROM borrowers WHERE borrowernumber=?");
for (my $i=1;$i<=$max_tries;$i++) {
my $rand_borrowernumber;
@ -151,7 +151,7 @@ $b3->add_run($run3);
$b->add_run($run3);
# send HTTP request sequences to server and time responses
my $ro = $b3->execute;
$ro = $b3->execute;
# calculate hits/sec
print ("\t".$b3->total_time."ms\t".(1000*$b3->total_requests/$b3->total_time)." issues/sec\n");
@ -163,10 +163,10 @@ $b4->add_run($run4);
$b->add_run($run4);
# send HTTP request sequences to server and time responses
my $ro = $b4->execute;
$ro = $b4->execute;
# calculate hits/sec
print ("\t".$b4->total_time."ms\t".(1000*$b4->total_requests/$b4->total_time)." returns/sec\n");
print "Benchmarking everything";
my $ro = $b->execute;
$ro = $b->execute;
print ("\t".$b->total_time."ms\t".(1000*$b->total_requests/$b->total_time)." operations/sec\n");

View File

@ -164,7 +164,7 @@ while (my ($biblionumber) = $sth->fetchrow) {
}
print "\nInserting records...\n";
$i=0;
my $sth = $dbh->prepare("INSERT INTO nozebra (server,indexname,value,biblionumbers) VALUES ('biblioserver',?,?,?)");
$sth = $dbh->prepare("INSERT INTO nozebra (server,indexname,value,biblionumbers) VALUES ('biblioserver',?,?,?)");
foreach my $key (keys %result) {
foreach my $index (keys %{$result{$key}}) {
if (length($result{$key}->{$index}) > 1000000) {
@ -181,11 +181,10 @@ print "\n***********************************\n";
print "***** building AUTHORITIES indexes *****\n";
print "***********************************\n";
my $sth;
$sth=$dbh->prepare("select authid from auth_header order by authid $limit");
$sth->execute();
my $i=0;
my %result;
$i=0;
%result = ();
while (my ($authid) = $sth->fetchrow) {
$i++;
print "\r$i";
@ -266,7 +265,7 @@ while (my ($authid) = $sth->fetchrow) {
}
print "\nInserting...\n";
$i=0;
my $sth = $dbh->prepare("INSERT INTO nozebra (server,indexname,value,biblionumbers) VALUES ('authorityserver',?,?,?)");
$sth = $dbh->prepare("INSERT INTO nozebra (server,indexname,value,biblionumbers) VALUES ('authorityserver',?,?,?)");
foreach my $key (keys %result) {
foreach my $index (keys %{$result{$key}}) {
if (length($result{$key}->{$index}) > 1000000) {

View File

@ -46,7 +46,8 @@ my $cnt = 0;
#warn "issuerid: " . $issuerid;
my ($issuer, $flags) = GetMemberDetails($issuerid);
my $item = GetItem(undef,$barcode);
my ($borrower, $flags) = GetMemberDetails(undef,$userid);
my $borrower;
($borrower, $flags) = GetMemberDetails(undef,$userid);
my $branch = $issuer->{branchcode};
my $confirm_required = 0;

View File

@ -28,7 +28,6 @@ use C4::Output;
use C4::Reserves;
use C4::Auth;
my $query = new CGI;
my $query = new CGI;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{

View File

@ -116,45 +116,36 @@ if ( $op eq 'add_form' ) {
# build field list
my @SQLfieldname;
my %line = ( 'value' => "LibrarianFirstname", 'text' => 'LibrarianFirstname' );
push @SQLfieldname, \%line;
my %line = ( 'value' => "LibrarianSurname", 'text' => 'LibrarianSurname' );
push @SQLfieldname, \%line;
my %line = ( 'value' => "LibrarianEmailaddress", 'text' => 'LibrarianEmailaddress' );
push @SQLfieldname, \%line;
push @SQLfieldname, { 'value' => "LibrarianFirstname", 'text' => 'LibrarianFirstname' };
push @SQLfieldname, { 'value' => "LibrarianSurname", 'text' => 'LibrarianSurname' };
push @SQLfieldname, { 'value' => "LibrarianEmailaddress", 'text' => 'LibrarianEmailaddress' };
my $sth2 = $dbh->prepare("SHOW COLUMNS from branches");
$sth2->execute;
my %line = ( 'value' => "", 'text' => '---BRANCHES---' );
push @SQLfieldname, \%line;
push @SQLfieldname, { 'value' => "", 'text' => '---BRANCHES---' };
while ( ( my $field ) = $sth2->fetchrow_array ) {
my %line = ( 'value' => "branches." . $field, 'text' => "branches." . $field );
push @SQLfieldname, \%line;
push @SQLfieldname, { 'value' => "branches." . $field, 'text' => "branches." . $field };
}
# add acquisition specific tables
if ( index( $module, "acquisition" ) > 0 ) {
$sth2 = $dbh->prepare("SHOW COLUMNS from aqbooksellers");
$sth2->execute;
my %line = ( 'value' => "", 'text' => '---BOOKSELLERS---' );
push @SQLfieldname, \%line;
push @SQLfieldname, { 'value' => "", 'text' => '---BOOKSELLERS---' };
while ( ( my $field ) = $sth2->fetchrow_array ) {
my %line = (
push @SQLfieldname, {
'value' => "aqbooksellers." . $field,
'text' => "aqbooksellers." . $field
);
push @SQLfieldname, \%line;
};
}
$sth2 = $dbh->prepare("SHOW COLUMNS from aqorders");
$sth2->execute;
my %line = ( 'value' => "", 'text' => '---ORDERS---' );
push @SQLfieldname, \%line;
push @SQLfieldname, { 'value' => "", 'text' => '---ORDERS---' };
while ( ( my $field ) = $sth2->fetchrow_array ) {
my %line = (
push @SQLfieldname, {
'value' => "aqorders." . $field,
'text' => "aqorders." . $field
);
push @SQLfieldname, \%line;
};
}
# add issues specific tables
@ -162,79 +153,62 @@ if ( $op eq 'add_form' ) {
elsif ( index( $module, "issues" ) > 0 ) {
$sth2 = $dbh->prepare("SHOW COLUMNS from aqbooksellers");
$sth2->execute;
my %line = ( 'value' => "", 'text' => '---BOOKSELLERS---' );
push @SQLfieldname, \%line;
push @SQLfieldname, { 'value' => "", 'text' => '---BOOKSELLERS---' };
while ( ( my $field ) = $sth2->fetchrow_array ) {
my %line = (
push @SQLfieldname, {
'value' => "aqbooksellers." . $field,
'text' => "aqbooksellers." . $field
);
push @SQLfieldname, \%line;
};
}
$sth2 = $dbh->prepare("SHOW COLUMNS from serial");
$sth2->execute;
my %line = ( 'value' => "", 'text' => '---SERIALS---' );
push @SQLfieldname, \%line;
push @SQLfieldname, { 'value' => "", 'text' => '---SERIALS---' };
while ( ( my $field ) = $sth2->fetchrow_array ) {
my %line = ( 'value' => "serial." . $field, 'text' => "serial." . $field );
push @SQLfieldname, \%line;
push @SQLfieldname, { 'value' => "serial." . $field, 'text' => "serial." . $field };
}
$sth2 = $dbh->prepare("SHOW COLUMNS from subscription");
$sth2->execute;
my %line = ( 'value' => "", 'text' => '---SUBSCRIPTION---' );
push @SQLfieldname, \%line;
push @SQLfieldname, { 'value' => "", 'text' => '---SUBSCRIPTION---' };
while ( ( my $field ) = $sth2->fetchrow_array ) {
my %line = (
push @SQLfieldname, {
'value' => "subscription." . $field,
'text' => "subscription." . $field
);
push @SQLfieldname, \%line;
};
}
my %line = ('value' => "", 'text' => '---Biblio---' );
push @SQLfieldname, \%line;
push @SQLfieldname, { 'value' => "", 'text' => '---Biblio---' };
foreach(qw(title author serial)) {
my %line = ('value' => "biblio.$_", 'text' => ucfirst($_));
push @SQLfieldname, \%line;
push @SQLfieldname, { 'value' => "biblio.$_", 'text' => ucfirst($_) };
}
}
else {
$sth2 = $dbh->prepare("SHOW COLUMNS from biblio");
$sth2->execute;
my %line = ( 'value' => "", 'text' => '---BIBLIO---' );
push @SQLfieldname, { 'value' => "", 'text' => '---BIBLIO---' };
push @SQLfieldname, \%line;
while ( ( my $field ) = $sth2->fetchrow_array ) {
# note : %line is redefined, otherwise \%line contains the same value for every entry of the list
my %line = ( 'value' => "biblio." . $field, 'text' => "biblio." . $field );
push @SQLfieldname, \%line;
push @SQLfieldname, { 'value' => "biblio." . $field, 'text' => "biblio." . $field };
}
$sth2 = $dbh->prepare("SHOW COLUMNS from biblioitems");
$sth2->execute;
my %line = ( 'value' => "", 'text' => '---BIBLIOITEMS---' );
push @SQLfieldname, \%line;
push @SQLfieldname, { 'value' => "", 'text' => '---BIBLIOITEMS---' };
while ( ( my $field ) = $sth2->fetchrow_array ) {
my %line = (
push @SQLfieldname, {
'value' => "biblioitems." . $field,
'text' => "biblioitems." . $field
);
push @SQLfieldname, \%line;
};
}
my %line = ( 'value' => "", 'text' => '---ITEMS---' );
push @SQLfieldname, \%line;
my %line = ( 'value' => "items.content", 'text' => 'items.content' );
push @SQLfieldname, \%line;
push @SQLfieldname, { 'value' => "", 'text' => '---ITEMS---' };
push @SQLfieldname, { 'value' => "items.content", 'text' => 'items.content' };
$sth2 = $dbh->prepare("SHOW COLUMNS from borrowers");
$sth2->execute;
my %line = ( 'value' => "", 'text' => '---BORROWERS---' );
push @SQLfieldname, \%line;
push @SQLfieldname, { 'value' => "", 'text' => '---BORROWERS---' };
while ( ( my $field ) = $sth2->fetchrow_array ) {
my %line = (
push @SQLfieldname, {
'value' => "borrowers." . $field,
'text' => "borrowers." . $field
);
push @SQLfieldname, \%line;
};
}
}
if ($code) {