diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-07-14 13:46:06 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-07-14 13:46:06 -0400 |
commit | 6e35d8f22aa828b9dcd72d749034754e1a00a525 (patch) | |
tree | 6521f1f0351accf080d11b6d812bea81ffb8bd8a /app/Formatter | |
parent | 9496dfdb6df0266b6b7c99c01a4eb9055322b581 (diff) |
Display project name for task auto-complete fields
Diffstat (limited to 'app/Formatter')
-rw-r--r-- | app/Formatter/TaskAutoCompleteFormatter.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/app/Formatter/TaskAutoCompleteFormatter.php b/app/Formatter/TaskAutoCompleteFormatter.php index 4f1c4c69..2d9f7341 100644 --- a/app/Formatter/TaskAutoCompleteFormatter.php +++ b/app/Formatter/TaskAutoCompleteFormatter.php @@ -3,6 +3,7 @@ namespace Kanboard\Formatter; use Kanboard\Core\Filter\FormatterInterface; +use Kanboard\Model\ProjectModel; use Kanboard\Model\TaskModel; /** @@ -21,11 +22,15 @@ class TaskAutoCompleteFormatter extends BaseFormatter implements FormatterInterf */ public function format() { - $tasks = $this->query->columns(TaskModel::TABLE.'.id', TaskModel::TABLE.'.title')->findAll(); + $tasks = $this->query->columns( + TaskModel::TABLE.'.id', + TaskModel::TABLE.'.title', + ProjectModel::TABLE.'.name AS project_name' + )->asc(TaskModel::TABLE.'.id')->findAll(); foreach ($tasks as &$task) { $task['value'] = $task['title']; - $task['label'] = '#'.$task['id'].' - '.$task['title']; + $task['label'] = $task['project_name'].' > #'.$task['id'].' '.$task['title']; } return $tasks; |