forked from extern/egroupware
Fix distribution lists calendars to work when first added from search results
This commit is contained in:
parent
ddde0022d3
commit
35eda073dd
@ -254,7 +254,7 @@ class calendar_bo
|
|||||||
$this->resources['l'] = array(
|
$this->resources['l'] = array(
|
||||||
'type' => 'l',// one char type-identifier for this resources
|
'type' => 'l',// one char type-identifier for this resources
|
||||||
'info' => __CLASS__ .'::mailing_lists',// info method, returns array with id, type & name for a given id
|
'info' => __CLASS__ .'::mailing_lists',// info method, returns array with id, type & name for a given id
|
||||||
'app' => 'Mailing list'
|
'app' => 'Distribution list'
|
||||||
);
|
);
|
||||||
$this->resources[''] = array(
|
$this->resources[''] = array(
|
||||||
'type' => '',
|
'type' => '',
|
||||||
|
@ -174,12 +174,19 @@ class calendar_owner_etemplate_widget extends Etemplate\Widget\Taglist
|
|||||||
{
|
{
|
||||||
// Include mailing lists
|
// Include mailing lists
|
||||||
$contacts_obj = new Api\Contacts();
|
$contacts_obj = new Api\Contacts();
|
||||||
$_results += array_filter(
|
$lists = array_filter(
|
||||||
$contacts_obj->get_lists(Api\Acl::READ),
|
$contacts_obj->get_lists(Api\Acl::READ),
|
||||||
function($element) use($query) {
|
function($element) use($query) {
|
||||||
return (stripos($element, $query) !== false);
|
return (stripos($element, $query) !== false);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
foreach($lists as $list_id => $list)
|
||||||
|
{
|
||||||
|
$_results[$list_id] = array(
|
||||||
|
'label' => $list,
|
||||||
|
'resources' => $bo->enum_mailing_list($type.$list_id)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(!$_results)
|
if(!$_results)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user