From a314bbb489eff2d419481ad001805ce13edb5352 Mon Sep 17 00:00:00 2001 From: David-Norris Date: Sun, 3 May 2015 00:12:28 -0400 Subject: Initial Recurring Tasks Commit Initial Recurring Tasks Commit No Locales Updated. --- app/Model/TaskStatus.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'app/Model/TaskStatus.php') diff --git a/app/Model/TaskStatus.php b/app/Model/TaskStatus.php index 30a65e1e..1ae8bfeb 100644 --- a/app/Model/TaskStatus.php +++ b/app/Model/TaskStatus.php @@ -89,7 +89,9 @@ class TaskStatus extends Base */ private function changeStatus($task_id, $status, $date_completed, $event) { - if (! $this->taskFinder->exists($task_id)) { + $task = $this->taskFinder->getById($task_id); + + if (!$task['id']) { return false; } @@ -107,6 +109,13 @@ class TaskStatus extends Base $event, new TaskEvent(array('task_id' => $task_id) + $this->taskFinder->getById($task_id)) ); + + if ($status == Task::STATUS_CLOSED + && $task['recurrence_status'] == Task::RECURE_STATUS_PENDING + && $task['recurrence_trigger'] == Task::RECURE_TRIGGER_CLOSE) + { + $this->taskDuplication->createRecurrence($task_id); + } } return $result; -- cgit v1.2.3