more work on tasks

This commit is contained in:
redmatrix
2015-08-20 18:43:01 -07:00
parent 05bec13bdc
commit afbbc9cd72
5 changed files with 71 additions and 9 deletions

View File

@@ -918,3 +918,27 @@ function todo_stat() {
'CANCELLED' => t('Cancelled')
);
}
function tasks_fetch($arr) {
if(! local_channel())
return;
$ret = array();
$sql_extra = " and event_status != 'COMPLETED' ";
if(argc() > 1 && argv(1) === 'all')
$sql_extra = '';
$r = q("select * from event where type = 'task' and uid = %d $sql_extra ",
intval(local_channel())
);
$ret['success'] = (($r) ? true : false);
if($r) {
$ret['tasks'] = $r;
}
return $ret;
}