fix for bug #660/2: lists selectbox gets only populated once

This commit is contained in:
Ralf Becker 2007-05-03 05:07:30 +00:00
parent 747da8fd79
commit 291aa0301a
2 changed files with 5 additions and 12 deletions

View File

@ -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);

View File

@ -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)
{