include_once($path_to_root . "/includes/current_user.inc");
$_search_button = "<input %s type='submit' class='combo_submit' style='border:0;background:url($path_to_root/themes/"
include_once($path_to_root . "/includes/current_user.inc");
$_search_button = "<input %s type='submit' class='combo_submit' style='border:0;background:url($path_to_root/themes/"
'spec_option'=>false, // option text or false
'spec_id' => 0, // option id
// submit on select parameters
'spec_option'=>false, // option text or false
'spec_id' => 0, // option id
// submit on select parameters
'select_submit' => false, //submit on select: true/false
'async' => true, // select update via ajax (true) vs _page_body reload
// search box parameters
'select_submit' => false, //submit on select: true/false
'async' => true, // select update via ajax (true) vs _page_body reload
// search box parameters
'box_hint' => null // box/selectors hints; null = std see below
);
// ------ merge options with defaults ----------
'box_hint' => null // box/selectors hints; null = std see below
);
// ------ merge options with defaults ----------
if (!is_array($opts['where'])) $opts['where'] = array($opts['where']);
$search_box = $opts['search_box']===true ? '_'.$name.'_edit' : $opts['search_box'];
if (!is_array($opts['where'])) $opts['where'] = array($opts['where']);
$search_box = $opts['search_box']===true ? '_'.$name.'_edit' : $opts['search_box'];
($by_id ? _('Enter code fragment to search or * for all')
: _('Enter description fragment to search or * for all')) :'';
if ($selected_id == null) {
($by_id ? _('Enter code fragment to search or * for all')
: _('Enter description fragment to search or * for all')) :'';
if ($selected_id == null) {
$selector = "<select $disabled name='$name' class='$class' title='"
. $opts['sel_hint']."' $rel>".$selector."</select>\n";
$selector = "<select $disabled name='$name' class='$class' title='"
. $opts['sel_hint']."' $rel>".$selector."</select>\n";
'spec_id' => 0, // option id
'select_submit' => false, //submit on select: true/false
'async' => true, // select update via ajax (true) vs _page_body reload
'spec_id' => 0, // option id
'select_submit' => false, //submit on select: true/false
'async' => true, // select update via ajax (true) vs _page_body reload
$select_submit = $opts['select_submit']===true ? '_'.$name.'_update' : $opts['select_submit'];
$spec_id = $opts['spec_id'];
$spec_option = $opts['spec_option'];
$disabled = $opts['disabled'] ? "disabled" : '';
if ($selected_id == null) {
$select_submit = $opts['select_submit']===true ? '_'.$name.'_update' : $opts['select_submit'];
$spec_id = $opts['spec_id'];
$spec_option = $opts['spec_option'];
$disabled = $opts['disabled'] ? "disabled" : '';
if ($selected_id == null) {
$sql = "SELECT curr_abrev, currency FROM ".TB_PREF."currencies";
// default to the company currency
$sql = "SELECT curr_abrev, currency FROM ".TB_PREF."currencies";
// default to the company currency
return combo_input($name, $selected_id, $sql, 'curr_abrev', 'currency',
array(
'select_submit'=> $submit_on_change,
return combo_input($name, $selected_id, $sql, 'curr_abrev', 'currency',
array(
'select_submit'=> $submit_on_change,
-function currencies_list_cells($label, $name, $selected_id=null)
+function currencies_list_cells($label, $name, $selected_id=null, $submit_on_change=false)
-function currencies_list_row($label, $name, $selected_id=null)
+function currencies_list_row($label, $name, $selected_id=null, $submit_on_change=false)
- $str = currencies_list_cells($label, $name, $selected_id);
+ $str = currencies_list_cells($label, $name, $selected_id, $submit_on_change);
return combo_input($name, $selected_id, $sql, 'id', '',
array(
'order' => 'begin',
return combo_input($name, $selected_id, $sql, 'id', '',
array(
'order' => 'begin',
'format' => '_format_fiscalyears',
'select_submit'=> $submit_on_change,
'async' => false
'format' => '_format_fiscalyears',
'select_submit'=> $submit_on_change,
'async' => false
return combo_input($name, $selected_id, $sql, 'id', 'ref', $options);
}
return combo_input($name, $selected_id, $sql, 'id', 'ref', $options);
}
//-----------------------------------------------------------------------------------------------
function gl_all_accounts_list($name, $selected_id=null, $skip_bank_accounts=false,
//-----------------------------------------------------------------------------------------------
function gl_all_accounts_list($name, $selected_id=null, $skip_bank_accounts=false,
- $show_group=false, $cells=false, $all_option=false)
+ $show_group=false, $cells=false, $all_option=false, $submit_on_change=false)
return array_selector($name, $selected_id, $items,
array(
return array_selector($name, $selected_id, $items,
array(