mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-29 11:23:54 +01:00
* CalDAV/Calendar: store and therefore keep external organizer if he has no common name (just email) and also store its common name
This commit is contained in:
parent
77dbee8aff
commit
3a901f8196
@ -263,7 +263,7 @@ class calendar_bo
|
||||
{
|
||||
$email = $id;
|
||||
$name = '';
|
||||
if (preg_match('/^(.*) *<([a-z0-9_.@-]{8,})>$/i',$email,$matches))
|
||||
if (preg_match('/^(.*) *<([a-z0-9_.@-]{8,})>$/iU',$email,$matches))
|
||||
{
|
||||
$name = $matches[1];
|
||||
$email = $matches[2];
|
||||
@ -1477,7 +1477,7 @@ class calendar_bo
|
||||
$id2email[$id] = $GLOBALS['egw']->accounts->id2name($id,'account_email');
|
||||
}
|
||||
}
|
||||
return $id2lid[$id].($append_email && $id2email[$id] ? ' <'.$id2email[$id].'>' : '');
|
||||
return $id2lid[$id].(($append_email || $id[0] == 'e') && $id2email[$id] ? ' <'.$id2email[$id].'>' : '');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -530,7 +530,7 @@ class calendar_ical extends calendar_boupdate
|
||||
break;
|
||||
|
||||
case 'ORGANIZER':
|
||||
if (!$organizerCN)
|
||||
if (!$organizerURL)
|
||||
{
|
||||
$organizerCN = '"' . trim($GLOBALS['egw']->accounts->id2name($event['owner'],'account_firstname')
|
||||
. ' ' . $GLOBALS['egw']->accounts->id2name($event['owner'],'account_lastname')) . '"';
|
||||
@ -2675,8 +2675,15 @@ class calendar_ical extends calendar_boupdate
|
||||
{
|
||||
$role = $attributes['params']['ROLE'];
|
||||
}
|
||||
// parse email and cn from attendee
|
||||
if (preg_match('/MAILTO:([@.a-z0-9_-]+)|MAILTO:"?([.a-z0-9_ -]*)"?[ ]*<([@.a-z0-9_-]*)>/i',
|
||||
// CN explicit given --> use it
|
||||
if (strtoupper(substr($attributes['value'], 0, 7)) == 'MAILTO:' &&
|
||||
!empty($attributes['params']['CN']))
|
||||
{
|
||||
$email = substr($attributes['value'], 7);
|
||||
$cn = $attributes['params']['CN'];
|
||||
}
|
||||
// try parsing email and cn from attendee
|
||||
elseif (preg_match('/MAILTO:([@.a-z0-9_-]+)|MAILTO:"?([.a-z0-9_ -]*)"?[ ]*<([@.a-z0-9_-]*)>/i',
|
||||
$attributes['value'],$matches))
|
||||
{
|
||||
$email = $matches[1] ? $matches[1] : $matches[3];
|
||||
@ -2715,7 +2722,7 @@ class calendar_ical extends calendar_boupdate
|
||||
$uid = $this->user;
|
||||
}
|
||||
// check principal url from CalDAV here after X-EGROUPWARE-UID and to get optional X-EGROUPWARE-QUANTITY
|
||||
if (!$uid) $uid = groupdav_principals::url2uid($attributes['value']);
|
||||
if (!$uid) $uid = groupdav_principals::url2uid($attributes['value'], null, $cn);
|
||||
|
||||
// try to find an email address
|
||||
if (!$uid && $email && ($uid = $GLOBALS['egw']->accounts->name2id($email, 'account_email')))
|
||||
|
@ -848,6 +848,10 @@ class calendar_uiforms extends calendar_ui
|
||||
}
|
||||
elseif (($info = $this->bo->resource_info($uid)))
|
||||
{
|
||||
if ($uid[0] == 'e' && $info['name'] && $info['name'] != $info['email'])
|
||||
{
|
||||
return $info['name'].' <'.$info['email'].'>';
|
||||
}
|
||||
return $info['name'] ? $info['name'] : $info['email'];
|
||||
}
|
||||
return '#'.$uid;
|
||||
|
Loading…
Reference in New Issue
Block a user