From: <dai...@us...> - 2014-12-18 08:29:30
|
Revision: 7030 http://sourceforge.net/p/web-erp/reponame/7030 Author: daintree Date: 2014-12-18 08:29:23 +0000 (Thu, 18 Dec 2014) Log Message: ----------- dont make a new record in stockdescriptiontranslations for empty translations Modified Paths: -------------- trunk/Stocks.php trunk/doc/Change.log Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2014-12-18 02:07:07 UTC (rev 7029) +++ trunk/Stocks.php 2014-12-18 08:29:23 UTC (rev 7030) @@ -428,8 +428,8 @@ if (count($ItemDescriptionLanguagesArray)>0){ foreach ($ItemDescriptionLanguagesArray as $LanguageId) { - if ($LanguageId!=''){ - $result = DB_query("DELETE FROM stockdescriptiontranslations WHERE stockid='" . $StockID . "' AND language_id='" . $LanguageId . "'",$ErrMsg,$DbgMsg,true); + if ($LanguageId != ''){ + $result = DB_query("DELETE FROM stockdescriptiontranslations WHERE stockid='" . $StockID . "' AND language_id='" . $LanguageId . "'", $ErrMsg, $DbgMsg, true); $result = DB_query("INSERT INTO stockdescriptiontranslations VALUES('" . $StockID . "','" . $LanguageId . "', '" . $_POST['Description_' . str_replace('.','_',$LanguageId)] . "')",$ErrMsg,$DbgMsg,true); } } @@ -632,7 +632,7 @@ $DbgMsg = _('The SQL that was used to update the language description and failed was'); if (count($ItemDescriptionLanguages)>0){ foreach ($ItemDescriptionLanguagesArray as $LanguageId) { - if ($LanguageId!=''){ + if ($LanguageId != '' AND $_POST['Description_' . str_replace('.','_',$LanguageId)] != ''){ $sql = "INSERT INTO stockdescriptiontranslations VALUES('" . $StockID . "','" . $LanguageId . "', '" . $_POST['Description_' . str_replace('.','_',$LanguageId)] . "')"; $result = DB_query($sql,$ErrMsg,$DbgMsg,true); } Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2014-12-18 02:07:07 UTC (rev 7029) +++ trunk/doc/Change.log 2014-12-18 08:29:23 UTC (rev 7030) @@ -1,4 +1,7 @@ webERP Change Log + +18/12/14 Phil: Fix to only add a description translation record where there is a non-empty translation string +18/12/14 Ricard: Google translate script to add descriptions in a selected language 16/12/14 Agaluski: Add new Quality Module to WebERP. 16/12/14 RChacon: Expand and uniform the accuracy of the exchange rate. 5/12/14 Exson: Fixed the branch field bug in CustomerReceipt.php. Reported by wertthey. |