From 029538846181309e9135a17f893e874b2e90f72b Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Fri, 8 Feb 2019 13:53:13 -0800 Subject: Add new actions to reorder tasks by column --- app/Controller/TaskReorderController.php | 36 ++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 app/Controller/TaskReorderController.php (limited to 'app/Controller') diff --git a/app/Controller/TaskReorderController.php b/app/Controller/TaskReorderController.php new file mode 100644 index 00000000..32bdfc52 --- /dev/null +++ b/app/Controller/TaskReorderController.php @@ -0,0 +1,36 @@ +getProject(); + + if (! $this->helper->user->hasProjectAccess('TaskModificationController', 'update', $project['id'])) { + throw new AccessForbiddenException(); + } + + $swimlaneID = $this->request->getIntegerParam('swimlane_id'); + $columnID = $this->request->getIntegerParam('column_id'); + $direction = $this->request->getStringParam('direction'); + $sort = $this->request->getStringParam('sort'); + + switch ($sort) { + case 'priority': + $this->taskReorderModel->reorderByPriority($project['id'], $swimlaneID, $columnID, $direction); + break; + case 'assignee-priority': + $this->taskReorderModel->reorderByAssigneeAndPriority($project['id'], $swimlaneID, $columnID, $direction); + break; + case 'assignee': + $this->taskReorderModel->reorderByAssignee($project['id'], $swimlaneID, $columnID, $direction); + break; + } + + $this->response->redirect($this->helper->url->to('BoardViewController', 'show', ['project_id' => $project['id']])); + } +} -- cgit v1.2.3