X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fui%2Fui_lists.inc;h=6170e79f41496303cda59347fc4fd520a38bb721;hb=cfaa5cec1f5137bcc1599a4306879e3265d1dacd;hp=f604f69a6a190ad25f213a01d14a2bcd8666c8c9;hpb=5e63c6ace55729bbb5ee3b060035a25a4426eb0a;p=fa-stable.git diff --git a/includes/ui/ui_lists.inc b/includes/ui/ui_lists.inc index f604f69a..6170e79f 100644 --- a/includes/ui/ui_lists.inc +++ b/includes/ui/ui_lists.inc @@ -212,11 +212,15 @@ $opts = array( // default options } $cat = $contact_row[$opts['category']]; if ($opts['category'] !== false && $cat != $lastcat){ + if ($lastcat!==null) + $selector .= ""; $selector .= "\n"; $lastcat = $cat; } $selector .= "\n"; } + if ($lastcat!==null) + $selector .= ""; db_free_result($result); } @@ -364,7 +368,6 @@ $opts = array( // default options if ($first_id!==false) { $sel = ($found===$first_id) || ($found===false && ($spec_option===false)) ? "selected='selected'" : ''; - $selector = sprintf($first_opt, $sel).$selector; } // Prepend special option. if ($spec_option !== false) { // if special option used - add it @@ -1309,29 +1312,6 @@ function sales_types_list_row($label, $name, $selected_id=null, $submit_on_chang //----------------------------------------------------------------------------------------------- -function movement_types_list($name, $selected_id=null) -{ - $sql = "SELECT id, name FROM ".TB_PREF."movement_types"; - return combo_input($name, $selected_id, $sql, 'id', 'name', array()); -} - -function movement_types_list_cells($label, $name, $selected_id=null) -{ - if ($label != null) - echo "$label\n"; - echo ""; - echo movement_types_list($name, $selected_id); - echo "\n"; -} - -function movement_types_list_row($label, $name, $selected_id=null) -{ - echo "$label"; - movement_types_list_cells(null, $name, $selected_id); - echo "\n"; -} - -//----------------------------------------------------------------------------------------------- function _format_date($row) { return sql2date($row['reconciled']); @@ -2444,3 +2424,24 @@ function accounts_type_list_row($label, $name, $selected_id=null) echo "\n"; } +function users_list_cells($label, $name, $selected_id=null, $submit_on_change=false, $spec_opt=true) +{ + $where = false; + $sql = " SELECT user_id, real_name FROM ".TB_PREF."users"; + + if ($label != null) + echo "$label\n"; + echo ""; + + echo combo_input($name, $selected_id, $sql, 'user_id', 'real_name', + array( + 'spec_option' => $spec_opt===true ?_("All users") : $spec_opt, + 'spec_id' => '', + 'order' => 'real_name', + 'select_submit'=> $submit_on_change, + 'async' => false + ) ); + echo ""; + +} +