summaryrefslogtreecommitdiff
path: root/app/Controller
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2017-06-03 12:03:46 -0400
committerFrederic Guillot <fred@kanboard.net>2017-06-03 12:03:46 -0400
commite27148dfd8192ed3052adb8397a0f8c4ed47916d (patch)
tree1221df9bc1ef5a9396e7a23de2f7a233fddddb83 /app/Controller
parent43e4662b842248952aa53ebb69e8e833682a055c (diff)
Add the possibility to create a comment when a task is sent by email
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);