14 private string $languageId;
18 $this->languageId = $languageId;
31 .
"\D+(.?);[\r\n]*|is"
33 $description = preg_replace($pattern,
"", $description);
35 $acceptedAttendeePattern =
"|"
36 .
Loc::getMessage(
'CAL_SYNC_UTIL_ATTENDEES_STATUS_Y',
false, $this->languageId)
38 .
"\D+(.?);[\r\n]*|is"
40 $description = preg_replace($acceptedAttendeePattern,
"", $description);
42 return trim($description);
57 $result = $this->prepareUserNames($attendeesCodes, $parentId)
63 $result .=
"\r\n\r\n" . $description;
78 private function prepareUserNames(array $codes, ?
int $parentId): string
82 $users = \CCalendar::GetDestinationUsers($codes,
true);
83 $usersMeetingStatus = [];
87 $usersMeetingStatus = $this->getUsersMeetingStatus($parentId);
90 if (!$usersMeetingStatus)
92 $names = array_map(
static function($user) {
93 return $user[
'FORMATTED_NAME'];
96 return implode(
', ', $names);
99 foreach ($users as $user)
101 $userName = $user[
'FORMATTED_NAME'];
103 $attendees[] = $userName;
106 if (!empty($attendees))
108 $result .=
Loc::getMessage(
'CAL_SYNC_UTIL_ATTENDEES',
false, $this->languageId)
110 . implode(
', ', $attendees)
125 private function getUsersMeetingStatus(
int $eventId): array
128 $events = EventTable::query()
129 ->setSelect([
'OWNER_ID',
'MEETING_STATUS'])
130 ->where(
'PARENT_ID', $eventId)
133 while ($event = $events->fetchObject())
135 $result[$event->getOwnerId()] = $event->getMeetingStatus();
static getMessage($code, $replace=null, $language=null)