diff options
author | Dzial Techniczny WMW Projekt s.c <techniczna@wmwprojekt.pl> | 2020-04-08 14:01:28 +0200 |
---|---|---|
committer | Dzial Techniczny WMW Projekt s.c <techniczna@wmwprojekt.pl> | 2020-04-08 14:01:28 +0200 |
commit | 0dfe48b7fa475aade00a8ccf42e3dba99dfa3702 (patch) | |
tree | 92d34a659a841c4d0036fa5ef23b2f2b425c4b4e /app/Formatter/TaskListProjectFormatter.php | |
parent | eca069dbd1318274b4170eb78629b0128dd0543c (diff) |
"My tasks" view grops tasks by project - fixes #107
Diffstat (limited to 'app/Formatter/TaskListProjectFormatter.php')
-rw-r--r-- | app/Formatter/TaskListProjectFormatter.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/app/Formatter/TaskListProjectFormatter.php b/app/Formatter/TaskListProjectFormatter.php new file mode 100644 index 00000000..109e9a2d --- /dev/null +++ b/app/Formatter/TaskListProjectFormatter.php @@ -0,0 +1,30 @@ +<?php + +namespace Kanboard\Formatter; + +use Kanboard\Formatter\TaskListFormatter; + +/** + * Class TaskListProjectFormatter + * + * @package Kanboard\Formatter + */ +class TaskListProjectFormatter extends TaskListFormatter +{ + /** + * Apply formatter + * + * @access public + * @return array + */ + public function format() + { + $tasks = parent::format(); + $prev = NULL; + foreach ($tasks as &$task) { + $task['render_project_name'] = (!$prev || $prev['project_name'] != $task['project_name']); + $prev = $task; + } + return $tasks; + } +} |