Calendar: Add videoconference link to ical/groupdav event description

This commit is contained in:
nathangray 2020-06-09 10:26:59 -06:00
parent ba6d379287
commit 634eee092b
2 changed files with 24 additions and 3 deletions

View File

@ -677,6 +677,20 @@ class calendar_groupdav extends Api\CalDAV\Handler
//error_log(__METHOD__.'('.array2string($event).", $user) clearing alarms");
$event['alarm'] = array();
}
else if ($event['##videoconference'])
{
// Add video conference link to description for user's own calendar
$avatar = new Api\Contacts\Photo("account:$user",
// disable sharing links currently, as sharing links from a different EGroupware user destroy the session
true);
$link = EGroupware\Status\Videoconference\Call::genMeetingUrl($event['##videoconference'], [
'name' => Api\Accounts::username($user),
'email' => Api\Accounts::id2name($user, 'account_email'),
'avatar' => (string)$avatar,
'account_id' => $user
], [], $event['start_date'], $event['end_date']);
$event['description'] = lang('Videoconference').":\n$link\n\n".$event['description'];
}
$events = array($event);

View File

@ -2460,6 +2460,13 @@ class calendar_ical extends calendar_boupdate
$event['end']--;
}
// Remove videoconference link appended to description in calendar_groupdav->iCal()
if (class_exists('EGroupware\Status\Videoconference\Call'))
{
$regex = "/^(\r?\n)?(Videoconference|" . lang('Videoconference') . "):\r?\n" . str_replace('/','\/',EGroupware\Status\Videoconference\Call::getMeetingRegex()) ."(\r?\n)*/im";
$event['description'] = preg_replace($regex, '', $event['description']);
}
// handle the alarms
$alarms = $event['alarm'];
foreach ($component->getComponents() as $valarm)