X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fui%2Fui_lists.inc;h=5b6387f644dc4fe37eabdf5f10903ee99f1ed90e;hb=8f6852edc4c77026234c05c20235c8fe00f59631;hp=7c31bd692e85b2b804979a41f8723ab17bb103a0;hpb=7792e42d75607b7e2dbaf73c318b8b7d9367dd17;p=fa-stable.git diff --git a/includes/ui/ui_lists.inc b/includes/ui/ui_lists.inc index 7c31bd69..5b6387f6 100644 --- a/includes/ui/ui_lists.inc +++ b/includes/ui/ui_lists.inc @@ -1,2207 +1,2723 @@ . +***********************************************************************/ include_once($path_to_root . "/includes/banking.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