summaryrefslogtreecommitdiff
path: root/LedgerSMB
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2008-10-10 15:45:35 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2008-10-10 15:45:35 +0000
commit2351a30612a560c47232104d9cd46326319acca1 (patch)
treed3c5d86985bccae9a1046da343c5f049516d834b /LedgerSMB
parentba5890bd2f14e916e47f17a79af49392487dbeb0 (diff)
Correcting defaults setting logic.
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@2362 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB')
-rw-r--r--LedgerSMB/AM.pm24
1 files changed, 8 insertions, 16 deletions
diff --git a/LedgerSMB/AM.pm b/LedgerSMB/AM.pm
index b6834e53..3885829e 100644
--- a/LedgerSMB/AM.pm
+++ b/LedgerSMB/AM.pm
@@ -1833,22 +1833,14 @@ sub save_defaults {
$sth_defcheck->execute() || $form->dberror("execute defaults $_");
while(my $found1=$sth_defcheck->fetchrow()){$found=$found1;}
- if($val ne '')
- {
- if($found)
- {
- $dbh->do("update defaults set value=" . $dbh->quote($val) . " where setting_key='$_';");
- }
- else
- {
- $dbh->do("insert into defaults(value,setting_key) values( " . $dbh->quote($val) . ",'$_');");
- }
- }
- else
- {
- if($found){$dbh->do("delete from defaults where setting_key='$_';")};
-
- }
+ if($found)
+ {
+ $dbh->do("update defaults set value=" . $dbh->quote($val) . " where setting_key='$_';");
+ }
+ else
+ {
+ $dbh->do("insert into defaults(value,setting_key) values( " . $dbh->quote($val) . ",'$_');");
+ }
}