summaryrefslogtreecommitdiff
path: root/app/Model/TaskStatus.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-05-10 13:45:09 -0400
committerFrederic Guillot <fred@kanboard.net>2015-05-10 13:45:09 -0400
commit94a5b12e68fc5e5f6aee7bf1d6d25427421aba7a (patch)
treeaa1f86e9fd134ec60534446948dcd2d54e02e5f7 /app/Model/TaskStatus.php
parent98aab0d99465b40907bbc1f1108ea20db290e036 (diff)
parentec24efa2d9599eaf6cbc39da25cffeaff555ba3c (diff)
Merge pull-request #847 (recurring tasks)
Diffstat (limited to 'app/Model/TaskStatus.php')
-rw-r--r--app/Model/TaskStatus.php11
1 files changed, 10 insertions, 1 deletions
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;