From f34041b922bf628f8264108c476ca061f4f18a32 Mon Sep 17 00:00:00 2001 From: Miles Lott Date: Tue, 19 Mar 2002 02:44:15 +0000 Subject: [PATCH] Allow admin to enable remote search (off by default) --- addressbook/inc/class.uiaddressbook.inc.php | 19 +++++++++++++------ addressbook/setup/phpgw_en.lang | 1 + addressbook/templates/default/config.tpl | 11 ++++++++++- addressbook/templates/default/form.tpl | 1 + addressbook/templates/default/index.tpl | 19 +++++++++++++++++-- 5 files changed, 42 insertions(+), 9 deletions(-) diff --git a/addressbook/inc/class.uiaddressbook.inc.php b/addressbook/inc/class.uiaddressbook.inc.php index 341a0ab597..710ae3f4a6 100644 --- a/addressbook/inc/class.uiaddressbook.inc.php +++ b/addressbook/inc/class.uiaddressbook.inc.php @@ -296,6 +296,7 @@ $this->template->set_block('addressbook_list_t','addressbook_header','addressbook_header'); $this->template->set_block('addressbook_list_t','column','column'); $this->template->set_block('addressbook_list_t','row','row'); + $this->template->set_block('addressbook_list_t','remsearch','remsearch'); $this->template->set_block('addressbook_list_t','addressbook_footer','addressbook_footer'); $customfields = $this->read_custom_fields(); @@ -472,8 +473,6 @@ $this->start, $total_records,'&menuaction=addressbook.uiaddressbook.index&fcat_id='.$this->cat_id,'75%', $GLOBALS['phpgw_info']['theme']['th_bg'],1,1,1,1,$this->cat_id); - $search_remote = $this->remote_search_option(); - $lang_showing = $GLOBALS['phpgw']->nextmatchs->show_hits($total_records,$this->start); /* set basic vars and parse the header */ @@ -486,12 +485,8 @@ $this->template->set_var('lang_go',lang('Go')); $this->template->set_var('searchreturn',$noprefs . ' ' . $searchreturn); - $this->template->set_var('remote_search',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.remote_search')); - $this->template->set_var('remote_query',$GLOBALS['HTTP_POST_VARS']['remote_query']); - $this->template->set_var('lang_remote_search',lang('Remote Search')); $this->template->set_var('lang_showing',$lang_showing); $this->template->set_var('search_filter',$search_filter); - $this->template->set_var('search_remote',$search_remote); $this->template->set_var('cats',lang('Category')); $this->template->set_var('cats_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index')); /* $this->template->set_var('cats_link',$this->cat_option($this->cat_id)); */ @@ -521,6 +516,18 @@ $this->template->set_var('qfield',$qfield); $this->template->set_var('cols',$cols); + if(@isset($GLOBALS['phpgw_info']['server']['enable_remote_addressbook'])) + { + $this->template->set_var('remote_search',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.remote_search')); + $this->template->set_var('remote_query',$GLOBALS['HTTP_POST_VARS']['remote_query']); + $this->template->set_var('lang_remote_search',lang('Remote Search')); + $this->template->set_var('search_remote',$this->remote_search_option()); + $this->template->fp('remotesearch','remsearch'); + } + else + { + $this->template->set_var('remotesearch',''); + } $this->template->pparse('out','addressbook_header'); /* Show the entries */ diff --git a/addressbook/setup/phpgw_en.lang b/addressbook/setup/phpgw_en.lang index d784b480c4..1221b2ceb0 100644 --- a/addressbook/setup/phpgw_en.lang +++ b/addressbook/setup/phpgw_en.lang @@ -40,6 +40,7 @@ department common en Department download export file (uncheck to debug output in browser) addressbook en Download export file (Uncheck to debug output in browser) edit custom field addressbook en Edit Custom Field edit custom fields admin en Edit Custom Fields +enable remote search admin en Enable remote search enter the path to the export file here addressbook en Enter the path to the exported file here export contacts addressbook en Export Contacts export file name addressbook en Export file name diff --git a/addressbook/templates/default/config.tpl b/addressbook/templates/default/config.tpl index bc5e84e4cf..b4980ecdca 100644 --- a/addressbook/templates/default/config.tpl +++ b/addressbook/templates/default/config.tpl @@ -2,7 +2,7 @@
- + @@ -44,6 +44,15 @@ + + + + diff --git a/addressbook/templates/default/form.tpl b/addressbook/templates/default/form.tpl index 2b41af2287..90f4d253f1 100755 --- a/addressbook/templates/default/form.tpl +++ b/addressbook/templates/default/form.tpl @@ -1,6 +1,7 @@
 {title} {title}
 {error}{lang_LDAP_root_pw_for_contacts}:
{lang_Enable_remote_search}: + +
+{search} diff --git a/addressbook/templates/default/index.tpl b/addressbook/templates/default/index.tpl index 233c4a738a..81bd72e583 100644 --- a/addressbook/templates/default/index.tpl +++ b/addressbook/templates/default/index.tpl @@ -1,8 +1,7 @@
{lang_addressbook}
{lang_showing} -
{searchreturn} -{search_filter} +
{searchreturn}{search_filter}{remotesearch}
{lang_personal}:
{cols} @@ -25,6 +24,22 @@ + +
{lang_view}
+ + + + + + + +
{lang_remote_search}: + +
+ +