Changeset View
Changeset View
Standalone View
Standalone View
plugins/tasklist/drivers/kolab/tasklist_kolab_driver.php
Show First 20 Lines • Show All 544 Lines • ▼ Show 20 Lines | class tasklist_kolab_driver extends tasklist_driver | ||||
/** | /** | ||||
* Get all task records matching the given filter | * Get all task records matching the given filter | ||||
* | * | ||||
* @param array Hash array with filter criterias: | * @param array Hash array with filter criterias: | ||||
* - mask: Bitmask representing the filter selection (check against tasklist::FILTER_MASK_* constants) | * - mask: Bitmask representing the filter selection (check against tasklist::FILTER_MASK_* constants) | ||||
* - from: Date range start as string (Y-m-d) | * - from: Date range start as string (Y-m-d) | ||||
* - to: Date range end as string (Y-m-d) | * - to: Date range end as string (Y-m-d) | ||||
* - search: Search query string | * - search: Search query string | ||||
* - uid: Task UIDs | |||||
* @param array List of lists to get tasks from | * @param array List of lists to get tasks from | ||||
* @return array List of tasks records matchin the criteria | * @return array List of tasks records matchin the criteria | ||||
*/ | */ | ||||
public function list_tasks($filter, $lists = null) | public function list_tasks($filter, $lists = null) | ||||
{ | { | ||||
if (empty($lists)) { | if (empty($lists)) { | ||||
$lists = $this->_read_lists(); | $lists = $this->_read_lists(); | ||||
$lists = array_keys($lists); | $lists = array_keys($lists); | ||||
Show All 19 Lines | public function list_tasks($filter, $lists = null) | ||||
$query[] = array('words', '~', $word); | $query[] = array('words', '~', $word); | ||||
} | } | ||||
} | } | ||||
if ($filter['since']) { | if ($filter['since']) { | ||||
$query[] = array('changed', '>=', $filter['since']); | $query[] = array('changed', '>=', $filter['since']); | ||||
} | } | ||||
if ($filter['uid']) { | |||||
$query[] = array('uid', '=', (array) $filter['uid']); | |||||
} | |||||
foreach ($lists as $list_id) { | foreach ($lists as $list_id) { | ||||
if (!$folder = $this->get_folder($list_id)) { | if (!$folder = $this->get_folder($list_id)) { | ||||
continue; | continue; | ||||
} | } | ||||
foreach ($folder->select($query) as $record) { | foreach ($folder->select($query) as $record) { | ||||
// TODO: post-filter tasks returned from storage | // TODO: post-filter tasks returned from storage | ||||
$record['list_id'] = $list_id; | $record['list_id'] = $list_id; | ||||
▲ Show 20 Lines • Show All 1,121 Lines • Show Last 20 Lines |