From e27148dfd8192ed3052adb8397a0f8c4ed47916d Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 3 Jun 2017 12:03:46 -0400 Subject: [PATCH] Add the possibility to create a comment when a task is sent by email --- ChangeLog | 1 + app/Controller/TaskMailController.php | 9 +++++++++ app/Locale/bs_BA/translations.php | 2 ++ app/Locale/ca_ES/translations.php | 2 ++ app/Locale/cs_CZ/translations.php | 2 ++ app/Locale/da_DK/translations.php | 2 ++ app/Locale/de_DE/translations.php | 2 ++ app/Locale/el_GR/translations.php | 2 ++ app/Locale/es_ES/translations.php | 2 ++ app/Locale/fi_FI/translations.php | 2 ++ app/Locale/fr_FR/translations.php | 2 ++ app/Locale/hr_HR/translations.php | 2 ++ app/Locale/hu_HU/translations.php | 2 ++ app/Locale/id_ID/translations.php | 2 ++ app/Locale/it_IT/translations.php | 2 ++ app/Locale/ja_JP/translations.php | 2 ++ app/Locale/ko_KR/translations.php | 2 ++ app/Locale/my_MY/translations.php | 2 ++ app/Locale/nb_NO/translations.php | 2 ++ app/Locale/nl_NL/translations.php | 2 ++ app/Locale/pl_PL/translations.php | 2 ++ app/Locale/pt_BR/translations.php | 2 ++ app/Locale/pt_PT/translations.php | 2 ++ app/Locale/ru_RU/translations.php | 2 ++ app/Locale/sr_Latn_RS/translations.php | 2 ++ app/Locale/sv_SE/translations.php | 2 ++ app/Locale/th_TH/translations.php | 2 ++ app/Locale/tr_TR/translations.php | 2 ++ app/Locale/zh_CN/translations.php | 2 ++ app/Template/task_mail/create.php | 2 ++ 30 files changed, 66 insertions(+) diff --git a/ChangeLog b/ChangeLog index e6faec1f1..c4a979ed9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ Version 1.0.45 (unreleased) New features: * Automatic action to assign tasks to its creator +* Add the possibility to create a comment when a task is sent by email Version 1.0.44 (May 28, 2017) ----------------------------- diff --git a/app/Controller/TaskMailController.php b/app/Controller/TaskMailController.php index e95ddf03a..e4906bcdf 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 33f4e5f6c..f23077fcb 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 5d7629177..fb4c640dd 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 db17d8d5b..7c7244fbf 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 74eed6e2d..acecf83d6 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 83802c8e0..797dd9932 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 dc45dd21b..3f31b0e6e 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 7e549beea..8de5059ff 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 8bc92e0e0..83c5ea66d 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 f13e1aa98..37a51c63e 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 6ced621a8..090ec0c5e 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 8de328e76..f2a01e166 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 94800a088..0d34be86e 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 8455d221f..2c544f758 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 427535353..5971fb679 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 99f7087ae..42b1160a5 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 1e7f4e043..3374ad3c1 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 4f860b05e..618d89cfb 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 9fd2db7a1..fd7b26e61 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 097766707..a65df0037 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 4f733ab0f..dd0b9e90a 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 58a712734..7f5110ecb 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 93369770a..fea135913 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 d29e997fe..dc4aae94d 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 4dc0f3385..d3e1b5adb 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 efedf683e..3b9d426c6 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 02b288cce..0f99c4b56 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 7a20eaf76..21466d0e9 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 9a1a26b34..b3c84e5d7 100644 --- a/app/Template/task_mail/create.php +++ b/app/Template/task_mail/create.php @@ -10,6 +10,8 @@ form->label(t('Subject'), 'subject') ?> form->text('subject', $values, $errors, array('required', 'tabindex="2"')) ?> + form->checkbox('add_comment', t('Log this action in a comment'), 1) ?> + modal->submitButtons(array( 'submitLabel' => t('Send by email'), 'tabindex' => 3,