From 821f206962c1d69de97d9550d06f7ba1c5c0aea1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cornelius=20Wei=C3=9F?= Date: Wed, 5 Apr 2006 13:53:37 +0000 Subject: [PATCH] fix: advsearch in cat --- addressbook/inc/class.socontacts.inc.php | 4 ++++ addressbook/inc/class.uicontacts.inc.php | 1 + etemplate/inc/class.advancedsearch_widget.inc.php | 8 ++++---- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/addressbook/inc/class.socontacts.inc.php b/addressbook/inc/class.socontacts.inc.php index 6bac67aafe..29d0d59223 100755 --- a/addressbook/inc/class.socontacts.inc.php +++ b/addressbook/inc/class.socontacts.inc.php @@ -205,6 +205,10 @@ class socontacts function search($criteria,$only_keys=True,$order_by='',$extra_cols='',$wildcard='',$empty=False,$op='AND',$start=false,$filter=null,$join='',$need_full_no_count=false) { //echo 'socontacts::search->criteria:'; _debug_array($criteria); + // we can only deal with one category atm. + $criteria['cat_id'] = $criteria['cat_id'][0]; + if (empty($criteria['cat_id'])) unset($criteria['cat_id']); + // We just want to deal with generalized vars, to simpyfie porting of this code to so_sql later... $this->main_id = $this->somain->contacts_id; diff --git a/addressbook/inc/class.uicontacts.inc.php b/addressbook/inc/class.uicontacts.inc.php index 918c810562..7b807b8a65 100644 --- a/addressbook/inc/class.uicontacts.inc.php +++ b/addressbook/inc/class.uicontacts.inc.php @@ -299,6 +299,7 @@ class uicontacts extends bocontacts $GLOBALS['egw']->common->egw_exit(); } + $content['advs']['msg'] = lang('Please select only one category'); // This is no fun yet, as we dont have a sortorder in prefs now, AND as we are not able to sort within cf. // $prefs = $GLOBALS['egw']->preferences->read_repository(); // foreach($prefs['addressbook'] as $key => $value) diff --git a/etemplate/inc/class.advancedsearch_widget.inc.php b/etemplate/inc/class.advancedsearch_widget.inc.php index 7b114b3395..a06e852d5f 100644 --- a/etemplate/inc/class.advancedsearch_widget.inc.php +++ b/etemplate/inc/class.advancedsearch_widget.inc.php @@ -79,9 +79,9 @@ $tpl =& new etemplate; $tpl->init('*** generated advanced search widget','','',0,'',0,0); // make an empty template - if($extension_data['msg']) + if($extension_data['message']) { - $tpl->add_child($tpl,$msg = $tpl->empty_cell('label','msg',array( + $tpl->add_child($tpl,$message = $tpl->empty_cell('label','message',array( 'no_lang' => true, ))); } @@ -239,7 +239,7 @@ if($extension_data['actions'][$action]['type'] == 'button') { $result = $GLOBALS['egw']->session->appsession('advanced_search_result',$GLOBALS['egw_info']['flags']['currentapp']); - $extension_data['msg'] = ExecMethod2($extension_data['actions'][$action]['method'],$result); + $extension_data['message'] = ExecMethod2($extension_data['actions'][$action]['method'],$result); } } } @@ -251,7 +251,7 @@ if($extension_data['row_actions'][$action]['type'] == 'button') { $result = $GLOBALS['egw']->session->appsession('advanced_search_result',$GLOBALS['egw_info']['flags']['currentapp']); - $extension_data['msg'] = ExecMethod2($extension_data['row_actions'][$action]['method'],key($id)); + $extension_data['message'] = ExecMethod2($extension_data['row_actions'][$action]['method'],key($id)); } } }