diff --git a/addressbook/inc/class.socontacts.inc.php b/addressbook/inc/class.socontacts.inc.php index 10773a487c..b79fc5e86f 100755 --- a/addressbook/inc/class.socontacts.inc.php +++ b/addressbook/inc/class.socontacts.inc.php @@ -894,10 +894,10 @@ class socontacts /** * Check if distribution lists are availible for a given addressbook * - * @param int/string $owner '' means all lists, which uses the main addressbook + * @param int/string $owner='' addressbook (eg. 0 = accounts), default '' = "all" addressbook (uses the main backend) * @return boolean */ - function lists_available($owner) + function lists_available($owner='') { $backend =& $this->get_backend(null,$owner); diff --git a/addressbook/inc/class.uicontacts.inc.php b/addressbook/inc/class.uicontacts.inc.php index 1bbb965365..d8c7a8a56b 100644 --- a/addressbook/inc/class.uicontacts.inc.php +++ b/addressbook/inc/class.uicontacts.inc.php @@ -176,23 +176,16 @@ class uicontacts extends bocontacts 'default_cols' => '!cat_id,contact_created_contact_modified', 'filter2_onchange' => "if(this.value=='add') { add_new_list(document.getElementById(form::name('filter')).value); this.value='';} else this.form.submit();", ); - // if the backend supports distribution lists - $sel_options['filter2'] = $this->get_lists(EGW_ACL_READ,array( - '' => lang('none'), - 'add' => lang('Add a new list').'...', - )); // use the state of the last session stored in the user prefs if (($state = @unserialize($this->prefs[$do_email ? 'email_state' : 'index_state']))) { $content['nm'] = array_merge($content['nm'],$state); } } - if (!$content['nm']['no_filter2'] && !isset($sel_options['filter2'])) + if ($this->lists_available()) { - $sel_options['filter2'] = $this->get_lists(EGW_ACL_READ,array( - '' => lang('Distribution lists').'...', - 'add' => lang('Add a new list').'...', - )); + $sel_options['filter2'] = $this->get_lists(EGW_ACL_READ,array('' => lang('none'))); + $sel_options['filter2']['add'] = lang('Add a new list').'...'; // put it at the end } if ($do_email) {