Add a dashboard (first version)

This commit is contained in:
Frédéric Guillot
2014-10-14 22:02:35 -04:00
parent d0e6d2e1f1
commit 286b193566
23 changed files with 218 additions and 44 deletions

View File

@@ -111,6 +111,33 @@ class TaskFinder extends Base
->findAll();
}
/**
* Get all open tasks for a given user
*
* @access public
* @param integer $user_id User id
* @return array
*/
public function getAllTasksByUser($user_id)
{
return $this->db
->table(Task::TABLE)
->columns(
'tasks.id',
'tasks.title',
'tasks.date_due',
'tasks.date_creation',
'tasks.project_id',
'tasks.color_id',
'projects.name AS project_name'
)
->join(Project::TABLE, 'id', 'project_id')
->eq('tasks.owner_id', $user_id)
->eq('tasks.is_active', Task::STATUS_OPEN)
->asc('tasks.id')
->findAll();
}
/**
* Get all tasks for a given project and status
*