From b6f34622b169652c57e7cabd8d11e28605f110c3 Mon Sep 17 00:00:00 2001 From: "Dzial Techniczny WMW Projekt s.c" Date: Wed, 15 Jan 2020 15:54:11 +0100 Subject: Extending extended query for tasks with possible hooks --- plugins/Group_assign/Model/NewTaskFinderModel.php | 4 +++- plugins/Group_assign/Model/OldTaskFinderModel.php | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'plugins/Group_assign') diff --git a/plugins/Group_assign/Model/NewTaskFinderModel.php b/plugins/Group_assign/Model/NewTaskFinderModel.php index b8b10916..474f6494 100644 --- a/plugins/Group_assign/Model/NewTaskFinderModel.php +++ b/plugins/Group_assign/Model/NewTaskFinderModel.php @@ -146,7 +146,7 @@ class NewTaskFinderModel extends Base */ public function getExtendedQuery() { - return $this->db + $query = $this->db ->table(TaskModel::TABLE) ->columns( '(SELECT COUNT(*) FROM '.CommentModel::TABLE.' WHERE task_id=tasks.id) AS nb_comments', @@ -208,6 +208,8 @@ class NewTaskFinderModel extends Base ->join(GroupModel::TABLE, 'id', 'owner_gp', TaskModel::TABLE) ->join(MultiselectModel::TABLE, 'id', 'owner_ms', TaskModel::TABLE) ->join(ProjectModel::TABLE, 'id', 'project_id', TaskModel::TABLE); + $query = $this->hook->reference('task:query:extended', $query); + return $query; } /** diff --git a/plugins/Group_assign/Model/OldTaskFinderModel.php b/plugins/Group_assign/Model/OldTaskFinderModel.php index 70d06126..9aeeb6dc 100644 --- a/plugins/Group_assign/Model/OldTaskFinderModel.php +++ b/plugins/Group_assign/Model/OldTaskFinderModel.php @@ -146,7 +146,7 @@ class OldTaskFinderModel extends Base */ public function getExtendedQuery() { - return $this->db + $query = $this->db ->table(TaskModel::TABLE) ->columns( '(SELECT COUNT(*) FROM '.CommentModel::TABLE.' WHERE task_id=tasks.id) AS nb_comments', @@ -207,6 +207,8 @@ class OldTaskFinderModel extends Base ->join(GroupModel::TABLE, 'id', 'owner_gp', TaskModel::TABLE) ->join(MultiselectModel::TABLE, 'id', 'owner_ms', TaskModel::TABLE) ->join(ProjectModel::TABLE, 'id', 'project_id', TaskModel::TABLE); + $query = $this->hook->reference('task:query:extended', $query); + return $query; } /** -- cgit v1.2.3