diff options
Diffstat (limited to 'app/Model')
-rw-r--r-- | app/Model/TaskCreation.php | 1 | ||||
-rw-r--r-- | app/Model/TaskFinder.php | 2 | ||||
-rw-r--r-- | app/Model/TaskPosition.php | 5 |
3 files changed, 7 insertions, 1 deletions
diff --git a/app/Model/TaskCreation.php b/app/Model/TaskCreation.php index 17e5ff70..893cbc43 100644 --- a/app/Model/TaskCreation.php +++ b/app/Model/TaskCreation.php @@ -62,6 +62,7 @@ class TaskCreation extends Base $values['swimlane_id'] = empty($values['swimlane_id']) ? 0 : $values['swimlane_id']; $values['date_creation'] = time(); $values['date_modification'] = $values['date_creation']; + $values['date_moved'] = $values['date_creation']; $values['position'] = $this->taskFinder->countByColumnAndSwimlaneId($values['project_id'], $values['column_id'], $values['swimlane_id']) + 1; } diff --git a/app/Model/TaskFinder.php b/app/Model/TaskFinder.php index 4ed196ef..05168593 100644 --- a/app/Model/TaskFinder.php +++ b/app/Model/TaskFinder.php @@ -102,6 +102,7 @@ class TaskFinder extends Base 'tasks.is_active', 'tasks.score', 'tasks.category_id', + 'tasks.date_moved', 'users.username AS assignee_username', 'users.name AS assignee_name' ) @@ -242,6 +243,7 @@ class TaskFinder extends Base tasks.score, tasks.category_id, tasks.swimlane_id, + tasks.date_moved, project_has_categories.name AS category_name, projects.name AS project_name, columns.title AS column_title, diff --git a/app/Model/TaskPosition.php b/app/Model/TaskPosition.php index 2c271de7..9733999b 100644 --- a/app/Model/TaskPosition.php +++ b/app/Model/TaskPosition.php @@ -30,7 +30,10 @@ class TaskPosition extends Base $result = $this->calculateAndSave($project_id, $task_id, $column_id, $position, $swimlane_id); if ($result) { - + if ($original_task['column_id'] != $column_id) { + $this->db->table(Task::TABLE)->eq('id', $task_id)->update(array('date_moved' => time(), + )); + } if ($original_task['swimlane_id'] != $swimlane_id) { $this->calculateAndSave($project_id, 0, $column_id, 1, $original_task['swimlane_id']); } |