From: <ex...@us...> - 2015-11-03 11:10:30
|
Revision: 7378 http://sourceforge.net/p/web-erp/reponame/7378 Author: exsonqu Date: 2015-11-03 11:10:28 +0000 (Tue, 03 Nov 2015) Log Message: ----------- 3/11/15 Exson: Tidy code up in StockClone.php. Modified Paths: -------------- trunk/StockClone.php Modified: trunk/StockClone.php =================================================================== --- trunk/StockClone.php 2015-11-03 02:07:23 UTC (rev 7377) +++ trunk/StockClone.php 2015-11-03 11:10:28 UTC (rev 7378) @@ -510,7 +510,7 @@ prnMsg( _('New cloned Item') .' ' . '<a href="SelectProduct.php?StockID=' . $_POST['StockID'] . '">' . $_POST['StockID'] . '</a> '. _('has been added to the database') . '<br />' . _('We also attempted to setup item purchase data and pricing.')); - if ($NoPricingData==1) + if (!empty($NoPricingData)) { prnMsg(_('There is no pricing data to clone. Use the following link to add pricing.')); } @@ -572,12 +572,11 @@ <input type="hidden" name="New" value="'.$_POST['New'].'" /> <table class="selection">'; -if ($_POST['StockID'] == '' || ($_POST['StockID'] == $_POST['OldStockID']) || isset($_POST['UpdateCategories'])) { +if (empty($_POST['StockID']) || (isset($_POST['StockID']) AND $_POST['StockID'] == $_POST['OldStockID']) || isset($_POST['UpdateCategories'])) { /*If the page was called without $StockID or empty $StockID then a new cloned stock item is to be entered. Show a form with a part Code field, otherwise show form for editing with only a hidden OldStockID field. */ - //if ($_POST['New']==1) { $StockIDStyle= !empty($_POST['StockID']) && ($_POST['StockID'] != $_POST['OldStockID'])? '' : ' style="color:red;border: 2px solid red;background-color:#fddbdb;" '; $StockID= !empty($_POST['StockID'])? $_POST['StockID']:$_POST['OldStockID']; echo '<tr> @@ -587,7 +586,6 @@ </td> </tr>'; - //} } if ( (!isset($_POST['UpdateCategories']) AND ($InputError!=1)) OR $_POST['New']== 1 ) { // Must be modifying an existing item and no changes made yet @@ -673,12 +671,14 @@ if ($LanguageId!=''){ //unfortunately cannot have points in POST variables so have to mess with the language id $PostVariableName = 'Description_' . str_replace('.','_',$LanguageId); + $LongDescriptionTranslated = 'LongDescription_' . str_replace('.','_',$LanguageId); if (!isset($_POST[$PostVariableName])){ $_POST[$PostVariableName] =''; } echo '<tr> <td>' . $LanguagesArray[$LanguageId]['LanguageName'] . ' ' . _('Description') . ':</td> <td><input type="text" name="'. $PostVariableName . '" size="52" maxlength="50" value="' . $_POST[$PostVariableName] . '" /></td> + <td><input type="hidden" name="' . $LongDescriptionTranslated . '" value="' . $_POST['LongDescription_' . str_replace('.','_',$LanguageId)] . '" /> </tr>'; } } |