From f4201392f6e6c76ca6bd84cc517f3758fb18e8d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Sun, 14 Jun 2020 14:49:46 +0200 Subject: [PATCH] Fix VTODO and issues during rebase 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 | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/Db/Card.php b/lib/Db/Card.php index 8870202fd..0b157fd56 100644 --- a/lib/Db/Card.php +++ b/lib/Db/Card.php @@ -123,9 +123,12 @@ class Card extends RelationalEntity { $calendar = new VCalendar(); $event = $calendar->createComponent('VTODO'); $event->UID = 'deck-card-' . $this->getId(); - $event->DTSTAMP = new \DateTime($this->getDuedate()); - $event->DTSTART = new \DateTime($this->getDuedate()); - $event->DTEND = new \DateTime($this->getDuedate()); + if ($this->getDuedate()) { + $event->DTSTAMP = new \DateTime(); + $event->DTSTART = new \DateTime($this->getDuedate()); + $event->DTEND = new \DateTime($this->getDuedate()); + $event->DURATION = "PT1H"; + } $event->add('RELATED-TO', 'deck-stack-' . $this->getStackId()); // FIXME: For write support: CANCELLED / IN-PROCESS handling @@ -134,6 +137,7 @@ class Card extends RelationalEntity { $date = new DateTime(); $date->setTimestamp($this->getLastModified()); $event->COMPLETED = $date; + //$event->add('PERCENT-COMPLETE', 100); } if (count($this->getLabels()) > 0) { $event->CATEGORIES = array_map(function ($label) { @@ -142,7 +146,7 @@ class Card extends RelationalEntity { } foreach ($this->getAssignedUsers() as $user) { $participant = $user->resolveParticipant(); - // FIXME use proper uri + // FIXME use proper uri $event->add('ATTENDEE', 'https://localhost/remote.php/dav/principals/users/:' . $participant->getUID(), [ 'CN' => $participant->getDisplayName()]); }