From: <tim...@us...> - 2010-04-05 19:09:56
|
Revision: 3406 http://web-erp.svn.sourceforge.net/web-erp/?rev=3406&view=rev Author: tim_schofield Date: 2010-04-05 19:09:50 +0000 (Mon, 05 Apr 2010) Log Message: ----------- Matt Taylor: Z_ImportStocks.php : Correct DB_txn functions and add validation check. Modified Paths: -------------- trunk/Z_ImportStocks.php trunk/doc/Change.log.html Modified: trunk/Z_ImportStocks.php =================================================================== --- trunk/Z_ImportStocks.php 2010-04-05 15:32:01 UTC (rev 3405) +++ trunk/Z_ImportStocks.php 2010-04-05 19:09:50 UTC (rev 3406) @@ -77,7 +77,7 @@ } //start database transaction - DB_Txn_Begin(); + DB_Txn_Begin($db); //loop through file rows $row = 1; @@ -129,6 +129,10 @@ $InputError = 1; prnMsg(_('The barcode must be 20 characters or less long'),'error'); } + if (!is_numeric($myrow[10]) OR $myrow[10]!=0 OR $myrow[10]!=1) { + $InputError = 1; + prnMsg (_('Values in the Perishable field must be either 0 (No) or 1 (Yes)') ,'error'); + } if (!is_numeric($myrow[11])) { $InputError = 1; prnMsg (_('The volume of the packaged item in cubic metres must be numeric') ,'error'); @@ -260,9 +264,9 @@ if ($InputError == 1) { //exited loop with errors so rollback prnMsg(_('Failed on row '. $row. '. Batch import has been rolled back.'),'error'); - DB_Txn_Rollback(); + DB_Txn_Rollback($db); } else { //all good so commit data transaction - DB_Txn_Commit(); + DB_Txn_Commit($db); prnMsg( _('Batch Import of') .' ' . $fileName . ' '. _('has been completed. All transactions committed to the database.'),'success'); } Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-04-05 15:32:01 UTC (rev 3405) +++ trunk/doc/Change.log.html 2010-04-05 19:09:50 UTC (rev 3406) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>05/04/10 Matt Taylor: Z_ImportStocks.php : Correct DB_txn functions and add validation check.</p> <p>05/04/10 Zhiguo: Japanese translation updates</p> <p>04/04/10 Tim: upgrade3.11.1-3.12.sql - Enlarge fieldname column in reportfields to 60 characters</p> <p>01/04/10 Harald: PDFSuppTransListing.php - Typing error in script title</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |