Skip to content

Commit

Permalink
Fix VTODO and issues during rebase
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <jus@bitgrid.net>
  • Loading branch information
juliushaertl committed Jun 14, 2020
1 parent cef5964 commit 1f4b6d4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
12 changes: 8 additions & 4 deletions lib/Db/Card.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,12 @@ public function getCalendarObject(): VCalendar {
$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
Expand All @@ -134,6 +137,7 @@ public function getCalendarObject(): VCalendar {
$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) {
Expand All @@ -142,7 +146,7 @@ public function getCalendarObject(): VCalendar {
}
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()]);
}

Expand Down
3 changes: 2 additions & 1 deletion lib/Db/CardMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ public function findAll($stackId, $limit = null, $offset = null, $since = -1) {
->andWhere($qb->expr()->neq('archived', $qb->createNamedParameter(true)))
->andWhere($qb->expr()->eq('deleted_at', $qb->createNamedParameter(0)))
->andWhere($qb->expr()->gt('last_modified', $qb->createNamedParameter($since)))
->orderBy('order', 'id')
->addOrderBy('order')
->addOrderBy('id')
->setMaxResults($limit)
->setFirstResult($offset);
return $this->findEntities($qb);
Expand Down

0 comments on commit 1f4b6d4

Please sign in to comment.