Add the possibility to create a comment when a task is sent by email
This commit is contained in:
@@ -33,6 +33,15 @@ class TaskMailController extends BaseController
|
||||
if ($valid) {
|
||||
$this->sendByEmail($values, $task);
|
||||
$this->flash->success(t('Task sent by email successfully.'));
|
||||
|
||||
if (isset($values['add_comment']) && $values['add_comment'] == 1) {
|
||||
$this->commentModel->create(array(
|
||||
'comment' => t('This task was sent by email to "%s" with subject "%s".', $values['email'], $values['subject']),
|
||||
'user_id' => $this->userSession->getId(),
|
||||
'task_id' => $task['id'],
|
||||
));
|
||||
}
|
||||
|
||||
$this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), 'comments'), true);
|
||||
} else {
|
||||
$this->create($values, $errors);
|
||||
|
||||
Reference in New Issue
Block a user