X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fui%2Fui_lists.inc;h=f271bb65679041028e16a0378f357eb12dd321e2;hb=3c4482206218de2faceeb2f6563c92f28e57db50;hp=a29dda765317e30b0fa476cd15a35a50a620e728;hpb=9879eeb19e7defd3fe9538c86b1d35122b00a1e0;p=fa-stable.git diff --git a/includes/ui/ui_lists.inc b/includes/ui/ui_lists.inc index a29dda76..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,14 +898,13 @@ 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) { - global $search_button; $edit_name = $name."_edit"; $edit_button = $name."_button"; @@ -938,9 +937,9 @@ function stock_purchasable_items_list($name, &$selected_id, $all_option=false, $ $result = false; } - echo " "; + echo " "; - echo sprintf($search_button, $edit_button); + echo " "; } else { @@ -1051,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"; @@ -1080,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); } @@ -1192,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"; } @@ -1297,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"; } @@ -1960,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"; }