From 02e49d757dc1f8a46258df7c77714d2b75554a83 Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Tue, 17 Mar 2009 20:21:44 +0000 Subject: [PATCH] Stock item types moved to types.inc --- includes/types.inc | 7 ++++++- includes/ui/ui_lists.inc | 23 +++++++++++------------ 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/includes/types.inc b/includes/types.inc index d4f3c4a1..f1db9b1b 100644 --- a/includes/types.inc +++ b/includes/types.inc @@ -337,6 +337,11 @@ $quick_entry_types = array( QE_SUPPINV => _("Supplier Invoice/Credit") ); - +// Types of stock items +$stock_types = array( + 'M' => _("Manufactured"), + 'B' => _("Purchased"), + 'D' => _("Service") +); ?> \ No newline at end of file diff --git a/includes/ui/ui_lists.inc b/includes/ui/ui_lists.inc index 87526293..a44a115e 100644 --- a/includes/ui/ui_lists.inc +++ b/includes/ui/ui_lists.inc @@ -897,18 +897,14 @@ function stock_purchasable_items_list_row($label, $name, $selected_id=null, function stock_item_types_list_row($label, $name, $selected_id=null, $enabled=true) { - $types = array( - 'M' => _("Manufactured"), - 'B' => _("Purchased"), - 'D' => _("Service") - ); + global $stock_types; echo ""; if ($label != null) echo "$label\n"; echo ""; - array_selector($name, $selected_id, $types, + array_selector($name, $selected_id, $stock_types, array( 'select_submit'=> true, 'disabled' => !$enabled) ); @@ -1481,26 +1477,29 @@ function class_list_row($label, $name, $selected_id=null, $submit_on_change=fals //----------------------------------------------------------------------------------------------- -function stock_categories_list($name, $selected_id=null) +function stock_categories_list($name, $selected_id=null, $submit_on_change=false) { $sql = "SELECT category_id, description FROM ".TB_PREF."stock_category"; combo_input($name, $selected_id, $sql, 'category_id', 'description', - array('order'=>'category_id')); + array('order'=>'category_id', + 'select_submit'=> $submit_on_change, + 'async' => true + )); } -function stock_categories_list_cells($label, $name, $selected_id=null) +function stock_categories_list_cells($label, $name, $selected_id=null, $submit_on_change=false) { if ($label != null) echo "$label\n"; echo ""; - stock_categories_list($name, $selected_id); + stock_categories_list($name, $selected_id, $submit_on_change); echo "\n"; } -function stock_categories_list_row($label, $name, $selected_id=null) +function stock_categories_list_row($label, $name, $selected_id=null, $submit_on_change=false) { echo "\n"; - stock_categories_list_cells($label, $name, $selected_id); + stock_categories_list_cells($label, $name, $selected_id, $submit_on_change); echo "\n"; } -- 2.30.2