X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fui%2Fui_lists.inc;h=e46fe645993dbf01ef29eacb2b98d8445ccebc69;hb=99730b8d6deb7e81d2f1ebeb2ce7066d27729485;hp=51b0e956a4fe93f4dd687e125dfcc61cdee2e546;hpb=9bade0e4e3c5c6c020c5c8c7d8933008e5f5b1fe;p=fa-stable.git diff --git a/includes/ui/ui_lists.inc b/includes/ui/ui_lists.inc index 51b0e956..e46fe645 100644 --- a/includes/ui/ui_lists.inc +++ b/includes/ui/ui_lists.inc @@ -66,7 +66,7 @@ $opts = array( // default options } if ($opts['sel_hint'] === null) $opts['sel_hint'] = $by_id || $search_box==false ? - '' : _('Press Space tab for search pattern entry'); + '' : _('Press Space tab for search pattern entry'); if ($opts['box_hint'] === null) $opts['box_hint'] = $search_box ? @@ -100,16 +100,16 @@ $opts = array( // default options } if ($txt == '') { if ($spec_option === false) - $limit = ' LIMIT 1'; + $limit = ' LIMIT 1'; else - $opts['where'][] = $valfield . "='". get_post($name, $spec_id)."'"; + $opts['where'][] = $valfield . "='". get_post($name, $spec_id)."'"; } else if ($txt != '*') { foreach($opts['search'] as $i=> $s) $opts['search'][$i] = $s . " LIKE '%{$txt}%'"; - $opts['where'][] = '('. implode($opts['search'], ' OR ') . ')'; + $opts['where'][] = '('. implode($opts['search'], ' OR ') . ')'; } } } @@ -539,7 +539,7 @@ function stock_items_list_cells($label, $name, $selected_id, $all_option=false, if ($label != null) echo "$label\n"; $str = stock_items_list($name, $selected_id, $all_option, $submit_on_change, - array('cells'=>true)); + array('cells'=>true)); return $str; } /* @@ -717,8 +717,6 @@ function stock_item_types_list_row($label, $name, $selected_id, $enabled=true) function stock_units_list_row($label, $name, $value, $enabled=true) { - global $stock_units; - default_focus($name); $result = get_all_item_units(); echo "$label\n"; @@ -753,8 +751,6 @@ function stock_units_list_row($label, $name, $value, $enabled=true) function tax_types_list($name, $selected_id, $none_option=false, $submit_on_change=false) { - global $all_items; - $sql = "SELECT id, CONCAT(name, ' (',rate,'%)') as name FROM ".TB_PREF."tax_types"; return combo_input($name, $selected_id, $sql, 'id', 'name', @@ -791,8 +787,6 @@ function tax_types_list_row($label, $name, $selected_id, $none_option=false, function tax_groups_list($name, $selected_id, $none_option=false, $submit_on_change=false) { - global $all_items; - $sql = "SELECT id, name FROM ".TB_PREF."tax_groups"; return combo_input($name, $selected_id, $sql, 'id', 'name', @@ -995,8 +989,6 @@ function credit_status_list_row($label, $name, $selected_id) function sales_types_list($name, $selected_id, $submit_on_change=false, $special_option=false) { - global $all_items; - $sql = "SELECT id, sales_type FROM ".TB_PREF."sales_types"; return combo_input($name, $selected_id, $sql, 'id', 'sales_type', @@ -1818,47 +1810,55 @@ function credit_type_list_row($label, $name, $selected, $submit_on_change=false) return $str; } -function number_list($name, $selected, $from, $to, $firstlabel="") +function number_list($name, $selected, $from, $to, $no_option=false) { default_focus($name); if ($selected == null) { - $selected = (!isset($_POST[$name]) ? $from : $_POST[$name]); - if ($selected == $from) - $_POST[$name] = $selected; + $selected = (!isset($_POST[$name]) ? reserved_words::get_all_numeric() : $_POST[$name]); } echo "\n"; } -function number_list_cells($label, $name, $selected, $from, $to) +function number_list_cells($label, $name, $selected, $from, $to, $no_option=false) { if ($label != null) label_cell($label); echo "\n"; - number_list($name, $selected, $from, $to); + number_list($name, $selected, $from, $to, $no_option); echo "\n"; } -function number_list_row($label, $name, $selected, $from, $to) +function number_list_row($label, $name, $selected, $from, $to, $no_option=false) { echo "\n"; - number_list_cells($label, $name, $selected, $from, $to); + number_list_cells($label, $name, $selected, $from, $to, $no_option); echo "\n"; } ?> \ No newline at end of file