diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-08-28 22:30:48 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-08-28 22:30:48 -0400 |
commit | 08bdb708e7698c21b0e6fc9f21d19996fc3d593d (patch) | |
tree | b7ab229dfd1568bb9435e40b20c77aa783eefcc2 /app/Controller | |
parent | b51c693cda1cfbda115e315de58b15c0ef275972 (diff) |
Add the possibility to move tasks without drag and drop
Diffstat (limited to 'app/Controller')
-rw-r--r-- | app/Controller/TaskMovePositionController.php | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/app/Controller/TaskMovePositionController.php b/app/Controller/TaskMovePositionController.php new file mode 100644 index 00000000..0db742c3 --- /dev/null +++ b/app/Controller/TaskMovePositionController.php @@ -0,0 +1,43 @@ +<?php + +namespace Kanboard\Controller; + +use Kanboard\Formatter\BoardFormatter; + +/** + * Class TaskMovePositionController + * + * @package Kanboard\Controller + * @author Frederic Guillot + */ +class TaskMovePositionController extends BaseController +{ + public function show() + { + $task = $this->getTask(); + + $this->response->html($this->template->render('task_move_position/show', array( + 'task' => $task, + 'board' => BoardFormatter::getInstance($this->container) + ->withProjectId($task['project_id']) + ->withQuery($this->taskFinderModel->getExtendedQuery()) + ->format() + ))); + } + + public function save() + { + $task = $this->getTask(); + $values = $this->request->getJson(); + + $result = $this->taskPositionModel->movePosition( + $task['project_id'], + $task['id'], + $values['column_id'], + $values['position'], + $values['swimlane_id'] + ); + + $this->response->json(array('result' => $result)); + } +} |