Add new automatic action to move a task to another column when closed

This commit is contained in:
Frederic Guillot
2016-07-23 18:33:31 -04:00
parent 2a42e0e1aa
commit 9b2a32af78
35 changed files with 236 additions and 39 deletions

View File

@@ -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;
}