Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 18 additions & 16 deletions interfaces/VCalendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,28 +245,30 @@ private function addVEvent(CalendarEventIF $item, bool $isRecurrenceChild = fals
}
}

$organizer = $item->getOrganizer();
if ($organizer instanceof User) {
$evt->add(
'ORGANIZER;CN=' . $this->getCN($organizer),
'mailto:' . $this->getMailto($organizer),
);
$eventType = $item->getEventType();

if ($eventType instanceof CalendarEntryType && !empty($category = $eventType->name)) {
$evt->add('CATEGORIES', $category);
}

if ($this->includeParticipantInfo && $item instanceof CalendarEventParticipationIF) {
foreach ($item->findParticipants()->limit(self::MAX_PARTICIPANTS_COUNT)->all() as $participant) {
/* @var $user User */
if ($item instanceof CalendarEventParticipationIF) {
$organizer = $item->getOrganizer();
if ($organizer instanceof User) {
$evt->add(
'ATTENDEE;CN=' . $this->getCN($participant),
'mailto:' . $this->getMailto($participant),
'ORGANIZER;CN=' . $this->getCN($organizer),
'mailto:' . $this->getMailto($organizer),
);
}
}

$eventType = $item->getEventType();

if ($eventType instanceof CalendarEntryType && !empty($category = $eventType->name)) {
$evt->add('CATEGORIES', $category);
if ($this->includeParticipantInfo) {
foreach ($item->findParticipants()->limit(self::MAX_PARTICIPANTS_COUNT)->all() as $participant) {
/* @var $user User */
$evt->add(
'ATTENDEE;CN=' . $this->getCN($participant),
'mailto:' . $this->getMailto($participant),
);
}
}
}

return $this;
Expand Down
Loading