* Calendar - fix alarm removed if user is only participant because of group invitation

This commit is contained in:
nathangray 2018-11-22 11:35:35 -07:00
parent 62805058a5
commit 234e013347

View File

@ -1326,12 +1326,15 @@ class calendar_boupdate extends calendar_bo
// same with the alarms
if (isset($event['alarm']) && is_array($event['alarm']) && isset($event['start']))
{
// Expand group invitations so we don't lose individual alarms
$expanded = $event;
$this->enum_groups($expanded);
foreach($event['alarm'] as $id => &$alarm)
{
// remove alarms belonging to not longer existing or rejected participants
if ($alarm['owner'] && isset($event['participants']))
if ($alarm['owner'] && isset($expanded['participants']))
{
$status = $event['participants'][$alarm['owner']];
$status = $expanded['participants'][$alarm['owner']];
if (!isset($status) || calendar_so::split_status($status) === 'R')
{
unset($event['alarm'][$id]);