*Calendar: Owner / participant no longer have automatically created account group lists offered in mailing list results

This commit is contained in:
nathangray 2020-09-03 13:26:41 -06:00
parent f3b7a2781b
commit 2afae1c0e3
2 changed files with 11 additions and 4 deletions

View File

@ -350,6 +350,12 @@ class calendar_bo
{ {
$list = $contacts_obj->read_list((int)$id); $list = $contacts_obj->read_list((int)$id);
if(!$list && $id < 0)
{
$list = array(
'list_name' => Link::title('api-accounts',$id) ?: Api\Accounts::username($id)
);
}
$data[] = array( $data[] = array(
'res_id' => $id, 'res_id' => $id,
'rights' => self::ACL_READ_FOR_PARTICIPANTS, 'rights' => self::ACL_READ_FOR_PARTICIPANTS,

View File

@ -207,12 +207,13 @@ class calendar_owner_etemplate_widget extends Etemplate\Widget\Taglist
switch ($type) switch ($type)
{ {
case 'l': case 'l':
// Include mailing lists // Include mailing lists, but not account groups
$lists = 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, $index) use($query) {
return (stripos($element, $query) !== false); return $index > 0 && (stripos($element, $query) !== false);
} },
ARRAY_FILTER_USE_BOTH
); );
foreach($lists as $list_id => $list) foreach($lists as $list_id => $list)
{ {