diff --git a/calendar/inc/class.calendar_uiforms.inc.php b/calendar/inc/class.calendar_uiforms.inc.php index 69c04ec054..0f201fc237 100644 --- a/calendar/inc/class.calendar_uiforms.inc.php +++ b/calendar/inc/class.calendar_uiforms.inc.php @@ -2243,19 +2243,6 @@ class calendar_uiforms extends calendar_ui { $master = $this->bo->read($event['uid']); } - $all_participants = ($event['participants'] ?? []) + ($existing_event['participants'] ?? []); - $event['participantChanges'] = array_map(function($uid, $status) use ($existing_event, $event) { - return [ - 'changed' => !isset($event['participants'][$uid]) ? 'meetingRequestParticipantDeleted' : - (!isset($existing_event['participants'][$uid]) ? 'meetingRequestChanged' : - ($status !== $existing_event['participants'][$uid] ? 'meetingRequestChangedStatus' : '')), - 'label' => $this->bo->participant_name($uid), - 'status' => lang($this->bo->verbose_status[calendar_so::split_status($status, $quantity, $role)]), - 'role' => $role === 'REQ-PARTICIPANT' ? '' : lang($this->bo->roles[$role] ?? - (substr($role,0,6) === 'X-CAT-' && ($cat_id = (int)substr($role,6)) > 0 ? - $GLOBALS['egw']->categories->id2name($cat_id) : str_replace('X-','',$role))), - ]; - }, array_keys($all_participants), $all_participants); switch(strtolower($ical_method)) { @@ -2370,14 +2357,19 @@ class calendar_uiforms extends calendar_ui { $readonlys['button[cancel]'] = true; // no way to remove a canceled event not in calendar } - $event['participant_types'] = array(); - foreach($event['participants'] as $uid => $status) - { - $user_type = $user_id = null; - calendar_so::split_user($uid, $user_type, $user_id); - $event['participants'][$uid] = $event['participant_types'][$user_type][$user_id] = - $status && $status !== 'X' ? $status : 'U'; // X --> no status given --> U = unknown - } + $all_participants = ($event['participants'] ?? []) + ($existing_event['participants'] ?? []); + $event['participantChanges'] = array_map(function($uid, $status) use ($existing_event, $event) { + return [ + 'changed' => !isset($event['participants'][$uid]) ? 'meetingRequestParticipantDeleted' : + (!isset($existing_event) ? '' : (!isset($existing_event['participants'][$uid]) ? 'meetingRequestChanged' : + ($status !== $existing_event['participants'][$uid] ? 'meetingRequestChangedStatus' : ''))), + 'label' => $this->bo->participant_name($uid), + 'status' => lang($this->bo->verbose_status[calendar_so::split_status($status, $quantity, $role)]), + 'role' => $role === 'REQ-PARTICIPANT' ? '' : lang($this->bo->roles[$role] ?? + (substr($role,0,6) === 'X-CAT-' && ($cat_id = (int)substr($role,6)) > 0 ? + $GLOBALS['egw']->categories->id2name($cat_id) : str_replace('X-','',$role))), + ]; + }, array_keys($all_participants), $all_participants); //error_log(__METHOD__."(...) parsed as ".array2string($event)); $event['recure'] = $this->bo->recure2string($master ?? null ?: $event); if (!empty($master)) unset($event['changed']['recure']);