summaryrefslogtreecommitdiff
path: root/app/Controller/Subtask.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Controller/Subtask.php')
-rw-r--r--app/Controller/Subtask.php20
1 files changed, 19 insertions, 1 deletions
diff --git a/app/Controller/Subtask.php b/app/Controller/Subtask.php
index c7ec00d1..385785a1 100644
--- a/app/Controller/Subtask.php
+++ b/app/Controller/Subtask.php
@@ -185,7 +185,7 @@ class Subtask extends Base
if ($redirect === 'board') {
$this->session['has_subtask_inprogress'] = $this->subtask->hasSubtaskInProgress($this->userSession->getId());
-
+
$this->response->html($this->template->render('board/subtasks', array(
'subtasks' => $this->subtask->getAll($task['id']),
'task' => $task,
@@ -259,4 +259,22 @@ class Subtask extends Base
$this->response->redirect($this->helper->url('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])));
}
}
+
+ /**
+ * Move subtask position
+ *
+ * @access public
+ */
+ public function movePosition()
+ {
+ $this->checkCSRFParam();
+ $project_id = $this->request->getIntegerParam('project_id');
+ $task_id = $this->request->getIntegerParam('task_id');
+ $subtask_id = $this->request->getIntegerParam('subtask_id');
+ $direction = $this->request->getStringParam('direction');
+ $method = $direction === 'up' ? 'moveUp' : 'moveDown';
+
+ $this->subtask->$method($task_id, $subtask_id);
+ $this->response->redirect($this->helper->url('task', 'show', array('project_id' => $project_id, 'task_id' => $task_id)).'#subtasks');
+ }
}