X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=inventory%2Fmanage%2Fitem_units.php;h=b8e432bc54f439ed20bb16d2e2d82f793da1f4e3;hb=ec44f448dbcfc82df87de4fd658b254670fad113;hp=e5a72f95bd982f7480d5f3050949cef90df7557f;hpb=d7dde51cf888dfc7e049fefed38e786a369b9b38;p=fa-stable.git diff --git a/inventory/manage/item_units.php b/inventory/manage/item_units.php index e5a72f95..b8e432bc 100644 --- a/inventory/manage/item_units.php +++ b/inventory/manage/item_units.php @@ -1,5 +1,4 @@ '; //---------------------------------------------------------------------------------- -hyperlink_no_params($_SERVER['PHP_SELF'], _("New Unit of Measure")); - start_form(); start_table("class='tablestyle_noborder'"); -if (isset($selected_id)) +if ($selected_id != '') { - //editing an existing item category + if ($Mode == 'Edit') { + //editing an existing item category - $myrow = get_item_unit($selected_id); - - $_POST['abbr'] = $myrow["abbr"]; - $_POST['description'] = $myrow["name"]; - $_POST['decimals'] = $myrow["decimals"]; + $myrow = get_item_unit($selected_id); + $_POST['abbr'] = $myrow["abbr"]; + $_POST['description'] = $myrow["name"]; + $_POST['decimals'] = $myrow["decimals"]; + } hidden('selected_id', $selected_id); } - -if (isset($selected_id) && item_unit_used($selected_id)) { +if ($selected_id != '' && item_unit_used($selected_id)) { label_row(_("Unit Abbreviation:"), $_POST['abbr']); hidden('abbr', $_POST['abbr']); } else @@ -122,7 +125,7 @@ number_list_row(_("Decimal Places:"), 'decimals', null, 0, 6, _("User Quantity D end_table(1); -submit_add_or_update_center(!isset($selected_id)); +submit_add_or_update_center($selected_id == '', '', true); end_form();