Add the possibility to create a comment when a task is sent by email

This commit is contained in:
Frederic Guillot
2017-06-03 12:03:46 -04:00
parent 43e4662b84
commit e27148dfd8
30 changed files with 66 additions and 0 deletions

View File

@@ -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);