Example #1
0
 /**
  * Get common events for task ical events
  *
  * @access protected
  * @param  array   $task
  * @param  string  $uid
  * @return Event
  */
 protected function getTaskIcalEvent(array &$task, $uid)
 {
     $dateCreation = new DateTime();
     $dateCreation->setTimestamp($task['date_creation']);
     $dateModif = new DateTime();
     $dateModif->setTimestamp($task['date_modification']);
     $vEvent = new Event($uid);
     $vEvent->setCreated($dateCreation);
     $vEvent->setModified($dateModif);
     $vEvent->setUseTimezone(true);
     $vEvent->setSummary(t('#%d', $task['id']) . ' ' . $task['title']);
     $vEvent->setUrl($this->helper->url->base() . $this->helper->url->to('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])));
     if (!empty($task['owner_id'])) {
         $vEvent->setOrganizer('MAILTO:' . ($task['assignee_email'] ?: $task['assignee_username'] . '@kanboard.local'));
     }
     if (!empty($task['creator_id'])) {
         $attendees = new Attendees();
         $attendees->add('MAILTO:' . ($task['creator_email'] ?: $task['creator_username'] . '@kanboard.local'));
         $vEvent->setAttendees($attendees);
     }
     return $vEvent;
 }
Example #2
0
 /**
  * @param string $attendee
  * @param array  $params
  *
  * @return $this
  */
 public function addAttendee($attendee, $params = array())
 {
     if (!isset($this->attendees)) {
         $this->attendees = new Attendees();
     }
     $this->attendees->add($attendee, $params);
     return $this;
 }