summaryrefslogtreecommitdiff
path: root/app/Template/notification
diff options
context:
space:
mode:
authorkent1 <kent1@arscenic.info>2018-04-16 11:57:46 -0700
committerFrédéric Guillot <fred@kanboard.net>2018-04-16 11:57:46 -0700
commitb03357aef341ad55fe28b487131ff4acc851f554 (patch)
tree195fd449b02c4c15dc6fdeafb5e126e8929a2ec6 /app/Template/notification
parent0e5e3b30fd3a8ac0d9606d2a91777fcd587e3157 (diff)
Improve notifications
- Translate subtask status - Translate internal link labels - Add link to tasks and projects in overdue notifications
Diffstat (limited to 'app/Template/notification')
-rw-r--r--app/Template/notification/footer.php4
-rw-r--r--app/Template/notification/subtask_create.php12
-rw-r--r--app/Template/notification/subtask_delete.php2
-rw-r--r--app/Template/notification/subtask_update.php5
-rw-r--r--app/Template/notification/task_internal_link_create_update.php2
-rw-r--r--app/Template/notification/task_internal_link_delete.php2
-rw-r--r--app/Template/notification/task_overdue.php12
7 files changed, 24 insertions, 15 deletions
diff --git a/app/Template/notification/footer.php b/app/Template/notification/footer.php
index b057a60c..663a591a 100644
--- a/app/Template/notification/footer.php
+++ b/app/Template/notification/footer.php
@@ -2,6 +2,8 @@
Kanboard
<?php if ($this->app->config('application_url') != ''): ?>
- - <?= $this->url->absoluteLink(t('view the task on Kanboard'), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
+ <?php if (isset($task['id'])): ?>
+ - <?= $this->url->absoluteLink(t('view the task on Kanboard'), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
+ <?php endif ?>
- <?= $this->url->absoluteLink(t('view the board on Kanboard'), 'BoardViewController', 'show', array('project_id' => $task['project_id'])) ?>
<?php endif ?>
diff --git a/app/Template/notification/subtask_create.php b/app/Template/notification/subtask_create.php
index 23df3666..17271724 100644
--- a/app/Template/notification/subtask_create.php
+++ b/app/Template/notification/subtask_create.php
@@ -4,14 +4,14 @@
<ul>
<li><?= t('Title:') ?> <?= $this->text->e($subtask['title']) ?></li>
- <li><?= t('Status:') ?> <?= $this->text->e($subtask['status_name']) ?></li>
+ <li><?= t('Status:') ?> <?= t($subtask['status_name']) ?></li>
<li><?= t('Assignee:') ?> <?= $this->text->e($subtask['name'] ?: $subtask['username'] ?: '?') ?></li>
- <li>
- <?= t('Time tracking:') ?>
- <?php if (! empty($subtask['time_estimated'])): ?>
+ <?php if (! empty($subtask['time_estimated'])): ?>
+ <li>
+ <?= t('Time tracking:') ?>
<strong><?= $this->text->e($subtask['time_estimated']).'h' ?></strong> <?= t('estimated') ?>
- <?php endif ?>
- </li>
+ </li>
+ <?php endif ?>
</ul>
<?= $this->render('notification/footer', array('task' => $task)) ?> \ No newline at end of file
diff --git a/app/Template/notification/subtask_delete.php b/app/Template/notification/subtask_delete.php
index 24562eba..1f5b12c4 100644
--- a/app/Template/notification/subtask_delete.php
+++ b/app/Template/notification/subtask_delete.php
@@ -4,7 +4,7 @@
<ul>
<li><?= t('Title:') ?> <?= $this->text->e($subtask['title']) ?></li>
- <li><?= t('Status:') ?> <?= $this->text->e($subtask['status_name']) ?></li>
+ <li><?= t('Status:') ?> <?= t($subtask['status_name']) ?></li>
<li><?= t('Assignee:') ?> <?= $this->text->e($subtask['name'] ?: $subtask['username'] ?: '?') ?></li>
</ul>
diff --git a/app/Template/notification/subtask_update.php b/app/Template/notification/subtask_update.php
index 0c235942..a6c4e9cc 100644
--- a/app/Template/notification/subtask_update.php
+++ b/app/Template/notification/subtask_update.php
@@ -4,18 +4,19 @@
<ul>
<li><?= t('Title:') ?> <?= $this->text->e($subtask['title']) ?></li>
- <li><?= t('Status:') ?> <?= $this->text->e($subtask['status_name']) ?></li>
+ <li><?= t('Status:') ?> <?= t($subtask['status_name']) ?></li>
<li><?= t('Assignee:') ?> <?= $this->text->e($subtask['name'] ?: $subtask['username'] ?: '?') ?></li>
+ <?php if (! empty($subtask['time_spent']) || ! empty($subtask['time_estimated'])): ?>
<li>
<?= t('Time tracking:') ?>
<?php if (! empty($subtask['time_spent'])): ?>
<strong><?= $this->text->e($subtask['time_spent']).'h' ?></strong> <?= t('spent') ?>
<?php endif ?>
-
<?php if (! empty($subtask['time_estimated'])): ?>
<strong><?= $this->text->e($subtask['time_estimated']).'h' ?></strong> <?= t('estimated') ?>
<?php endif ?>
</li>
+ <?php endif ?>
</ul>
<?= $this->render('notification/footer', array('task' => $task)) ?> \ No newline at end of file
diff --git a/app/Template/notification/task_internal_link_create_update.php b/app/Template/notification/task_internal_link_create_update.php
index eab96bfa..4a88ab78 100644
--- a/app/Template/notification/task_internal_link_create_update.php
+++ b/app/Template/notification/task_internal_link_create_update.php
@@ -3,7 +3,7 @@
<p>
<?= e('This task is now linked to the task %s with the relation "%s"',
$this->url->absoluteLink(t('#%d', $task_link['opposite_task_id']), 'TaskViewController', 'show', array('task_id' => $task_link['opposite_task_id'])),
- $this->text->e($task_link['label'])) ?>
+ e($task_link['label'])) ?>
</p>
<?= $this->render('notification/footer', array('task' => $task)) ?>
diff --git a/app/Template/notification/task_internal_link_delete.php b/app/Template/notification/task_internal_link_delete.php
index e4d57025..2b4b8444 100644
--- a/app/Template/notification/task_internal_link_delete.php
+++ b/app/Template/notification/task_internal_link_delete.php
@@ -2,7 +2,7 @@
<p>
<?= e('The link with the relation "%s" to the task %s has been removed',
- $this->text->e($task_link['label']),
+ e($task_link['label']),
$this->url->absoluteLink(t('#%d', $task_link['opposite_task_id']), 'TaskViewController', 'show', array('task_id' => $task_link['opposite_task_id']))) ?>
</p>
diff --git a/app/Template/notification/task_overdue.php b/app/Template/notification/task_overdue.php
index 2ad4c14d..cb954c0b 100644
--- a/app/Template/notification/task_overdue.php
+++ b/app/Template/notification/task_overdue.php
@@ -13,14 +13,20 @@
<tr style="overflow: hidden; background: #fff; text-align: left; padding-top: .5em; padding-bottom: .5em; padding-left: 3px; padding-right: 3px;">
<td style="border: 1px solid #eee;">#<?= $task['id'] ?></td>
<td style="border: 1px solid #eee;">
- <?php if (! empty($application_url)): ?>
+ <?php if ($this->app->config('application_url') !== ''): ?>
<?= $this->url->absoluteLink($this->text->e($task['title']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
<?php else: ?>
<?= $this->text->e($task['title']) ?>
<?php endif ?>
</td>
<td style="border: 1px solid #eee;"><?= $this->dt->datetime($task['date_due']) ?></td>
- <td style="border: 1px solid #eee;"><?= $this->text->e($task['project_name']) ?></td>
+ <td style="border: 1px solid #eee;">
+ <?php if ($this->app->config('application_url') !== ''): ?>
+ <?= $this->url->absoluteLink($this->text->e($task['project_name']), 'BoardViewController', 'show', array('project_id' => $task['project_id'])) ?>
+ <?php else: ?>
+ <?= $this->text->e($task['project_name']) ?>
+ <?php endif ?>
+ </td>
<td style="border: 1px solid #eee;">
<?php if (! empty($task['assignee_username'])): ?>
<?= $this->text->e($task['assignee_name'] ?: $task['assignee_username']) ?>
@@ -28,4 +34,4 @@
</td>
</tr>
<?php endforeach ?>
-</table>
+</table> \ No newline at end of file