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 --- app/Model/TaskFinderModel.php | 4 +++- app/Template/task/dropdown.php | 7 ++++++- libs/picodb/lib/PicoDb/Table.php | 12 ++++++++++++ plugins/Group_assign/Model/NewTaskFinderModel.php | 4 +++- plugins/Group_assign/Model/OldTaskFinderModel.php | 4 +++- 5 files changed, 27 insertions(+), 4 deletions(-) diff --git a/app/Model/TaskFinderModel.php b/app/Model/TaskFinderModel.php index 8e6b081a..22454e0d 100644 --- a/app/Model/TaskFinderModel.php +++ b/app/Model/TaskFinderModel.php @@ -77,7 +77,7 @@ class TaskFinderModel 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', @@ -136,6 +136,8 @@ class TaskFinderModel extends Base ->join(ColumnModel::TABLE, 'id', 'column_id', TaskModel::TABLE) ->join(SwimlaneModel::TABLE, 'id', 'swimlane_id', TaskModel::TABLE) ->join(ProjectModel::TABLE, 'id', 'project_id', TaskModel::TABLE); + $query = $this->hook->reference('task:query:extended', $query); + return $query; } /** diff --git a/app/Template/task/dropdown.php b/app/Template/task/dropdown.php index cc97d1a1..e51c33e6 100644 --- a/app/Template/task/dropdown.php +++ b/app/Template/task/dropdown.php @@ -1,5 +1,10 @@