X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;ds=inline;f=includes%2Fui%2Fui_lists.inc;h=ca85d26e74d9ae77e38d2a208b3b19433d9f5cc6;hb=f5a86be183c6023b189199c69ac409df1b7116df;hp=6e5bde4005f760cdc943c12c32211d3108c37f5e;hpb=e5f646ec41162ae13c3117e28d444658ec06dbf7;p=fa-stable.git diff --git a/includes/ui/ui_lists.inc b/includes/ui/ui_lists.inc index 6e5bde40..ca85d26e 100644 --- a/includes/ui/ui_lists.inc +++ b/includes/ui/ui_lists.inc @@ -1,2214 +1,2720 @@ . +***********************************************************************/ include_once($path_to_root . "/includes/banking.inc"); -include_once($path_to_root . "/includes/reserved.inc"); include_once($path_to_root . "/includes/types.inc"); +include_once($path_to_root . "/includes/current_user.inc"); + +define('SEARCH_BUTTON', " "); + +define('SELECT_BUTTON', " "); + +//---------------------------------------------------------------------------- +// Universal sql combo generator +// $sql must return selector values and selector texts in columns 0 & 1 +// Options are merged with defaults. + +function combo_input($name, $selected_id, $sql, $valfield, $namefield, + $options=null, $type=null) +{ +global $Ajax, $path_to_root, $SysPrefs ; + +$opts = array( // default options + 'where'=> array(), // additional constraints + 'order' => $namefield, // list sort order + // special option parameters + 'spec_option'=>false, // option text or false + 'spec_id' => 0, // option id + // submit on select parameters + 'default' => '', // default value when $_POST is not set + 'multi' => false, // multiple select + 'select_submit' => false, //submit on select: true/false + 'async' => true, // select update via ajax (true) vs _page_body reload + // search box parameters + 'sel_hint' => null, + 'search_box' => false, // name or true/false + 'type' => 0, // type of extended selector: + // 0 - with (optional) visible search box, search by fragment inside id + // 1 - with hidden search box, search by option text + // 2 - with (optional) visible search box, search by fragment at the start of id + // 3 - TODO reverse: box with hidden selector available via enter; this + // would be convenient for optional ad hoc adding of new item + 'search_submit' => true, //search submit button: true/false + 'size' => 8, // size and max of box tag + 'max' => 50, + 'height' => false, // number of lines in select box + 'cells' => false, // combo displayed as 2