From b4dc602381a367ce9ed1a1bbe28b7903976fdabe Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 18 Feb 2017 18:25:46 -0500 Subject: Send comments by email --- app/Template/comment/show.php | 14 ++++++++------ app/Template/comment_list/show.php | 25 +++++++++++++++---------- app/Template/comment_mail/create.php | 21 +++++++++++++++++++++ app/Template/comment_mail/email.php | 1 + app/Template/task_comments/show.php | 19 +++++++++++-------- 5 files changed, 56 insertions(+), 24 deletions(-) create mode 100644 app/Template/comment_mail/create.php create mode 100644 app/Template/comment_mail/email.php (limited to 'app/Template') diff --git a/app/Template/comment/show.php b/app/Template/comment/show.php index d8470c24..5f15ffd6 100644 --- a/app/Template/comment/show.php +++ b/app/Template/comment/show.php @@ -8,26 +8,28 @@ dt->datetime($comment['date_creation']) ?> - dt->datetime($comment['date_modification']) ?> + dt->datetime($comment['date_modification']) ?> -
+
+ +
diff --git a/app/Template/comment_list/show.php b/app/Template/comment_list/show.php index 6e362560..4b6b765d 100644 --- a/app/Template/comment_list/show.php +++ b/app/Template/comment_list/show.php @@ -1,20 +1,25 @@
render('comment/show', array( - 'comment' => $comment, - 'task' => $task, - 'project' => $project, - 'editable' => $editable, + 'comment' => $comment, + 'task' => $task, + 'project' => $project, + 'editable' => $editable, 'is_public' => isset($is_public) && $is_public, )) ?> diff --git a/app/Template/comment_mail/create.php b/app/Template/comment_mail/create.php new file mode 100644 index 00000000..57ddeb39 --- /dev/null +++ b/app/Template/comment_mail/create.php @@ -0,0 +1,21 @@ + +
+ form->csrf() ?> + form->hidden('task_id', $values) ?> + form->hidden('user_id', $values) ?> + + form->label(t('Email'), 'email') ?> + form->email('email', $values, $errors, array('autofocus', 'required', 'tabindex="1"')) ?> + + form->label(t('Subject'), 'subject') ?> + form->text('subject', $values, $errors, array('required', 'tabindex="2"')) ?> + + form->textEditor('comment', $values, $errors, array('required' => true, 'tabindex' => 3)) ?> + + modal->submitButtons(array( + 'submitLabel' => t('Send by email'), + 'tabindex' => 4, + )) ?> +
diff --git a/app/Template/comment_mail/email.php b/app/Template/comment_mail/email.php new file mode 100644 index 00000000..a89284f4 --- /dev/null +++ b/app/Template/comment_mail/email.php @@ -0,0 +1 @@ +text->markdown($email['comment'], true) ?> diff --git a/app/Template/task_comments/show.php b/app/Template/task_comments/show.php index 18200bc8..d34e5e95 100644 --- a/app/Template/task_comments/show.php +++ b/app/Template/task_comments/show.php @@ -6,25 +6,28 @@
- url->icon('sort', t('change sorting'), 'CommentController', 'toggleSorting', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->icon('sort', t('Change sorting'), 'CommentController', 'toggleSorting', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + + modal->medium('paper-plane', t('Send by email'), 'CommentMailController', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> +
render('comment/show', array( - 'comment' => $comment, - 'task' => $task, - 'project' => $project, - 'editable' => $editable, + 'comment' => $comment, + 'task' => $task, + 'project' => $project, + 'editable' => $editable, 'is_public' => isset($is_public) && $is_public, )) ?> render('task_comments/create', array( - 'values' => array(), - 'errors' => array(), - 'task' => $task, + 'values' => array(), + 'errors' => array(), + 'task' => $task, )) ?>
-- cgit v1.2.3