summaryrefslogtreecommitdiff
path: root/app/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'app/Controller')
-rw-r--r--app/Controller/TaskMailController.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/Controller/TaskMailController.php b/app/Controller/TaskMailController.php
index e95ddf03..e4906bcd 100644
--- a/app/Controller/TaskMailController.php
+++ b/app/Controller/TaskMailController.php
@@ -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);