Ejemplo n.º 1
0
 /**
  * Get all tasks records matching the given filter
  *
  * @param array Hash array wiht filter criterias
  * @param array List of lists to get tasks from
  * @param boolean Include clones of recurring tasks
  * @return array List of tasks records matchin the criteria
  * @see tasklist_driver::list_tasks()
  */
 function list_tasks($filter, $lists = null, $virtual = true)
 {
     foreach ($this->sync_clients as $cal_id => $cal_sync) {
         if (!$this->_is_synced($cal_id)) {
             $this->_sync_calendar($cal_id);
         }
     }
     return parent::list_tasks($filter, $lists);
 }
Ejemplo n.º 2
0
 /**
  * Load tasks
  */
 function load_tasks($cals, $query = array('since' => 1), $virtual = false)
 {
     $events = array();
     $dbtasks = new tasklist_database_driver($this->cal);
     $tasks = (array) $dbtasks->list_tasks($query, $cals, $virtual);
     foreach ($tasks as $task) {
         $task['_type'] = 'task';
         if ($task['date']) {
             $due = $task['date'] . ' ' . ($task['time'] ? $task['time'] . ':00' : '00:00:00');
             if (strtotime($due)) {
                 $task['due'] = new DateTime($due);
                 unset($task['date']);
                 unset($task['time']);
             }
         }
         if ($task['startdate']) {
             $start = $task['startdate'] . ' ' . ($task['starttime'] ? $task['starttime'] . ':00' : '00:00:00');
             if (strtotime($start)) {
                 $task['start'] = new DateTime($start);
                 unset($task['startdate']);
                 unset($task['starttime']);
             }
         }
         $events[] = $task;
     }
     return $events;
 }