From: <ice...@us...> - 2013-09-05 06:03:53
|
Revision: 6326 http://sourceforge.net/p/web-erp/reponame/6326 Author: icedlava Date: 2013-09-05 06:03:50 +0000 (Thu, 05 Sep 2013) Log Message: ----------- Stocks.php Clear image for new items. Add error message for upload failure when no tmp directory set in PHP. Modified Paths: -------------- trunk/Stocks.php trunk/doc/Change.log Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2013-09-05 02:24:13 UTC (rev 6325) +++ trunk/Stocks.php 2013-09-05 06:03:50 UTC (rev 6326) @@ -80,6 +80,9 @@ } elseif ( $_FILES['ItemPicture']['type'] == 'text/plain' ) { //File Type Check prnMsg( _('Only graphics files can be uploaded'),'warn'); $UploadTheFile ='No'; + } elseif ( $_FILES['ItemPicture']['error'] == 6 ) { //upload temp directory check + prnMsg( _('No tmp directory set. You must have a tmp directory set in your PHP for upload of files. '),'warn'); + $UploadTheFile ='No'; } elseif (file_exists($filename)){ prnMsg(_('Attempting to overwrite an existing item image'),'warn'); $result = unlink($filename); @@ -989,7 +992,7 @@ <br /><input type="checkbox" name="ClearImage" id="ClearImage" value="1" > '._('Clear Image').' </td>'; - if (function_exists('imagecreatefromjpg')){ +if (function_exists('imagecreatefromjpg') && isset($StockID) && !empty($StockID)){ $StockImgLink = '<img src="GetStockImage.php?automake=1&textcolor=FFFFFF&bgcolor=CCCCCC'. '&StockID='.urlencode($StockID). '&text='. @@ -997,7 +1000,7 @@ '&height=100'. '" alt="" />'; } else { - if( isset($StockID) AND file_exists($_SESSION['part_pics_dir'] . '/' .$StockID.'.jpg') ) { + if( isset($StockID) AND !empty($StockID) AND file_exists($_SESSION['part_pics_dir'] . '/' .$StockID.'.jpg') ) { $StockImgLink = '<img src="' . $_SESSION['part_pics_dir'] . '/' . $StockID . '.jpg" height="100" width="100" />'; if (isset($_POST['ClearImage']) ) { //workaround for many variations of permission issues that could cause unlink fail Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2013-09-05 02:24:13 UTC (rev 6325) +++ trunk/doc/Change.log 2013-09-05 06:03:50 UTC (rev 6326) @@ -1,4 +1,6 @@ webERP Change Log +5/9/2013 icedlava: Stocks.php Set error message for upload image failure when no upload tmp directory set in php. +5/9/2013 icedlava: Stocks.php Clear item image for new item creation. 5/9/2013 icedlava: Suppliers.php regex pattern for email, also not all suppliers have email. 4/9/2013 Exson: Fixed the undefined StockID error and make it html5 compatible and table sorting in StockReorderLevel.php 2/9/2013 icedlava: SelectOrderItems.php fix frequently ordered items to accept entry as was not working. |