summaryrefslogtreecommitdiff
path: root/app/Model/TaskPositionModel.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-07-23 18:33:31 -0400
committerFrederic Guillot <fred@kanboard.net>2016-07-23 18:33:31 -0400
commit9b2a32af78ef8fb5424398dc57e3c3f906026272 (patch)
tree6d0f72d865b75774e16be2a1f80dabb9992efdd0 /app/Model/TaskPositionModel.php
parent2a42e0e1aae35a9bb7abf054155b516ffab701d4 (diff)
Add new automatic action to move a task to another column when closed
Diffstat (limited to 'app/Model/TaskPositionModel.php')
-rw-r--r--app/Model/TaskPositionModel.php19
1 files changed, 10 insertions, 9 deletions
diff --git a/app/Model/TaskPositionModel.php b/app/Model/TaskPositionModel.php
index d6d2a0af..3d95a763 100644
--- a/app/Model/TaskPositionModel.php
+++ b/app/Model/TaskPositionModel.php
@@ -16,15 +16,16 @@ class TaskPositionModel extends Base
* Move a task to another column or to another position
*
* @access public
- * @param integer $project_id Project id
- * @param integer $task_id Task id
- * @param integer $column_id Column id
- * @param integer $position Position (must be >= 1)
- * @param integer $swimlane_id Swimlane id
- * @param boolean $fire_events Fire events
- * @return boolean
+ * @param integer $project_id Project id
+ * @param integer $task_id Task id
+ * @param integer $column_id Column id
+ * @param integer $position Position (must be >= 1)
+ * @param integer $swimlane_id Swimlane id
+ * @param boolean $fire_events Fire events
+ * @param bool $onlyOpen Do not move closed tasks
+ * @return bool
*/
- public function movePosition($project_id, $task_id, $column_id, $position, $swimlane_id = 0, $fire_events = true)
+ public function movePosition($project_id, $task_id, $column_id, $position, $swimlane_id = 0, $fire_events = true, $onlyOpen = true)
{
if ($position < 1) {
return false;
@@ -32,7 +33,7 @@ class TaskPositionModel extends Base
$task = $this->taskFinderModel->getById($task_id);
- if ($task['is_active'] == TaskModel::STATUS_CLOSED) {
+ if ($onlyOpen && $task['is_active'] == TaskModel::STATUS_CLOSED) {
return true;
}