mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-02 20:19:27 +01:00
fix for bug #660/2: lists selectbox gets only populated once
This commit is contained in:
parent
747da8fd79
commit
291aa0301a
@ -894,10 +894,10 @@ class socontacts
|
|||||||
/**
|
/**
|
||||||
* Check if distribution lists are availible for a given addressbook
|
* 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
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
function lists_available($owner)
|
function lists_available($owner='')
|
||||||
{
|
{
|
||||||
$backend =& $this->get_backend(null,$owner);
|
$backend =& $this->get_backend(null,$owner);
|
||||||
|
|
||||||
|
@ -176,23 +176,16 @@ class uicontacts extends bocontacts
|
|||||||
'default_cols' => '!cat_id,contact_created_contact_modified',
|
'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();",
|
'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
|
// use the state of the last session stored in the user prefs
|
||||||
if (($state = @unserialize($this->prefs[$do_email ? 'email_state' : 'index_state'])))
|
if (($state = @unserialize($this->prefs[$do_email ? 'email_state' : 'index_state'])))
|
||||||
{
|
{
|
||||||
$content['nm'] = array_merge($content['nm'],$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(
|
$sel_options['filter2'] = $this->get_lists(EGW_ACL_READ,array('' => lang('none')));
|
||||||
'' => lang('Distribution lists').'...',
|
$sel_options['filter2']['add'] = lang('Add a new list').'...'; // put it at the end
|
||||||
'add' => lang('Add a new list').'...',
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
if ($do_email)
|
if ($do_email)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user