* Calendar: Put email address after user or contact

See ticket #80674
This commit is contained in:
nathan 2023-05-02 10:57:42 -06:00
parent 8e8c664e95
commit 9033299d76

View File

@ -308,8 +308,16 @@ class calendar_owner_etemplate_widget extends Etemplate\Widget\Taglist
$value = array(
'value' => substr($id, 0, 1) == $type ? $id : $type . $id,
'label' => $title,
'app' => $data['app']
'app' => $data['app']
);
if(isset($data['info']))
{
$info = ExecMethod($data['info'], $id);
if(count($info) > 0)
{
$value = array_merge($value, array_pop($info));
}
}
if(is_array($value['label']))
{
$value = array_merge($value, $value['label']);
@ -342,6 +350,12 @@ class calendar_owner_etemplate_widget extends Etemplate\Widget\Taglist
$value['fname'] = $contact['n_given'];
}
}
// Add email
if(isset($value['email']) || isset($contact['email']) || isset($contact['email_home']))
{
$email = \EGroupware\Api\Mail::stripRFC822Addresses(array($value['email'] ?: $contact['email'] ?: $contact['email_home']));
$value['label'] .= $email ? (' <' . $email[0] . '>') : "";
}
if($id < 0)
{
$value['resources'] = array_map('strval', $GLOBALS['egw']->accounts->members($id, true));