X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=inventory%2Fmanage%2Fitem_categories.php;h=233d034b401bf3d361ef49f30621994dc6ab8ebc;hb=45a035785b9a820621da56dec93078b3ccd9832e;hp=cff22f4739f0f94b0699e1d19fe39e67f62ec8b1;hpb=a5953f4c442fb44f1e60eb1e15eb7066dca95420;p=fa-stable.git diff --git a/inventory/manage/item_categories.php b/inventory/manage/item_categories.php index cff22f47..233d034b 100644 --- a/inventory/manage/item_categories.php +++ b/inventory/manage/item_categories.php @@ -9,8 +9,8 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License here . ***********************************************************************/ -$page_security = 11; -$path_to_root="../.."; +$page_security = 'SA_ITEMCATEGORY'; +$path_to_root = "../.."; include($path_to_root . "/includes/session.inc"); page(_("Item Categories")); @@ -67,7 +67,7 @@ if ($Mode == 'Delete') { // PREVENT DELETES IF DEPENDENT RECORDS IN 'stock_master' - $sql= "SELECT COUNT(*) FROM ".TB_PREF."stock_master WHERE category_id='$selected_id'"; + $sql= "SELECT COUNT(*) FROM ".TB_PREF."stock_master WHERE category_id=".db_escape($selected_id); $result = db_query($sql, "could not query stock master"); $myrow = db_fetch_row($result); if ($myrow[0] > 0) @@ -160,7 +160,7 @@ if ($selected_id != -1) } hidden('selected_id', $selected_id); hidden('category_id'); -} else { +} else if ($Mode != 'CLONE') { $_POST['long_description'] = ''; $_POST['description'] = ''; $_POST['no_sale'] = 0; @@ -194,7 +194,7 @@ stock_item_types_list_row(_("Item Type:"), 'mb_flag', null, true); stock_units_list_row(_("Units of Measure:"), 'units', null); -check_row(_("Exclude from sales:"), 'no_sale', $_POST['no_sale']); +check_row(_("Exclude from sales:"), 'no_sale'); gl_all_accounts_list_row(_("Sales Account:"), 'sales_account', $_POST['sales_account']); @@ -231,7 +231,7 @@ if ($dim < 2) end_table(1); div_end(); -submit_add_or_update_center($selected_id == -1, '', 'both'); +submit_add_or_update_center($selected_id == -1, '', 'both', true); end_form();