diff options
author | Frederic Guillot <fred@kanboard.net> | 2017-03-12 21:36:52 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2017-03-12 21:36:52 -0400 |
commit | 9b34631135f29480dda3ed2df463fbb5aab7c9e4 (patch) | |
tree | 46da2f342a440cc699b7aa9c61bd18d0d2ea01f5 /app/Model/TaskFinderModel.php | |
parent | f6b42eb8024b7db959f6d75118b3de0f96301262 (diff) |
Simplify dashboard to use new tasks list view
Diffstat (limited to 'app/Model/TaskFinderModel.php')
-rw-r--r-- | app/Model/TaskFinderModel.php | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/app/Model/TaskFinderModel.php b/app/Model/TaskFinderModel.php index b610a371..09193a41 100644 --- a/app/Model/TaskFinderModel.php +++ b/app/Model/TaskFinderModel.php @@ -59,27 +59,11 @@ class TaskFinderModel extends Base */ public function getUserQuery($user_id) { - return $this->db - ->table(TaskModel::TABLE) - ->columns( - TaskModel::TABLE.'.id', - TaskModel::TABLE.'.title', - TaskModel::TABLE.'.date_due', - TaskModel::TABLE.'.date_creation', - TaskModel::TABLE.'.project_id', - TaskModel::TABLE.'.column_id', - TaskModel::TABLE.'.color_id', - TaskModel::TABLE.'.priority', - TaskModel::TABLE.'.time_spent', - TaskModel::TABLE.'.time_estimated', - TaskModel::TABLE.'.is_active', - TaskModel::TABLE.'.creator_id', - ProjectModel::TABLE.'.name AS project_name', - ColumnModel::TABLE.'.title AS column_title' - ) - ->join(ProjectModel::TABLE, 'id', 'project_id') - ->join(ColumnModel::TABLE, 'id', 'column_id') + return $this->getExtendedQuery() + ->beginOr() ->eq(TaskModel::TABLE.'.owner_id', $user_id) + ->addCondition(TaskModel::TABLE.".id IN (SELECT task_id FROM ".SubtaskModel::TABLE." WHERE ".SubtaskModel::TABLE.".user_id='$user_id')") + ->closeOr() ->eq(TaskModel::TABLE.'.is_active', TaskModel::STATUS_OPEN) ->eq(ProjectModel::TABLE.'.is_active', ProjectModel::ACTIVE) ->eq(ColumnModel::TABLE.'.hide_in_dashboard', 0); |