Use user accounts when available over addressbook when expanding mailing lists

This commit is contained in:
nathangray 2016-09-01 09:26:56 -06:00
parent d4ce9fce91
commit b86dfa52bb
2 changed files with 13 additions and 2 deletions

View File

@ -390,7 +390,15 @@ class calendar_bo
}
foreach($lists as &$contact)
{
$contact = 'c'.$contact['id'];
// Check for user account
if (($account_id = $GLOBALS['egw']->accounts->name2id($contact['id'],'person_id')))
{
$contact = ''.$account_id;
}
else
{
$contact = 'c'.$contact['id'];
}
if ($ignore_acl || $this->check_perms(ACL::READ|self::ACL_READ_FOR_PARTICIPANTS|($use_freebusy?self::ACL_FREEBUSY:0),0,$contact))
{
if ($contact && !in_array($contact,$contact_list)) // already added?

View File

@ -440,7 +440,10 @@ class calendar_uiforms extends calendar_ui
{
foreach($this->bo->enum_mailing_list($participant) as $contact)
{
$event['participants'][$contact] = $event['participant_types']['c'][substr($contact,1)] =
// Mailing lists can contain users, so allow for that possibility
$_type = is_numeric($contact) ? '' : $contact[0];
$_uid = is_numeric($contact) ? $contact : substr($contact,1);
$event['participants'][$contact] = $event['participant_types'][$_type][$_uid] =
calendar_so::combine_status($status,$content['participants']['quantity'],$content['participants']['role']);
}
continue;