X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=inventory%2Fmanage%2Fitem_units.php;h=af46ad54f35e7384abf849e328d86e02f4dfa980;hb=f01da91c553b7d256b053475c0f5dc026c47c10d;hp=39be1be54d192d1c986488d67063d1aa50a68907;hpb=902f1015d874c33bd7946b17de2ad80b4f2144b6;p=fa-stable.git diff --git a/inventory/manage/item_units.php b/inventory/manage/item_units.php index 39be1be5..af46ad54 100644 --- a/inventory/manage/item_units.php +++ b/inventory/manage/item_units.php @@ -13,7 +13,7 @@ $page_security = 'SA_UOM'; $path_to_root = "../.."; include($path_to_root . "/includes/session.inc"); -page(_("Units of Measure")); +page(_($help_context = "Units of Measure")); include_once($path_to_root . "/includes/ui.inc"); @@ -34,6 +34,12 @@ if ($Mode=='ADD_ITEM' || $Mode=='UPDATE_ITEM') display_error(_("The unit of measure code cannot be empty.")); set_focus('abbr'); } + if (strlen(db_escape($_POST['abbr']))>(20+2)) + { + $input_error = 1; + display_error(_("The unit of measure code is too long.")); + set_focus('abbr'); + } if (strlen($_POST['description']) == 0) { $input_error = 1; @@ -42,7 +48,7 @@ if ($Mode=='ADD_ITEM' || $Mode=='UPDATE_ITEM') } if ($input_error !=1) { - write_item_unit(htmlentities($selected_id), $_POST['abbr'], $_POST['description'], $_POST['decimals'] ); + write_item_unit($selected_id, $_POST['abbr'], $_POST['description'], $_POST['decimals'] ); if($selected_id != '') display_notification(_('Selected unit has been updated')); else @@ -84,7 +90,7 @@ if ($Mode == 'RESET') $result = get_all_item_units(check_value('show_inactive')); start_form(); -start_table("$table_style width=40%"); +start_table(TABLESTYLE, "width='40%'"); $th = array(_('Unit'), _('Description'), _('Decimals'), "", ""); inactive_control_column($th); @@ -99,10 +105,10 @@ while ($myrow = db_fetch($result)) label_cell($myrow["abbr"]); label_cell($myrow["name"]); label_cell(($myrow["decimals"]==-1?_("User Quantity Decimals"):$myrow["decimals"])); - - inactive_control_cell($myrow["abbr"], $myrow["inactive"], 'item_units', 'abbr'); - edit_button_cell("Edit".$myrow["abbr"], _("Edit")); - delete_button_cell("Delete".$myrow["abbr"], _("Delete")); + $id = html_specials_encode($myrow["abbr"]); + inactive_control_cell($id, $myrow["inactive"], 'item_units', 'abbr'); + edit_button_cell("Edit".$id, _("Edit")); + delete_button_cell("Delete".$id, _("Delete")); end_row(); } @@ -111,7 +117,7 @@ end_table(1); //---------------------------------------------------------------------------------- -start_table($table_style2); +start_table(TABLESTYLE2); if ($selected_id != '') { @@ -124,7 +130,7 @@ if ($selected_id != '') $_POST['description'] = $myrow["name"]; $_POST['decimals'] = $myrow["decimals"]; } - hidden('selected_id', $selected_id); + hidden('selected_id', $myrow["abbr"]); } if ($selected_id != '' && item_unit_used($selected_id)) { label_row(_("Unit Abbreviation:"), $_POST['abbr']); @@ -143,4 +149,3 @@ end_form(); end_page(); -?>