From cc0705e83a4b5f8e8b2d7d55bf869c8ef434d657 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cornelius=20Wei=C3=9F?= Date: Tue, 24 Oct 2006 20:12:33 +0000 Subject: [PATCH] cleanup --- .../inc/class.advancedsearch_widget.inc.php | 15 ++++- etemplate/inc/class.nextmatch_widget.inc.php | 57 ------------------- 2 files changed, 14 insertions(+), 58 deletions(-) diff --git a/etemplate/inc/class.advancedsearch_widget.inc.php b/etemplate/inc/class.advancedsearch_widget.inc.php index eb54b20330..d1e2304e24 100644 --- a/etemplate/inc/class.advancedsearch_widget.inc.php +++ b/etemplate/inc/class.advancedsearch_widget.inc.php @@ -6,6 +6,8 @@ * @package etemplate * @link http://www.egroupware.org * @author Cornelius Weiss + * @deprecated Don't use any more, this will be removed after 1.4 release. + * Please manage advanced searches in you app! * @version $Id$ */ @@ -52,6 +54,7 @@ */ function advancedsearch_widget($ui='') { + error_log(__LINE__. __FILE__. "@deprecated Don't use any more, this will be removed after 1.4 release. Please manage advanced searches in you app! "); } /** @@ -158,7 +161,9 @@ else { $GLOBALS['egw_info']['etemplate']['advanced_search'] = true; - $tpl->add_child($tpl, $search_template = $tpl->empty_cell('template',$extension_data['input_template'])); + $GLOBALS['egw_info']['flags']['include_xajax'] = true; + + //$tpl->add_child($tpl, $search_template = $tpl->empty_cell('template',$extension_data['input_template'])); $button_box = $tpl->empty_cell('hbox','button_box'); $tpl->add_child($tpl, $button_box); $tpl->add_child($button_box, $op_select = $tpl->empty_cell('select','opt_select',array( @@ -177,8 +182,16 @@ 'no_lang' => true, 'default' => '%', ))); + $prefix = $extension_data['prefix']; $tpl->add_child($button_box, $search_button = $tpl->empty_cell('button','button[search]',array( 'label' => 'Search', + 'onclick' => " + var fromobj = document.getElementsByName('eTemplate'); + opener.document.getElementById('exec[$prefix][search]').value=xajax.getFormValues(fromobj[0])+xajax.getFormValues(this.form); + opener.document.getElementById('exec[$prefix][start_search]').form.submit() + opener.document.getElementById('exec[$prefix][search]').value=''; + return false; + ", ))); } $cell['size'] = $cell['name']; diff --git a/etemplate/inc/class.nextmatch_widget.inc.php b/etemplate/inc/class.nextmatch_widget.inc.php index fbcd5e3920..4058e08c47 100644 --- a/etemplate/inc/class.nextmatch_widget.inc.php +++ b/etemplate/inc/class.nextmatch_widget.inc.php @@ -31,8 +31,6 @@ * 'never_hide' => True// I never hide the nextmatch-line if less then maxmatch entries * 'lettersearch' => True// I show a lettersearch * 'searchletter' => // I0 active letter of the lettersearch or false for [all] - * 'advsearch_dlg' => // I function that returns complete html dialog app.class.function - * 'advsearch_cont => // 0 content from advanced_search dialog * 'start' => // IO position in list * 'num_rows' => // IO number of rows to show, defaults to maxmatches from the general prefs * 'cat_id' => // IO category, if not 'no_cat' => True @@ -64,7 +62,6 @@ var $public_functions = array( 'pre_process' => True, 'post_process' => True, - 'open_advsearch' => True, ); /** * availible extensions and there names for the editor @@ -500,58 +497,4 @@ } return True; } - - /** - * Show an advancedsearch dialog (as popup) - * @abstract This function is a wrapper for an advanced search dialog. - * It "just" manages the communication with the next match template AND - * showes the Search buttons. - * - * @param string $_function Name of function that returns complete html dialog app.class.method - * @param string $_prefix name of opening nextmatch template e.g. 'nm' - */ - function open_advsearch( $_function, $_prefix ) { - $function = $_function ? $_function : $_GET['function'] ? $_GET['function'] : false; - $prefix = $_prefix ? $_prefix : $_GET['prefix'] ? $_GET['prefix'] : false; - if (!$function || !$prefix) { - die("Error: No function name given!"); - } - - - $GLOBALS['egw_info']['flags']['include_xajax'] = true; - ExecMethod2($function); - - $tpl =& new etemplate; - $tpl->init('*** generated advanced search widget','','',0,'',0,0); // make an empty template - $tpl->add_child($tpl, $search_template = $tpl->empty_cell('template',$extension_data['input_template'])); - $button_box = $tpl->empty_cell('hbox','button_box'); - $tpl->add_child($tpl, $button_box); - $tpl->add_child($button_box, $op_select = $tpl->empty_cell('select','opt_select',array( - 'sel_options' => array( - 'OR' => 'OR', - 'AND' => 'AND' - ), - 'label' => 'Operator', - 'no_lang' => true, - ))); - $tpl->add_child($button_box, $meth_select = $tpl->empty_cell('select','meth_select',array( - 'sel_options' => array( - '%' => lang('contains'), - false => lang('exact'), - ), - 'no_lang' => true, - 'default' => '%', - ))); - $tpl->add_child($button_box, $search_button = $tpl->empty_cell('button','button[search]',array( - 'label' => 'Search', - 'onclick' => " - var fromobj = document.getElementsByName('eTemplate'); - opener.document.getElementById('exec[$prefix][search]').value=xajax.getFormValues(fromobj[0])+xajax.getFormValues(this.form); - opener.document.getElementById('exec[$prefix][start_search]').form.submit() - opener.document.getElementById('exec[$prefix][search]').value=''; - return false; - ", - ))); - echo $tpl->exec('','','','','',1); - } }