diff options
Diffstat (limited to 'program/steps/addressbook')
-rw-r--r-- | program/steps/addressbook/func.inc | 23 | ||||
-rw-r--r-- | program/steps/addressbook/list.inc | 4 |
2 files changed, 18 insertions, 9 deletions
diff --git a/program/steps/addressbook/func.inc b/program/steps/addressbook/func.inc index df86fced2..62fde971c 100644 --- a/program/steps/addressbook/func.inc +++ b/program/steps/addressbook/func.inc @@ -21,15 +21,21 @@ $SEARCH_MODS_DEFAULT = array('name'=>1, 'firstname'=>1, 'surname'=>1, 'email'=>1, '*'=>1); -// add list of address sources to client env -$js_list = $RCMAIL->get_address_sources(); - // select source $source = get_input_value('_source', RCUBE_INPUT_GPC); -// if source is not set use first directory -if (empty($source)) - $source = $js_list[key($js_list)]['id']; +if (!$RCMAIL->action && !$OUTPUT->ajax_call) { + // add list of address sources to client env + $js_list = $RCMAIL->get_address_sources(); + + // if source is not set use first directory + if (empty($source)) + $source = $js_list[key($js_list)]['id']; + + $search_mods = $RCMAIL->config->get('addressbook_search_mods', $SEARCH_MODS_DEFAULT); + $OUTPUT->set_env('search_mods', $search_mods); + $OUTPUT->set_env('address_sources', $js_list); +} // instantiate a contacts object according to the given source $CONTACTS = $RCMAIL->get_address_book($source); @@ -44,18 +50,17 @@ else if (!empty($_REQUEST['_gid'])) $CONTACTS->set_group(get_input_value('_gid', RCUBE_INPUT_GPC)); - +/* // set message set for search result if (!empty($_REQUEST['_search']) && isset($_SESSION['search'][$_REQUEST['_search']])) $CONTACTS->set_search_set($_SESSION['search'][$_REQUEST['_search']]); - +*/ // set data source env $OUTPUT->set_env('source', $source ? $source : '0'); $OUTPUT->set_env('readonly', $CONTACTS->readonly, false); if (!$OUTPUT->ajax_call) { $search_mods = $RCMAIL->config->get('addressbook_search_mods', $SEARCH_MODS_DEFAULT); $OUTPUT->set_env('search_mods', $search_mods); - $OUTPUT->set_env('address_sources', $js_list); $OUTPUT->set_pagetitle(rcube_label('addressbook')); } diff --git a/program/steps/addressbook/list.inc b/program/steps/addressbook/list.inc index 0eb4b806a..864ad939b 100644 --- a/program/steps/addressbook/list.inc +++ b/program/steps/addressbook/list.inc @@ -19,6 +19,10 @@ */ +// set message set for search result +if (!empty($_REQUEST['_search']) && isset($_SESSION['search'][$_REQUEST['_search']])) + $CONTACTS->set_search_set($_SESSION['search'][$_REQUEST['_search']]); + // get contacts for this user $result = $CONTACTS->list_records(array('name')); |