From 04fce104fb69421a95b8166750f84c184ff9d932 Mon Sep 17 00:00:00 2001 From: einhverfr Date: Tue, 24 Oct 2006 03:45:40 +0000 Subject: Fixing breadead mistakes when moving variables to new namespace git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@284 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB/AA.pm | 8 ++++---- LedgerSMB/AM.pm | 5 ++--- LedgerSMB/BP.pm | 8 ++++---- LedgerSMB/CP.pm | 6 +++--- LedgerSMB/Form.pm | 6 +++--- LedgerSMB/IR.pm | 8 ++++---- LedgerSMB/IS.pm | 10 +++++----- LedgerSMB/JC.pm | 8 ++++---- LedgerSMB/OE.pm | 10 +++++----- 9 files changed, 34 insertions(+), 35 deletions(-) (limited to 'LedgerSMB') diff --git a/LedgerSMB/AA.pm b/LedgerSMB/AA.pm index 2ac0d1a8..3dfda666 100755 --- a/LedgerSMB/AA.pm +++ b/LedgerSMB/AA.pm @@ -595,11 +595,11 @@ sub delete_transaction { my $sth = $dbh->prepare($query); $sth->execute($form->{id}) || $form->dberror($query); - my ${LedgerSMB::Sysconfig::spool}file; + my $spoolfile; my @spoolfiles = (); - while ((${LedgerSMB::Sysconfig::spool}file) = $sth->fetchrow_array) { - push @spoolfiles, ${LedgerSMB::Sysconfig::spool}file; + while (($spoolfile) = $sth->fetchrow_array) { + push @spoolfiles, $spoolfile; } $sth->finish; @@ -611,7 +611,7 @@ sub delete_transaction { my $rc = $dbh->commit; if ($rc) { - foreach ${LedgerSMB::Sysconfig::spool}file (@spoolfiles) { + foreach $spoolfile (@spoolfiles) { unlink "${LedgerSMB::Sysconfig::spool}/$spoolfile" if $spoolfile; } } diff --git a/LedgerSMB/AM.pm b/LedgerSMB/AM.pm index 4da9e6c9..0e3abeaa 100755 --- a/LedgerSMB/AM.pm +++ b/LedgerSMB/AM.pm @@ -1239,7 +1239,6 @@ sub check_template_name { if ($form->{file} =~ /^(.:)*?\/|\.\.\/|^\//){ $form->error("Directory transversal not allowed."); } - my ${LedgerSMB::Sysconfig::userspath} = ${main::userspath}; if ($form->{file} =~ /^${LedgerSMB::Sysconfig::userspath}\//){ $form->error("Not allowed to access ${LedgerSMB::Sysconfig::userspath}/ with this method"); } @@ -1293,7 +1292,7 @@ sub save_template { sub save_preferences { - my ($self, $myconfig, $form, ${LedgerSMB::Sysconfig::memberfile}, ${LedgerSMB::Sysconfig::userspath}) = @_; + my ($self, $myconfig, $form) = @_; # connect to database my $dbh = $form->{dbh}; @@ -1566,7 +1565,7 @@ sub save_taxes { sub backup { - my ($self, $myconfig, $form, ${LedgerSMB::Sysconfig::userspath}, ${LedgerSMB::Sysconfig::gzip}) = @_; + my ($self, $myconfig, $form) = @_; my $mail; my $err; diff --git a/LedgerSMB/BP.pm b/LedgerSMB/BP.pm index c5f46fa8..c69a3a92 100755 --- a/LedgerSMB/BP.pm +++ b/LedgerSMB/BP.pm @@ -244,7 +244,7 @@ sub get_spoolfiles { sub delete_spool { - my ($self, $myconfig, $form, ${LedgerSMB::Sysconfig::spool}) = @_; + my ($self, $myconfig, $form) = @_; # connect to database, turn AutoCommit off my $dbh = $form->dbconnect_noauto($myconfig); @@ -293,7 +293,7 @@ sub delete_spool { sub print_spool { - my ($self, $myconfig, $form, ${LedgerSMB::Sysconfig::spool}) = @_; + my ($self, $myconfig, $form) = @_; # connect to database my $dbh = $form->dbconnect_noauto($myconfig); @@ -312,10 +312,10 @@ sub print_spool { open(OUT, $form->{OUT}) or $form->error("$form->{OUT} : $!"); binmode(OUT); - ${LedgerSMB::Sysconfig::spool}file = qq|$spool/$form->{"spoolfile_$i"}|; + $spoolfile = qq|$spool/$form->{"spoolfile_$i"}|; # send file to printer - open(IN, ${LedgerSMB::Sysconfig::spool}file) or $form->error("$spoolfile : $!"); + open(IN, $spoolfile) or $form->error("$spoolfile : $!"); binmode(IN); while () { diff --git a/LedgerSMB/CP.pm b/LedgerSMB/CP.pm index 68499753..695708a5 100755 --- a/LedgerSMB/CP.pm +++ b/LedgerSMB/CP.pm @@ -268,7 +268,7 @@ sub get_openinvoices { my $vth = $dbh->prepare($query); - my ${LedgerSMB::Sysconfig::spool}file; + my $spoolfile; while ($ref = $sth->fetchrow_hashref(NAME_lc)) { @@ -278,8 +278,8 @@ sub get_openinvoices { $vth->execute($ref->{id}); $ref->{queue} = ""; - while ((${LedgerSMB::Sysconfig::spool}file) = $vth->fetchrow_array) { - $ref->{queued} .= "$form->{formname} ${LedgerSMB::Sysconfig::spool}file "; + while (($spoolfile) = $vth->fetchrow_array) { + $ref->{queued} .= "$form->{formname} $spoolfile "; } $vth->finish; diff --git a/LedgerSMB/Form.pm b/LedgerSMB/Form.pm index 3510fa4c..c15cdcbc 100755 --- a/LedgerSMB/Form.pm +++ b/LedgerSMB/Form.pm @@ -572,7 +572,7 @@ sub get_my_emp_num { sub parse_template { - my ($self, $myconfig, ${LedgerSMB::Sysconfig::userspath}) = @_; + my ($self, $myconfig) = @_; my ($chars_per_line, $lines_on_first_page, $lines_on_second_page) = (0, 0, 0); my ($current_page, $current_line) = (1, 1); @@ -2409,7 +2409,7 @@ sub update_status { my $dbh = $self->{dbh}; my %queued = split / +/, $self->{queued}; - my ${LedgerSMB::Sysconfig::spool}file = ($queued{$self->{formname}}) ? "'$queued{$self->{formname}}'" : 'NULL'; + my $spoolfile = ($queued{$self->{formname}}) ? "'$queued{$self->{formname}}'" : 'NULL'; my $query = qq|DELETE FROM status WHERE formname = ? @@ -2429,7 +2429,7 @@ sub update_status { VALUES (?, ?, ?, ?, ?)|; $sth = $dbh->prepare($query); - $sth->execute($self->{id}, $printed, $emailed, ${LedgerSMB::Sysconfig::spool}file, + $sth->execute($self->{id}, $printed, $emailed, $spoolfile, $self->{formname}); $sth->finish; diff --git a/LedgerSMB/IR.pm b/LedgerSMB/IR.pm index 165b4eb7..5ccb0b15 100755 --- a/LedgerSMB/IR.pm +++ b/LedgerSMB/IR.pm @@ -705,11 +705,11 @@ sub delete_invoice { my $sth = $dbh->prepare($query); $sth->execute || $form->dberror($query); - my ${LedgerSMB::Sysconfig::spool}file; + my $spoolfile; my @spoolfiles = (); - while ((${LedgerSMB::Sysconfig::spool}file) = $sth->fetchrow_array) { - push @spoolfiles, ${LedgerSMB::Sysconfig::spool}file; + while (($spoolfile) = $sth->fetchrow_array) { + push @spoolfiles, $spoolfile; } $sth->finish; @@ -730,7 +730,7 @@ sub delete_invoice { $dbh->commit; } - foreach ${LedgerSMB::Sysconfig::spool}file (@spoolfiles) { + foreach $spoolfile (@spoolfiles) { unlink "${LedgerSMB::Sysconfig::spool}/$spoolfile" if $spoolfile; } } diff --git a/LedgerSMB/IS.pm b/LedgerSMB/IS.pm index 090ee10d..ff4b7855 100755 --- a/LedgerSMB/IS.pm +++ b/LedgerSMB/IS.pm @@ -1226,7 +1226,7 @@ sub reverse_invoice { sub delete_invoice { - my ($self, $myconfig, $form, ${LedgerSMB::Sysconfig::spool}) = @_; + my ($self, $myconfig, $form) = @_; # connect to database my $dbh = $form->dbconnect_noauto($myconfig); @@ -1253,11 +1253,11 @@ sub delete_invoice { my $sth = $dbh->prepare($query); $sth->execute || $form->dberror($query); - my ${LedgerSMB::Sysconfig::spool}file; + my $spoolfile; my @spoolfiles = (); - while ((${LedgerSMB::Sysconfig::spool}file) = $sth->fetchrow_array) { - push @spoolfiles, ${LedgerSMB::Sysconfig::spool}file; + while (($spoolfile) = $sth->fetchrow_array) { + push @spoolfiles, $spoolfile; } $sth->finish; @@ -1269,7 +1269,7 @@ sub delete_invoice { my $rc = $dbh->commit; if ($rc) { - foreach ${LedgerSMB::Sysconfig::spool}file (@spoolfiles) { + foreach $spoolfile (@spoolfiles) { unlink "${LedgerSMB::Sysconfig::spool}/$spoolfile" if $spoolfile; } } diff --git a/LedgerSMB/JC.pm b/LedgerSMB/JC.pm index fe6530db..c8974818 100755 --- a/LedgerSMB/JC.pm +++ b/LedgerSMB/JC.pm @@ -310,11 +310,11 @@ sub delete_timecard { my $sth = $dbh->prepare($query); $sth->execute || $form->dberror($query); - my ${LedgerSMB::Sysconfig::spool}file; + my $spoolfile; my @spoolfiles = (); - while ((${LedgerSMB::Sysconfig::spool}file) = $sth->fetchrow_array) { - push @spoolfiles, ${LedgerSMB::Sysconfig::spool}file; + while (($spoolfile) = $sth->fetchrow_array) { + push @spoolfiles, $spoolfile; } $sth->finish; @@ -327,7 +327,7 @@ sub delete_timecard { my $rc = $dbh->commit; if ($rc) { - foreach ${LedgerSMB::Sysconfig::spool}file (@spoolfiles) { + foreach $spoolfile (@spoolfiles) { unlink "${LedgerSMB::Sysconfig::spool}/$spoolfile" if $spoolfile; } } diff --git a/LedgerSMB/OE.pm b/LedgerSMB/OE.pm index a9b624c0..1a51a6cf 100755 --- a/LedgerSMB/OE.pm +++ b/LedgerSMB/OE.pm @@ -667,7 +667,7 @@ sub save { sub delete { - my ($self, $myconfig, $form, ${LedgerSMB::Sysconfig::spool}) = @_; + my ($self, $myconfig, $form) = @_; # connect to database my $dbh = $form->{dbh}; @@ -680,11 +680,11 @@ sub delete { $sth = $dbh->prepare($query); $sth->execute($form->{id}) || $form->dberror($query); - my ${LedgerSMB::Sysconfig::spool}file; + my $spoolfile; my @spoolfiles = (); - while ((${LedgerSMB::Sysconfig::spool}file) = $sth->fetchrow_array) { - push @spoolfiles, ${LedgerSMB::Sysconfig::spool}file; + while (($spoolfile) = $sth->fetchrow_array) { + push @spoolfiles, $spoolfile; } $sth->finish; @@ -753,7 +753,7 @@ sub delete { $dbh->disconnect; if ($rc) { - foreach ${LedgerSMB::Sysconfig::spool}file (@spoolfiles) { + foreach $spoolfile (@spoolfiles) { unlink "${LedgerSMB::Sysconfig::spool}/$spoolfile" if $spoolfile; } } -- cgit v1.2.3