diff options
| author | Frederic Guillot <fred@kanboard.net> | 2015-07-04 11:14:21 -0400 |
|---|---|---|
| committer | Frederic Guillot <fred@kanboard.net> | 2015-07-04 11:14:21 -0400 |
| commit | 554500aa493faa66b43b2ddce72338880a874724 (patch) | |
| tree | 73066cfbe6af3cabf81b5be1dc5ef81e44792a21 /app/Model/TaskFilter.php | |
| parent | a327f790ee036664439bf50e00c95fb8a0e1f97e (diff) | |
Refactoring to implement new layout with filters: board/calendar/list views (work in progress)
Diffstat (limited to 'app/Model/TaskFilter.php')
| -rw-r--r-- | app/Model/TaskFilter.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/app/Model/TaskFilter.php b/app/Model/TaskFilter.php index 31080cb5..e9d9ccbd 100644 --- a/app/Model/TaskFilter.php +++ b/app/Model/TaskFilter.php @@ -513,6 +513,23 @@ class TaskFilter extends Base } /** + * Get swimlanes and tasks to display the board + * + * @access public + * @return array + */ + public function getBoard($project_id) + { + $tasks = $this->filterByProject($project_id)->query->asc(Task::TABLE.'.position')->findAll(); + + return $this->board->getBoard($project_id, function ($project_id, $column_id, $swimlane_id) use ($tasks) { + return array_filter($tasks, function(array $task) use ($column_id, $swimlane_id) { + return $task['column_id'] == $column_id && $task['swimlane_id'] == $swimlane_id; + }); + }); + } + + /** * Format the results to the ajax autocompletion * * @access public |
