Send comments by email
This commit is contained in:
@@ -8,26 +8,28 @@
|
||||
<?php endif ?>
|
||||
|
||||
<small class="comment-date"><?= t('Created at:') ?> <?= $this->dt->datetime($comment['date_creation']) ?></small>
|
||||
<small class="comment-date"><?= t('Updated at:')?> <?= $this->dt->datetime($comment['date_modification']) ?></small>
|
||||
<small class="comment-date"><?= t('Updated at:') ?> <?= $this->dt->datetime($comment['date_modification']) ?></small>
|
||||
</div>
|
||||
|
||||
<?php if (! isset($hide_actions)): ?>
|
||||
<div class="comment-actions">
|
||||
<div class="comment-actions">
|
||||
<div class="dropdown">
|
||||
<a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-cog"></i><i class="fa fa-caret-down"></i></a>
|
||||
<ul>
|
||||
<li>
|
||||
<i class="fa fa-link fa-fw"></i>
|
||||
<a href="#comment-<?= $comment['id'] ?>"><?= t('link') ?></a>
|
||||
<?= $this->url->icon('link', t('Link'), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', '', $this->app->isAjax(), 'comment-'.$comment['id']) ?>
|
||||
</li>
|
||||
<?php if ($editable && ($this->user->isAdmin() || $this->user->isCurrentUser($comment['user_id']))): ?>
|
||||
<li>
|
||||
<?= $this->modal->medium('edit', t('edit'), 'CommentController', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id'])) ?>
|
||||
<?= $this->modal->medium('edit', t('Edit'), 'CommentController', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id'])) ?>
|
||||
</li>
|
||||
<li>
|
||||
<?= $this->modal->confirm('trash-o', t('remove'), 'CommentController', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id'])) ?>
|
||||
<?= $this->modal->confirm('trash-o', t('Remove'), 'CommentController', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id'])) ?>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<div class="comment-content">
|
||||
|
||||
@@ -1,20 +1,25 @@
|
||||
<div class="page-header">
|
||||
<h2><?= $this->text->e($task['title']) ?> > <?= t('Comments') ?></h2>
|
||||
<h2><?= $this->text->e($task['title']) ?></h2>
|
||||
<?php if (!isset($is_public) || !$is_public): ?>
|
||||
<div class="comment-sorting">
|
||||
<small>
|
||||
<?= $this->url->icon('sort', t('change sorting'), 'CommentListController', 'toggleSorting', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'js-modal-replace') ?>
|
||||
</small>
|
||||
</div>
|
||||
<ul>
|
||||
<li>
|
||||
<?= $this->url->icon('sort', t('Change sorting'), 'CommentListController', 'toggleSorting', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'js-modal-replace') ?>
|
||||
</li>
|
||||
<?php if ($editable): ?>
|
||||
<li>
|
||||
<?= $this->modal->medium('paper-plane', t('Send by email'), 'CommentMailController', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
<div class="comments">
|
||||
<?php foreach ($comments as $comment): ?>
|
||||
<?= $this->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,
|
||||
)) ?>
|
||||
<?php endforeach ?>
|
||||
|
||||
21
app/Template/comment_mail/create.php
Normal file
21
app/Template/comment_mail/create.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<div class="page-header">
|
||||
<h2><?= t('Create and send comment by email') ?></h2>
|
||||
</div>
|
||||
<form method="post" action="<?= $this->url->href('CommentMailController', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off">
|
||||
<?= $this->form->csrf() ?>
|
||||
<?= $this->form->hidden('task_id', $values) ?>
|
||||
<?= $this->form->hidden('user_id', $values) ?>
|
||||
|
||||
<?= $this->form->label(t('Email'), 'email') ?>
|
||||
<?= $this->form->email('email', $values, $errors, array('autofocus', 'required', 'tabindex="1"')) ?>
|
||||
|
||||
<?= $this->form->label(t('Subject'), 'subject') ?>
|
||||
<?= $this->form->text('subject', $values, $errors, array('required', 'tabindex="2"')) ?>
|
||||
|
||||
<?= $this->form->textEditor('comment', $values, $errors, array('required' => true, 'tabindex' => 3)) ?>
|
||||
|
||||
<?= $this->modal->submitButtons(array(
|
||||
'submitLabel' => t('Send by email'),
|
||||
'tabindex' => 4,
|
||||
)) ?>
|
||||
</form>
|
||||
1
app/Template/comment_mail/email.php
Normal file
1
app/Template/comment_mail/email.php
Normal file
@@ -0,0 +1 @@
|
||||
<?= $this->text->markdown($email['comment'], true) ?>
|
||||
@@ -6,25 +6,28 @@
|
||||
<?php if (!isset($is_public) || !$is_public): ?>
|
||||
<div class="comment-sorting">
|
||||
<small>
|
||||
<?= $this->url->icon('sort', t('change sorting'), 'CommentController', 'toggleSorting', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
|
||||
<?= $this->url->icon('sort', t('Change sorting'), 'CommentController', 'toggleSorting', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
|
||||
<?php if ($editable): ?>
|
||||
<?= $this->modal->medium('paper-plane', t('Send by email'), 'CommentMailController', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
|
||||
<?php endif ?>
|
||||
</small>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<?php foreach ($comments as $comment): ?>
|
||||
<?= $this->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,
|
||||
)) ?>
|
||||
<?php endforeach ?>
|
||||
|
||||
<?php if ($editable): ?>
|
||||
<?= $this->render('task_comments/create', array(
|
||||
'values' => array(),
|
||||
'errors' => array(),
|
||||
'task' => $task,
|
||||
'values' => array(),
|
||||
'errors' => array(),
|
||||
'task' => $task,
|
||||
)) ?>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user