summaryrefslogtreecommitdiff
path: root/LedgerSMB/DBObject.pm
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-03-13 05:41:18 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-03-13 05:41:18 +0000
commitab7cede7f91f48f553a86f500d2bcb7408fbb84a (patch)
treeb60e950c960d8e14d9d1956d877b9fe41023d190 /LedgerSMB/DBObject.pm
parent665470fabcd881eaf1b01008866e1da84f9c073a (diff)
LedgerSMB::DBObject LedgerSMB::Setting LedgerSMB::Employee, and LedgerSMB::Location all now use strict
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@890 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB/DBObject.pm')
-rw-r--r--LedgerSMB/DBObject.pm20
1 files changed, 10 insertions, 10 deletions
diff --git a/LedgerSMB/DBObject.pm b/LedgerSMB/DBObject.pm
index 17e4e4b0..83a94d4a 100644
--- a/LedgerSMB/DBObject.pm
+++ b/LedgerSMB/DBObject.pm
@@ -26,7 +26,6 @@ your software.
package LedgerSMB::DBObject;
use LedgerSMB;
use strict;
-no strict 'refs';
use warnings;
our @ISA = qw(LedgerSMB);
@@ -86,13 +85,16 @@ sub run_custom_queries {
my ($self, $tablename, $query_type, $linenum) = @_;
my $dbh = $self->{dbh};
if ($query_type !~ /^(select|insert|update)$/i){
- $self->error($locale->text(
- "Passed incorrect query type to run_custom_queries."
- ));
+ # Commenting out this next bit until we figure out how the locale object
+ # will operate. Chris
+ #$self->error($locale->text(
+ # "Passed incorrect query type to run_custom_queries."
+ #));
}
my @rc;
my %temphash;
my @templist;
+ my $did_insert;
my @elements;
my $query;
my $ins_values;
@@ -152,7 +154,7 @@ sub run_custom_queries {
if ($query_type eq 'INSERT'){
for (@rc){
$query = shift (@{$_});
- $sth = $dbh->prepare($query)
+ my $sth = $dbh->prepare($query)
|| $self->db_error($query);
$sth->execute(@{$_}, $self->{id})
|| $self->dberror($query);;
@@ -165,12 +167,10 @@ sub run_custom_queries {
} elsif ($query_type eq 'SELECT'){
for (@rc){
$query = shift @{$_};
- $sth = $self->{dbh}->prepare($query);
+ my $sth = $self->{dbh}->prepare($query);
$sth->execute($self->{id});
- $ref = $sth->fetchrow_hashref(NAME_lc);
- for (keys %{$ref}){
- $self->{$_} = $ref->{$_};
- }
+ my $ref = $sth->fetchrow_hashref('NAME_lc');
+ $self->merge($ref, keys(%$ref));
}
}
@rc;