From e27148dfd8192ed3052adb8397a0f8c4ed47916d Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 3 Jun 2017 12:03:46 -0400 Subject: 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 e6faec1f..c4a979ed 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 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 @@ 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, -- cgit v1.2.3