From: <ice...@us...> - 2013-10-20 15:48:39
|
Revision: 6364 http://sourceforge.net/p/web-erp/reponame/6364 Author: icedlava Date: 2013-10-20 15:48:37 +0000 (Sun, 20 Oct 2013) Log Message: ----------- Fix file header. Modified Paths: -------------- trunk/StockClone.php Modified: trunk/StockClone.php =================================================================== --- trunk/StockClone.php 2013-10-20 15:23:15 UTC (rev 6363) +++ trunk/StockClone.php 2013-10-20 15:48:37 UTC (rev 6364) @@ -1,5 +1,5 @@ <?php -/* $Id: StockClone.php $*/ +/* $Id$ */ include('includes/session.inc'); $Title = _('Clone Item'); |
From: <ice...@us...> - 2013-10-21 12:05:25
|
Revision: 6365 http://sourceforge.net/p/web-erp/reponame/6365 Author: icedlava Date: 2013-10-21 12:05:22 +0000 (Mon, 21 Oct 2013) Log Message: ----------- Put back ability to reclone without selecting another item again. Fix the inadvertently removed error messages. Modified Paths: -------------- trunk/StockClone.php Modified: trunk/StockClone.php =================================================================== --- trunk/StockClone.php 2013-10-20 15:48:37 UTC (rev 6364) +++ trunk/StockClone.php 2013-10-21 12:05:22 UTC (rev 6365) @@ -40,7 +40,10 @@ if (($myrow[0]==0) && ($_POST['OldStockID'] != '')) { $_POST['New'] =1; } else { - $_POST['New']=0; + prnMsg(_('The stock code entered is already in the database - duplicate stock codes are prohibited by the system. Try choosing an alternative stock code'),'error'); + $Errors[1] = 'DuplicateStockID'; + $_POST['New']=0; + $_POST['StockID'] = $_POST['OldStockID']; } } @@ -266,7 +269,8 @@ WHERE stockid='" . $_POST['StockID'] ."'",$db); if (DB_num_rows($result)==1){ prnMsg(_('The stock code entered is already in the database - duplicate stock codes are prohibited by the system. Try choosing an alternative stock code'),'error'); - exit; + $Errors[$i] = 'DuplicateStockID'; + //exit; } else { $sql = "INSERT INTO stockmaster (stockid, description, @@ -542,10 +546,10 @@ unset($_POST['ShrinkFactor']); unset($_POST['Pansize']); unset($_POST['StockID']); - unset($_POST['OldStockID']); + //unset($_POST['OldStockID']); foreach ($ItemDescriptionLanguages as $DescriptionLanguage) { unset($_POST['Description_' . str_replace('.','_',$DescriptionLanguage)]); - $_POST['New'] = 0; //do not show input form again + $_POST['New'] = 1; //do not show input form again } }//Reset the form variables }//Stock records finished @@ -567,12 +571,12 @@ <input type="hidden" name="New" value="'.$_POST['New'].'" /> <table class="selection">'; -if ($_POST['StockID'] == '' || ($_POST['StockID'] == $_POST['OldStockID']) ||isset($_POST['UpdateCategories'])) { +if ($_POST['StockID'] == '' || ($_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) { + //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> @@ -582,7 +586,7 @@ </td> </tr>'; - } + //} } if ( (!isset($_POST['UpdateCategories']) AND ($InputError!=1)) OR $_POST['New']== 1 ) { // Must be modifying an existing item and no changes made yet @@ -648,7 +652,7 @@ } -if ($_POST['New'] == 1) { +//if ($_POST['New'] == 1) { if (isset($_POST['Description'])) { $Description = $_POST['Description']; } else { @@ -1091,7 +1095,7 @@ echo '<input type="submit" name="submit" value="' . _('Insert New Item') . '" />'; echo '<input type="submit" name="UpdateCategories" style="visibility:hidden;width:1px" value="' . _('Categories') . '" />'; -} +//} echo '</div> </div> </form>'; |
From: <te...@us...> - 2015-01-07 07:33:21
|
Revision: 7072 http://sourceforge.net/p/web-erp/reponame/7072 Author: tehonu Date: 2015-01-07 07:33:13 +0000 (Wed, 07 Jan 2015) Log Message: ----------- StockClone now also clones the long description translations as well Modified Paths: -------------- trunk/StockClone.php Modified: trunk/StockClone.php =================================================================== --- trunk/StockClone.php 2015-01-07 06:50:58 UTC (rev 7071) +++ trunk/StockClone.php 2015-01-07 07:33:13 UTC (rev 7072) @@ -324,7 +324,15 @@ if (count($ItemDescriptionLanguagesArray)>0){ foreach ($ItemDescriptionLanguagesArray as $LanguageId) { if ($LanguageId!=''){ - $result = DB_query("INSERT INTO stockdescriptiontranslations VALUES('" . $_POST['StockID'] . "','" . $LanguageId . "', '" . $_POST['Description_' . str_replace('.','_',$LanguageId)] . "')",$ErrMsg,$DbgMsg,true); + $result = DB_query("INSERT INTO stockdescriptiontranslations (stockid, + language_id, + descriptiontranslation, + longdescriptiontranslation) + VALUES('" . $StockID . "','" . + $LanguageId . "', '" . + $_POST['Description_' . str_replace('.','_',$LanguageId)] . "', '" . + $_POST['LongDescription_' . str_replace('.','_',$LanguageId)]. + "')",$ErrMsg,$DbgMsg,true); } } } @@ -633,7 +641,11 @@ $_POST['Pansize'] = $myrow['pansize']; $_POST['ShrinkFactor'] = $myrow['shrinkfactor']; - $sql = "SELECT descriptiontranslation, language_id FROM stockdescriptiontranslations WHERE stockid='" . $selectedStockID . "' AND ("; + $sql = "SELECT descriptiontranslation, + longdescriptiontranslation, + language_id + FROM stockdescriptiontranslations + WHERE stockid='" . $selectedStockID . "' AND ("; foreach ($ItemDescriptionLanguagesArray as $LanguageId) { $sql .= "language_id='" . $LanguageId ."' OR "; } @@ -641,6 +653,7 @@ $result = DB_query($sql); while ($myrow = DB_fetch_array($result)){ $_POST['Description_' . str_replace('.','_',$myrow['language_id'])] = $myrow['descriptiontranslation']; + $_POST['LongDescription_' . str_replace('.','_',$myrow['language_id'])] = $myrow['longdescriptiontranslation']; } } |
From: <te...@us...> - 2015-01-07 08:12:01
|
Revision: 7073 http://sourceforge.net/p/web-erp/reponame/7073 Author: tehonu Date: 2015-01-07 08:11:52 +0000 (Wed, 07 Jan 2015) Log Message: ----------- Fix bug in previous commit. Modified Paths: -------------- trunk/StockClone.php Modified: trunk/StockClone.php =================================================================== --- trunk/StockClone.php 2015-01-07 07:33:13 UTC (rev 7072) +++ trunk/StockClone.php 2015-01-07 08:11:52 UTC (rev 7073) @@ -328,7 +328,7 @@ language_id, descriptiontranslation, longdescriptiontranslation) - VALUES('" . $StockID . "','" . + VALUES('" . $_POST['StockID'] . "','" . $LanguageId . "', '" . $_POST['Description_' . str_replace('.','_',$LanguageId)] . "', '" . $_POST['LongDescription_' . str_replace('.','_',$LanguageId)]. |
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>'; } } |
From: <ex...@us...> - 2015-11-05 01:05:35
|
Revision: 7381 http://sourceforge.net/p/web-erp/reponame/7381 Author: exsonqu Date: 2015-11-05 01:05:32 +0000 (Thu, 05 Nov 2015) Log Message: ----------- 05/11/15 Exson: Tidy code up following Tim's suggestion. Modified Paths: -------------- trunk/StockClone.php Modified: trunk/StockClone.php =================================================================== --- trunk/StockClone.php 2015-11-03 15:30:05 UTC (rev 7380) +++ trunk/StockClone.php 2015-11-05 01:05:32 UTC (rev 7381) @@ -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 (!empty($NoPricingData)) + if (isset($NoPricingData)) { prnMsg(_('There is no pricing data to clone. Use the following link to add pricing.')); } |
From: <ex...@us...> - 2016-05-09 03:12:40
|
Revision: 7513 http://sourceforge.net/p/web-erp/reponame/7513 Author: exsonqu Date: 2016-05-09 03:12:38 +0000 (Mon, 09 May 2016) Log Message: ----------- 09/05/16 Exson: Tidy Code Up to remove redundant code according to Tim's guide. Modified Paths: -------------- trunk/StockClone.php Modified: trunk/StockClone.php =================================================================== --- trunk/StockClone.php 2016-05-08 15:59:07 UTC (rev 7512) +++ trunk/StockClone.php 2016-05-09 03:12:38 UTC (rev 7513) @@ -588,7 +588,7 @@ <input type="hidden" name="New" value="'.$_POST['New'].'" /> <table class="selection">'; -if (empty($_POST['StockID']) || (isset($_POST['StockID']) AND $_POST['StockID'] == $_POST['OldStockID']) || isset($_POST['UpdateCategories'])) { +if (empty($_POST['StockID']) || $_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. */ |