From 62827e6cf470449c117624058fb36ad94804bcc0 Mon Sep 17 00:00:00 2001 From: emkael Date: Tue, 5 May 2020 14:25:42 +0200 Subject: Time tracking related plugins --- .../Formatter/SubtaskAutoCompleteFormatter.php | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 plugins/Timetrackingeditor/Formatter/SubtaskAutoCompleteFormatter.php (limited to 'plugins/Timetrackingeditor/Formatter') diff --git a/plugins/Timetrackingeditor/Formatter/SubtaskAutoCompleteFormatter.php b/plugins/Timetrackingeditor/Formatter/SubtaskAutoCompleteFormatter.php new file mode 100644 index 00000000..724a146e --- /dev/null +++ b/plugins/Timetrackingeditor/Formatter/SubtaskAutoCompleteFormatter.php @@ -0,0 +1,39 @@ +query->columns( + SubtaskModel::TABLE.'.id', + SubtaskModel::TABLE.'.title' + )->asc(SubtaskModel::TABLE.'.id')->findAll(); + + foreach ($subtasks as &$subtask) { + $subtask['value'] = $subtask['title']; + $subtask['label'] = ' > #'.$subtask['id'].' '.$subtask['title']; + } + + return $subtasks; + } +} -- cgit v1.2.3