Add new actions to reorder tasks by column
This commit is contained in:
36
app/Controller/TaskReorderController.php
Normal file
36
app/Controller/TaskReorderController.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace Kanboard\Controller;
|
||||
|
||||
use Kanboard\Core\Controller\AccessForbiddenException;
|
||||
|
||||
class TaskReorderController extends BaseController
|
||||
{
|
||||
public function reorderColumn()
|
||||
{
|
||||
$project = $this->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']]));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user