[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[2362] trunk/LedgerSMB/AM.pm



Revision: 2362
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2362&view=rev
Author:   einhverfr
Date:     2008-10-10 15:45:35 +0000 (Fri, 10 Oct 2008)

Log Message:
-----------
Correcting defaults setting logic.

Modified Paths:
--------------
    trunk/LedgerSMB/AM.pm

Modified: trunk/LedgerSMB/AM.pm
===================================================================
--- trunk/LedgerSMB/AM.pm	2008-10-10 15:35:29 UTC (rev 2361)
+++ trunk/LedgerSMB/AM.pm	2008-10-10 15:45:35 UTC (rev 2362)
@@ -1833,23 +1833,15 @@
 				    $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) . ",'$_');"); 
+				  }
 
-				    }
-
         }
 
     }


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.