diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-10-08 09:54:43 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-10-08 09:54:43 -0400 |
commit | fe56fd66f49ecd2dc40d2983fa4622a14226aefd (patch) | |
tree | e0779b104f05bd897d1401a03910c7fbdba61998 /app | |
parent | 5e2e0272ed78e3b729d5673da3e957ce68a30fa2 (diff) |
Update task moved date only when the column or swimlane is changed
Diffstat (limited to 'app')
-rw-r--r-- | app/Model/TaskPositionModel.php | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/app/Model/TaskPositionModel.php b/app/Model/TaskPositionModel.php index 3d95a763..aeb7edde 100644 --- a/app/Model/TaskPositionModel.php +++ b/app/Model/TaskPositionModel.php @@ -72,9 +72,10 @@ class TaskPositionModel extends Base $this->db->startTransaction(); $r1 = $this->saveTaskPositions($project_id, $task_id, 0, $original_column_id, $original_swimlane_id); $r2 = $this->saveTaskPositions($project_id, $task_id, $position, $new_column_id, $new_swimlane_id); + $r3 = $this->saveTaskTimestamps($task_id); $this->db->closeTransaction(); - return $r1 && $r2; + return $r1 && $r2 && $r3; } /** @@ -94,9 +95,10 @@ class TaskPositionModel extends Base $this->db->startTransaction(); $r1 = $this->saveTaskPositions($project_id, $task_id, 0, $original_column_id, $swimlane_id); $r2 = $this->saveTaskPositions($project_id, $task_id, $position, $new_column_id, $swimlane_id); + $r3 = $this->saveTaskTimestamps($task_id); $this->db->closeTransaction(); - return $r1 && $r2; + return $r1 && $r2 && $r3; } /** @@ -167,6 +169,18 @@ class TaskPositionModel extends Base return false; } + return true; + } + + /** + * Update task timestamps + * + * @access private + * @param integer $task_id + * @return bool + */ + private function saveTaskTimestamps($task_id) + { $now = time(); return $this->db->table(TaskModel::TABLE)->eq('id', $task_id)->update(array( |