diff --git a/module/task/control.php b/module/task/control.php index 09504eb87c..2ffdc1e0e0 100755 --- a/module/task/control.php +++ b/module/task/control.php @@ -724,9 +724,8 @@ class task extends control $changes = $this->task->start($task, $taskData); if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); - $action = $this->post->left == 0 ? 'Finished' : 'Restarted'; - $actionID = $this->loadModel('action')->create('task', $taskID, $action, $this->post->comment); - if(!empty($changes)) $this->action->logHistory($actionID, $changes); + $result = $this->task->afterStart($task, $changes, (float)$this->post->left); + if(is_array($result)) $this->send($result); $this->executeHooks($taskID); $response = $this->taskZen->responseAfterChangeStatus($task, $from); diff --git a/module/task/model.php b/module/task/model.php index c419294fa2..0ce31f3407 100755 --- a/module/task/model.php +++ b/module/task/model.php @@ -319,7 +319,7 @@ class taskModel extends model * @access public * @return array|bool */ - public function afterStart(object $oldTask, array $changes, float $left, array $output): array|bool + public function afterStart(object $oldTask, array $changes, float $left, array $output = array()): array|bool { /* Update the data of the parent task. */ if($oldTask->parent > 0) $this->computeBeginAndEnd($oldTask->parent);