From a67a80f6a7418beb1f41d0bb3ee20eaec43a513f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Sat, 7 Mar 2020 12:16:57 +0100 Subject: [PATCH] Map assigned users to ATTENDEE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/Db/Card.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/Db/Card.php b/lib/Db/Card.php index f91092a84..8870202fd 100644 --- a/lib/Db/Card.php +++ b/lib/Db/Card.php @@ -128,7 +128,7 @@ class Card extends RelationalEntity { $event->DTEND = new \DateTime($this->getDuedate()); $event->add('RELATED-TO', 'deck-stack-' . $this->getStackId()); - // For write support: CANCELLED / IN-PROCESS handling + // FIXME: For write support: CANCELLED / IN-PROCESS handling $event->STATUS = $this->getArchived() ? "COMPLETED" : "NEEDS-ACTION"; if ($this->getArchived()) { $date = new DateTime(); @@ -140,6 +140,13 @@ class Card extends RelationalEntity { return $label->getTitle(); }, $this->getLabels()); } + foreach ($this->getAssignedUsers() as $user) { + $participant = $user->resolveParticipant(); + // FIXME use proper uri + $event->add('ATTENDEE', 'https://localhost/remote.php/dav/principals/users/:' . $participant->getUID(), [ 'CN' => $participant->getDisplayName()]); + } + + $event->SUMMARY = $this->getTitle(); $calendar->add($event); return $calendar;