X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fui%2Fui_lists.inc;h=f271bb65679041028e16a0378f357eb12dd321e2;hb=f63c58475b057c9f4a05894a6935ea351b6d7af3;hp=b75d66c8af1c313aae9d6e0175d1bc857990b381;hpb=4def49c9e0be02ccdf814188c2a72ebd969a7a98;p=fa-stable.git diff --git a/includes/ui/ui_lists.inc b/includes/ui/ui_lists.inc index b75d66c8..f271bb65 100644 --- a/includes/ui/ui_lists.inc +++ b/includes/ui/ui_lists.inc @@ -13,11 +13,11 @@ $all_items = reserved_words::get_all(); function supplier_list($name, $selected_id, $all_option=false, $submit_on_change=false) { - global $no_supplier_list, $all_items; + global $all_items; if ($selected_id == null) $selected_id = ((!isset($_POST[$name]) || $_POST[$name] == "") ? "" : $_POST[$name]); - + $no_supplier_list = get_company_pref('no_supplier_list'); if ($no_supplier_list) { global $search_button; @@ -127,11 +127,11 @@ function supplier_list_row($label, $name, $selected_id, $all_option=false, $subm function customer_list($name, $selected_id, $all_option=false, $submit_on_change=false) { - global $no_customer_list, $all_items; + global $all_items; if ($selected_id == null) $selected_id = ((!isset($_POST[$name]) || $_POST[$name] == "") ? "" : $_POST[$name]); - + $no_customer_list = get_company_pref('no_customer_list'); if ($no_customer_list) { global $search_button; @@ -606,11 +606,11 @@ function dimensions_list_row($label, $name, $selected_id, $no_option=false, $sho function stock_items_list($name, $selected_id, $all_option=false, $submit_on_change=false, $extra="") { - global $all_items, $no_item_list; + global $all_items; if ($selected_id == null) $selected_id = (!isset($_POST[$name]) ? "" : $_POST[$name]); - + $no_item_list = get_company_pref('no_item_list'); if ($no_item_list) { global $search_button; @@ -898,11 +898,11 @@ function stock_component_items_list($name, $parent_stock_id, &$selected_id, function stock_purchasable_items_list($name, &$selected_id, $all_option=false, $submit_on_change=false, $extra="") { - global $no_item_list, $all_items; + global $all_items; if ($selected_id == null) $selected_id = (!isset($_POST[$name]) ? "" : $_POST[$name]); - + $no_item_list = get_company_pref('no_item_list'); if ($no_item_list) { $edit_name = $name."_edit"; @@ -1050,6 +1050,7 @@ function stock_units_list_row($label, $name, $value, $enabled=true) { global $stock_units; + $result = get_all_item_units(); echo "$label\n"; if ($enabled) echo "\n"; @@ -1079,7 +1083,7 @@ function stock_units_list_row($label, $name, $value, $enabled=true) function tax_types_list($name, $selected_id, $none_option=false, $none_option_name=null, $submit_on_change=false) { - simple_codeandname_list("SELECT id, name FROM ".TB_PREF."tax_types", + simple_codeandname_list("SELECT id, CONCAT(name, ' (',rate,'%)') as name FROM ".TB_PREF."tax_types", $name, $selected_id, $none_option, $none_option_name, true, $submit_on_change); } @@ -1191,10 +1195,10 @@ function sales_persons_list_cells($label, $name, $selected_id) echo "\n"; } -function sales_persons_list_row($label, $name, $selected_id) +function sales_persons_list_row($label, $name, $selected_id, $submit_on_change=false) { echo "\n"; - sales_persons_list_cells($label, $name, $selected_id); + sales_persons_list_cells($label, $name, $selected_id, $submit_on_change=false); echo "\n"; } @@ -1296,25 +1300,25 @@ function credit_status_list_row($label, $name, $selected_id) //----------------------------------------------------------------------------------------------- -function sales_types_list($name, $selected_id) +function sales_types_list($name, $selected_id, $submit_on_change=false) { simple_codeandname_list("SELECT id, sales_type FROM ".TB_PREF."sales_types", - $name, $selected_id); + $name, $selected_id, false, null, false, $submit_on_change); } -function sales_types_list_cells($label, $name, $selected_id) +function sales_types_list_cells($label, $name, $selected_id, $submit_on_change=false) { if ($label != null) echo "$label\n"; echo ""; - sales_types_list($name, $selected_id); + sales_types_list($name, $selected_id, $submit_on_change); echo "\n"; } -function sales_types_list_row($label, $name, $selected_id) +function sales_types_list_row($label, $name, $selected_id, $submit_on_change=false) { echo "\n"; - sales_types_list_cells($label, $name, $selected_id); + sales_types_list_cells($label, $name, $selected_id, $submit_on_change); echo "\n"; } @@ -1959,8 +1963,17 @@ function decseps_list_row($label, $name, $value) function themes_list_row($label, $name, $value) { - global $themes; - + global $path_to_root; + + $path = $path_to_root.'/themes/'; + $themes = array(); + $themedir = opendir($path); + while(false !== ($fname = readdir($themedir))) { + if($fname!='.' && $fname!='..' && $fname!='CVS' && is_dir($path.$fname)) { + $themes[] = $fname; + } + } + sort($themes); echo "$label\n"; echo "\n"; }