X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=inventory%2Fmanage%2Fitems.php;h=ca65111db900345424a3d1f162618e33c2f4cd36;hb=73f60eac205e4bcebf71b86258cb292810d584a8;hp=f8370c72cae7e4dd47b3197cf7090b7efbd44f0c;hpb=d567a10b7925c8bb97c734e213d6651a979af29d;p=fa-stable.git
diff --git a/inventory/manage/items.php b/inventory/manage/items.php
index f8370c72..ca65111d 100644
--- a/inventory/manage/items.php
+++ b/inventory/manage/items.php
@@ -27,13 +27,12 @@ $new_item = get_post('stock_id')=='';
if (isset($_GET['stock_id']))
{
- $_POST['stock_id'] = $stock_id = strtoupper($_GET['stock_id']);
+ $_POST['stock_id'] = $stock_id = $_GET['stock_id'];
}
-else if (isset($_POST['stock_id']))
+elseif (isset($_POST['stock_id']))
{
- $stock_id = strtoupper($_POST['stock_id']);
+ $stock_id = $_POST['stock_id'];
}
-
if (list_updated('stock_id')) {
$_POST['NewStockID'] = get_post('stock_id');
clear_data();
@@ -43,6 +42,7 @@ if (list_updated('stock_id')) {
$upload_file = "";
if (isset($_FILES['pic']) && $_FILES['pic']['name'] != '')
{
+ $stock_id = $_POST['NewStockID'];
$result = $_FILES['pic']['error'];
$upload_file = 'Yes'; //Assume all is well to start off with
$filename = $comp_path . "/$user_comp/images";
@@ -50,7 +50,7 @@ if (isset($_FILES['pic']) && $_FILES['pic']['name'] != '')
{
mkdir($filename);
}
- $filename .= "/$stock_id.jpg";
+ $filename .= "/".item_img_name($stock_id).".jpg";
//But check for the worst
if (strtoupper(substr(trim($_FILES['pic']['name']), strlen($_FILES['pic']['name']) - 3)) != 'JPG')
@@ -82,6 +82,7 @@ if (isset($_FILES['pic']) && $_FILES['pic']['name'] != '')
{
$result = move_uploaded_file($_FILES['pic']['tmp_name'], $filename);
}
+ $Ajax->activate('details');
/* EOF Add Image upload for New Item - by Ori */
}
@@ -238,7 +239,7 @@ if (isset($_POST['delete']) && strlen($_POST['delete']) > 1)
$stock_id = $_POST['NewStockID'];
delete_item($stock_id);
- $filename = $comp_path . "/$user_comp/images/$stock_id.jpg";
+ $filename = $comp_path . "/$user_comp/images/".item_img_name($stock_id).".jpg";
if (file_exists($filename))
unlink($filename);
display_notification(_("Selected item has been deleted."));
@@ -390,12 +391,13 @@ table_section_title(_("Picture"));
label_row(_("Image File (.jpg)") . ":", "");
// Add Image upload for New Item - by Joe
$stock_img_link = "";
-if (isset($_POST['NewStockID']) && file_exists("$comp_path/$user_comp/images/".$_POST['NewStockID'].".jpg"))
+if (isset($_POST['NewStockID']) && file_exists("$comp_path/$user_comp/images/"
+ .item_img_name($_POST['NewStockID']).".jpg"))
{
// 31/08/08 - rand() call is necessary here to avoid caching problems. Thanks to Peter D.
$stock_img_link .= "
";
+ "]' src='$comp_path/$user_comp/images/".item_img_name($_POST['NewStockID']).".jpg?nocache=".rand()."'".
+ " height='$pic_height' border='0'>";
}
else
{