X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=inventory%2Fmanage%2Fitems.php;h=967cb5e67ec56c400d1e09274d835818c7b05b9e;hb=9b311580c022c0d89db3b489fdc04e8bea00aae1;hp=486a3d16fd54306922f2a3b0fd695b8808f55544;hpb=512f9dbe2a3dc1282358c6641ebd715e1bae5136;p=fa-stable.git
diff --git a/inventory/manage/items.php b/inventory/manage/items.php
index 486a3d16..967cb5e6 100644
--- a/inventory/manage/items.php
+++ b/inventory/manage/items.php
@@ -39,12 +39,12 @@ if (isset($_FILES['pic']) && $_FILES['pic']['name'] != '')
{
$result = $_FILES['pic']['error'];
$upload_file = 'Yes'; //Assume all is well to start off with
- $filename = $path_to_root . "/inventory/manage/image/$user_comp/";
+ $filename = $comp_path . "/$user_comp/images";
if (!file_exists($filename))
{
mkdir($filename);
}
- $filename .= "$stock_id.jpg";
+ $filename .= "/$stock_id.jpg";
//But check for the worst
if (strtoupper(substr(trim($_FILES['pic']['name']), strlen($_FILES['pic']['name']) - 3)) != 'JPG')
@@ -112,11 +112,13 @@ if (isset($_POST['addupdate']))
{
$input_error = 1;
display_error( _('The item name must be entered.'));
+ set_focus('description');
}
elseif (strlen($_POST['NewStockID']) == 0)
{
$input_error = 1;
display_error( _('The item code cannot be empty'));
+ set_focus('NewStockID');
}
elseif (strstr($_POST['NewStockID'], " ") || strstr($_POST['NewStockID'],"'") ||
strstr($_POST['NewStockID'], "+") || strstr($_POST['NewStockID'], "\"") ||
@@ -124,6 +126,7 @@ if (isset($_POST['addupdate']))
{
$input_error = 1;
display_error( _('The item code cannot contain any of the following characters - & + OR a space OR quotes'));
+ set_focus('NewStockID');
}
@@ -206,7 +209,7 @@ if (isset($_POST['delete']) && strlen($_POST['delete']) > 1)
$stock_id = $_POST['NewStockID'];
delete_item($stock_id);
- $filename = $path_to_root . "/inventory/manage/image/$user_comp/$stock_id.jpg";
+ $filename = $comp_path . "/$user_comp/images/$stock_id.jpg";
if (file_exists($filename))
unlink($filename);
meta_forward($_SERVER['PHP_SELF']);
@@ -300,9 +303,9 @@ start_table("$table_style2 width=40%");
start_row();
label_cells(_("Image File (.jpg)") . ":", "");
// Add Image upload for New Item - by Joe
-if (isset($_POST['NewStockID']) && file_exists("$path_to_root/inventory/manage/image/$user_comp/".$_POST['NewStockID'].".jpg"))
+if (isset($_POST['NewStockID']) && file_exists("$comp_path/$user_comp/images/".$_POST['NewStockID'].".jpg"))
{
- $stock_img_link = "";
+ $stock_img_link = "";
}
else
{