X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=inventory%2Fmanage%2Fitem_units.php;h=af46ad54f35e7384abf849e328d86e02f4dfa980;hb=317210096efdbe5b375d5a0112d4f10a3c3c0b53;hp=61e4e685d6de346f3a37e5b3e4ab819556f8a46f;hpb=8259c324f645a39cb847d5a4346b70e225e1b02c;p=fa-stable.git diff --git a/inventory/manage/item_units.php b/inventory/manage/item_units.php index 61e4e685..af46ad54 100644 --- a/inventory/manage/item_units.php +++ b/inventory/manage/item_units.php @@ -1,10 +1,19 @@ . +***********************************************************************/ +$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"); @@ -25,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; @@ -58,22 +73,26 @@ if ($Mode == 'Delete') { delete_item_unit($selected_id); display_notification(_('Selected unit has been deleted')); - $Mode = 'RESET'; } + $Mode = 'RESET'; } if ($Mode == 'RESET') { $selected_id = ''; + $sav = get_post('show_inactive'); unset($_POST); + $_POST['show_inactive'] = $sav; } //---------------------------------------------------------------------------------- -$result = get_all_item_units(); +$result = get_all_item_units(check_value('show_inactive')); + start_form(); -start_table("$table_style width=50%"); +start_table(TABLESTYLE, "width='40%'"); $th = array(_('Unit'), _('Description'), _('Decimals'), "", ""); +inactive_control_column($th); table_header($th); $k = 0; //row colour counter @@ -86,21 +105,19 @@ while ($myrow = db_fetch($result)) label_cell($myrow["abbr"]); label_cell($myrow["name"]); label_cell(($myrow["decimals"]==-1?_("User Quantity Decimals"):$myrow["decimals"])); - - edit_button_cell("Edit".$myrow[0], _("Edit")); - edit_button_cell("Delete".$myrow[0], _("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(); } -end_table(); -end_form(); -echo '
'; +inactive_control_row($th); +end_table(1); //---------------------------------------------------------------------------------- -start_form(); - -start_table("class='tablestyle_noborder'"); +start_table(TABLESTYLE2); if ($selected_id != '') { @@ -113,9 +130,8 @@ 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']); hidden('abbr', $_POST['abbr']); @@ -127,10 +143,9 @@ number_list_row(_("Decimal Places:"), 'decimals', null, 0, 6, _("User Quantity D end_table(1); -submit_add_or_update_center($selected_id == '', '', true); +submit_add_or_update_center($selected_id == '', '', 'both'); end_form(); end_page(); -?>