summaryrefslogtreecommitdiff
path: root/app
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
parent43e4662b842248952aa53ebb69e8e833682a055c (diff)
Add the possibility to create a comment when a task is sent by email
Diffstat (limited to 'app')
-rw-r--r--app/Controller/TaskMailController.php9
-rw-r--r--app/Locale/bs_BA/translations.php2
-rw-r--r--app/Locale/ca_ES/translations.php2
-rw-r--r--app/Locale/cs_CZ/translations.php2
-rw-r--r--app/Locale/da_DK/translations.php2
-rw-r--r--app/Locale/de_DE/translations.php2
-rw-r--r--app/Locale/el_GR/translations.php2
-rw-r--r--app/Locale/es_ES/translations.php2
-rw-r--r--app/Locale/fi_FI/translations.php2
-rw-r--r--app/Locale/fr_FR/translations.php2
-rw-r--r--app/Locale/hr_HR/translations.php2
-rw-r--r--app/Locale/hu_HU/translations.php2
-rw-r--r--app/Locale/id_ID/translations.php2
-rw-r--r--app/Locale/it_IT/translations.php2
-rw-r--r--app/Locale/ja_JP/translations.php2
-rw-r--r--app/Locale/ko_KR/translations.php2
-rw-r--r--app/Locale/my_MY/translations.php2
-rw-r--r--app/Locale/nb_NO/translations.php2
-rw-r--r--app/Locale/nl_NL/translations.php2
-rw-r--r--app/Locale/pl_PL/translations.php2
-rw-r--r--app/Locale/pt_BR/translations.php2
-rw-r--r--app/Locale/pt_PT/translations.php2
-rw-r--r--app/Locale/ru_RU/translations.php2
-rw-r--r--app/Locale/sr_Latn_RS/translations.php2
-rw-r--r--app/Locale/sv_SE/translations.php2
-rw-r--r--app/Locale/th_TH/translations.php2
-rw-r--r--app/Locale/tr_TR/translations.php2
-rw-r--r--app/Locale/zh_CN/translations.php2
-rw-r--r--app/Template/task_mail/create.php2
29 files changed, 65 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);
diff --git a/app/Locale/bs_BA/translations.php b/app/Locale/bs_BA/translations.php
index 33f4e5f6..f23077fc 100644
--- a/app/Locale/bs_BA/translations.php
+++ b/app/Locale/bs_BA/translations.php
@@ -1335,4 +1335,6 @@ return array(
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
// 'Assign the task to its creator' => '',
+ // 'This task was sent by email to "%s" with subject "%s".' => '',
+ // 'Log this action in a comment' => '',
);
diff --git a/app/Locale/ca_ES/translations.php b/app/Locale/ca_ES/translations.php
index 5d762917..fb4c640d 100644
--- a/app/Locale/ca_ES/translations.php
+++ b/app/Locale/ca_ES/translations.php
@@ -1335,4 +1335,6 @@ return array(
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
// 'Assign the task to its creator' => '',
+ // 'This task was sent by email to "%s" with subject "%s".' => '',
+ // 'Log this action in a comment' => '',
);
diff --git a/app/Locale/cs_CZ/translations.php b/app/Locale/cs_CZ/translations.php
index db17d8d5..7c7244fb 100644
--- a/app/Locale/cs_CZ/translations.php
+++ b/app/Locale/cs_CZ/translations.php
@@ -1335,4 +1335,6 @@ return array(
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
// 'Assign the task to its creator' => '',
+ // 'This task was sent by email to "%s" with subject "%s".' => '',
+ // 'Log this action in a comment' => '',
);
diff --git a/app/Locale/da_DK/translations.php b/app/Locale/da_DK/translations.php
index 74eed6e2..acecf83d 100644
--- a/app/Locale/da_DK/translations.php
+++ b/app/Locale/da_DK/translations.php
@@ -1335,4 +1335,6 @@ return array(
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
// 'Assign the task to its creator' => '',
+ // 'This task was sent by email to "%s" with subject "%s".' => '',
+ // 'Log this action in a comment' => '',
);
diff --git a/app/Locale/de_DE/translations.php b/app/Locale/de_DE/translations.php
index 83802c8e..797dd993 100644
--- a/app/Locale/de_DE/translations.php
+++ b/app/Locale/de_DE/translations.php
@@ -1335,4 +1335,6 @@ return array(
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
// 'Assign the task to its creator' => '',
+ // 'This task was sent by email to "%s" with subject "%s".' => '',
+ // 'Log this action in a comment' => '',
);
diff --git a/app/Locale/el_GR/translations.php b/app/Locale/el_GR/translations.php
index dc45dd21..3f31b0e6 100644
--- a/app/Locale/el_GR/translations.php
+++ b/app/Locale/el_GR/translations.php
@@ -1335,4 +1335,6 @@ return array(
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
// 'Assign the task to its creator' => '',
+ // 'This task was sent by email to "%s" with subject "%s".' => '',
+ // 'Log this action in a comment' => '',
);
diff --git a/app/Locale/es_ES/translations.php b/app/Locale/es_ES/translations.php
index 7e549bee..8de5059f 100644
--- a/app/Locale/es_ES/translations.php
+++ b/app/Locale/es_ES/translations.php
@@ -1335,4 +1335,6 @@ return array(
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
// 'Assign the task to its creator' => '',
+ // 'This task was sent by email to "%s" with subject "%s".' => '',
+ // 'Log this action in a comment' => '',
);
diff --git a/app/Locale/fi_FI/translations.php b/app/Locale/fi_FI/translations.php
index 8bc92e0e..83c5ea66 100644
--- a/app/Locale/fi_FI/translations.php
+++ b/app/Locale/fi_FI/translations.php
@@ -1335,4 +1335,6 @@ return array(
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
// 'Assign the task to its creator' => '',
+ // 'This task was sent by email to "%s" with subject "%s".' => '',
+ // 'Log this action in a comment' => '',
);
diff --git a/app/Locale/fr_FR/translations.php b/app/Locale/fr_FR/translations.php
index f13e1aa9..37a51c63 100644
--- a/app/Locale/fr_FR/translations.php
+++ b/app/Locale/fr_FR/translations.php
@@ -1335,4 +1335,6 @@ return array(
'DKK - Danish Krona' => 'DKK - Couronne danoise',
'Remove user from group' => 'Supprimer cet utilisateur du groupe',
'Assign the task to its creator' => 'Assigner une tâche à son créateur',
+ 'This task was sent by email to "%s" with subject "%s".' => 'Cette tâche a été envoyée par courrier électronique à « %s » avec le sujet « %s ».',
+ 'Log this action in a comment' => 'Enregistrez cette action dans un commentaire',
);
diff --git a/app/Locale/hr_HR/translations.php b/app/Locale/hr_HR/translations.php
index 6ced621a..090ec0c5 100644
--- a/app/Locale/hr_HR/translations.php
+++ b/app/Locale/hr_HR/translations.php
@@ -1335,4 +1335,6 @@ return array(
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
// 'Assign the task to its creator' => '',
+ // 'This task was sent by email to "%s" with subject "%s".' => '',
+ // 'Log this action in a comment' => '',
);
diff --git a/app/Locale/hu_HU/translations.php b/app/Locale/hu_HU/translations.php
index 8de328e7..f2a01e16 100644
--- a/app/Locale/hu_HU/translations.php
+++ b/app/Locale/hu_HU/translations.php
@@ -1335,4 +1335,6 @@ return array(
'DKK - Danish Krona' => 'Dán korona',
'Remove user from group' => 'Felhasználó eltávolítása a csoportból',
// 'Assign the task to its creator' => '',
+ // 'This task was sent by email to "%s" with subject "%s".' => '',
+ // 'Log this action in a comment' => '',
);
diff --git a/app/Locale/id_ID/translations.php b/app/Locale/id_ID/translations.php
index 94800a08..0d34be86 100644
--- a/app/Locale/id_ID/translations.php
+++ b/app/Locale/id_ID/translations.php
@@ -1335,4 +1335,6 @@ return array(
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
// 'Assign the task to its creator' => '',
+ // 'This task was sent by email to "%s" with subject "%s".' => '',
+ // 'Log this action in a comment' => '',
);
diff --git a/app/Locale/it_IT/translations.php b/app/Locale/it_IT/translations.php
index 8455d221..2c544f75 100644
--- a/app/Locale/it_IT/translations.php
+++ b/app/Locale/it_IT/translations.php
@@ -1335,4 +1335,6 @@ return array(
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
// 'Assign the task to its creator' => '',
+ // 'This task was sent by email to "%s" with subject "%s".' => '',
+ // 'Log this action in a comment' => '',
);
diff --git a/app/Locale/ja_JP/translations.php b/app/Locale/ja_JP/translations.php
index 42753535..5971fb67 100644
--- a/app/Locale/ja_JP/translations.php
+++ b/app/Locale/ja_JP/translations.php
@@ -1335,4 +1335,6 @@ return array(
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
// 'Assign the task to its creator' => '',
+ // 'This task was sent by email to "%s" with subject "%s".' => '',
+ // 'Log this action in a comment' => '',
);
diff --git a/app/Locale/ko_KR/translations.php b/app/Locale/ko_KR/translations.php
index 99f7087a..42b1160a 100644
--- a/app/Locale/ko_KR/translations.php
+++ b/app/Locale/ko_KR/translations.php
@@ -1335,4 +1335,6 @@ return array(
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
// 'Assign the task to its creator' => '',
+ // 'This task was sent by email to "%s" with subject "%s".' => '',
+ // 'Log this action in a comment' => '',
);
diff --git a/app/Locale/my_MY/translations.php b/app/Locale/my_MY/translations.php
index 1e7f4e04..3374ad3c 100644
--- a/app/Locale/my_MY/translations.php
+++ b/app/Locale/my_MY/translations.php
@@ -1335,4 +1335,6 @@ return array(
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
// 'Assign the task to its creator' => '',
+ // 'This task was sent by email to "%s" with subject "%s".' => '',
+ // 'Log this action in a comment' => '',
);
diff --git a/app/Locale/nb_NO/translations.php b/app/Locale/nb_NO/translations.php
index 4f860b05..618d89cf 100644
--- a/app/Locale/nb_NO/translations.php
+++ b/app/Locale/nb_NO/translations.php
@@ -1335,4 +1335,6 @@ return array(
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
// 'Assign the task to its creator' => '',
+ // 'This task was sent by email to "%s" with subject "%s".' => '',
+ // 'Log this action in a comment' => '',
);
diff --git a/app/Locale/nl_NL/translations.php b/app/Locale/nl_NL/translations.php
index 9fd2db7a..fd7b26e6 100644
--- a/app/Locale/nl_NL/translations.php
+++ b/app/Locale/nl_NL/translations.php
@@ -1335,4 +1335,6 @@ return array(
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
// 'Assign the task to its creator' => '',
+ // 'This task was sent by email to "%s" with subject "%s".' => '',
+ // 'Log this action in a comment' => '',
);
diff --git a/app/Locale/pl_PL/translations.php b/app/Locale/pl_PL/translations.php
index 09776670..a65df003 100644
--- a/app/Locale/pl_PL/translations.php
+++ b/app/Locale/pl_PL/translations.php
@@ -1335,4 +1335,6 @@ return array(
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
// 'Assign the task to its creator' => '',
+ // 'This task was sent by email to "%s" with subject "%s".' => '',
+ // 'Log this action in a comment' => '',
);
diff --git a/app/Locale/pt_BR/translations.php b/app/Locale/pt_BR/translations.php
index 4f733ab0..dd0b9e90 100644
--- a/app/Locale/pt_BR/translations.php
+++ b/app/Locale/pt_BR/translations.php
@@ -1335,4 +1335,6 @@ return array(
'DKK - Danish Krona' => 'DKK - Coroa Dinamarquesa',
'Remove user from group' => 'Remover usuário do grupo',
// 'Assign the task to its creator' => '',
+ // 'This task was sent by email to "%s" with subject "%s".' => '',
+ // 'Log this action in a comment' => '',
);
diff --git a/app/Locale/pt_PT/translations.php b/app/Locale/pt_PT/translations.php
index 58a71273..7f5110ec 100644
--- a/app/Locale/pt_PT/translations.php
+++ b/app/Locale/pt_PT/translations.php
@@ -1335,4 +1335,6 @@ return array(
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
// 'Assign the task to its creator' => '',
+ // 'This task was sent by email to "%s" with subject "%s".' => '',
+ // 'Log this action in a comment' => '',
);
diff --git a/app/Locale/ru_RU/translations.php b/app/Locale/ru_RU/translations.php
index 93369770..fea13591 100644
--- a/app/Locale/ru_RU/translations.php
+++ b/app/Locale/ru_RU/translations.php
@@ -1335,4 +1335,6 @@ return array(
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
// 'Assign the task to its creator' => '',
+ // 'This task was sent by email to "%s" with subject "%s".' => '',
+ // 'Log this action in a comment' => '',
);
diff --git a/app/Locale/sr_Latn_RS/translations.php b/app/Locale/sr_Latn_RS/translations.php
index d29e997f..dc4aae94 100644
--- a/app/Locale/sr_Latn_RS/translations.php
+++ b/app/Locale/sr_Latn_RS/translations.php
@@ -1335,4 +1335,6 @@ return array(
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
// 'Assign the task to its creator' => '',
+ // 'This task was sent by email to "%s" with subject "%s".' => '',
+ // 'Log this action in a comment' => '',
);
diff --git a/app/Locale/sv_SE/translations.php b/app/Locale/sv_SE/translations.php
index 4dc0f338..d3e1b5ad 100644
--- a/app/Locale/sv_SE/translations.php
+++ b/app/Locale/sv_SE/translations.php
@@ -1335,4 +1335,6 @@ return array(
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
// 'Assign the task to its creator' => '',
+ // 'This task was sent by email to "%s" with subject "%s".' => '',
+ // 'Log this action in a comment' => '',
);
diff --git a/app/Locale/th_TH/translations.php b/app/Locale/th_TH/translations.php
index efedf683..3b9d426c 100644
--- a/app/Locale/th_TH/translations.php
+++ b/app/Locale/th_TH/translations.php
@@ -1335,4 +1335,6 @@ return array(
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
// 'Assign the task to its creator' => '',
+ // 'This task was sent by email to "%s" with subject "%s".' => '',
+ // 'Log this action in a comment' => '',
);
diff --git a/app/Locale/tr_TR/translations.php b/app/Locale/tr_TR/translations.php
index 02b288cc..0f99c4b5 100644
--- a/app/Locale/tr_TR/translations.php
+++ b/app/Locale/tr_TR/translations.php
@@ -1335,4 +1335,6 @@ return array(
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
// 'Assign the task to its creator' => '',
+ // 'This task was sent by email to "%s" with subject "%s".' => '',
+ // 'Log this action in a comment' => '',
);
diff --git a/app/Locale/zh_CN/translations.php b/app/Locale/zh_CN/translations.php
index 7a20eaf7..21466d0e 100644
--- a/app/Locale/zh_CN/translations.php
+++ b/app/Locale/zh_CN/translations.php
@@ -1335,4 +1335,6 @@ return array(
// 'DKK - Danish Krona' => '',
// 'Remove user from group' => '',
// 'Assign the task to its creator' => '',
+ // 'This task was sent by email to "%s" with subject "%s".' => '',
+ // 'Log this action in a comment' => '',
);
diff --git a/app/Template/task_mail/create.php b/app/Template/task_mail/create.php
index 9a1a26b3..b3c84e5d 100644
--- a/app/Template/task_mail/create.php
+++ b/app/Template/task_mail/create.php
@@ -10,6 +10,8 @@
<?= $this->form->label(t('Subject'), 'subject') ?>
<?= $this->form->text('subject', $values, $errors, array('required', 'tabindex="2"')) ?>
+ <?= $this->form->checkbox('add_comment', t('Log this action in a comment'), 1) ?>
+
<?= $this->modal->submitButtons(array(
'submitLabel' => t('Send by email'),
'tabindex' => 3,