X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=inventory%2Fmanage%2Fitems.php;h=967cb5e67ec56c400d1e09274d835818c7b05b9e;hb=412b79dc32855f813d03a8a6dd9debd45bb308f5;hp=af08d0275b2f7023212b3fe0309ad4dbf04adc57;hpb=431531eebf3ba494002cfbf7ea36f9e82d4975c0;p=fa-stable.git diff --git a/inventory/manage/items.php b/inventory/manage/items.php index af08d027..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 { @@ -319,9 +322,6 @@ item_tax_types_list_row(_("Item Tax Type:"), 'tax_type_id', null); stock_item_types_list_row(_("Item Type:"), 'mb_flag', null, (!isset($_POST['NewStockID']) || isset($_POST['New']))); -/* The array stock_units is set up in config.php for user modification -possible units of measure can added or modifying the array definition by editing that file */ - stock_units_list_row(_('Units of Measure:'), 'units', null, (!isset($_POST['NewStockID']) || isset($_POST['New']))); end_table();