diff --git a/app/Model/Notification.php b/app/Model/Notification.php
index 34500483e..1ef6a88f2 100644
--- a/app/Model/Notification.php
+++ b/app/Model/Notification.php
@@ -268,7 +268,7 @@ class Notification extends Base
{
return $this->template->render(
'notification/'.str_replace('.', '_', $event_name),
- $event_data + array('application_url' => $this->config->get('application_url'))
+ $event_data + array('application_url' => $this->config->get('application_url'), 'colors_list' => $this->color->getList())
);
}
diff --git a/app/Subscriber/NotificationSubscriber.php b/app/Subscriber/NotificationSubscriber.php
index 41fd6aef5..d605c9f35 100644
--- a/app/Subscriber/NotificationSubscriber.php
+++ b/app/Subscriber/NotificationSubscriber.php
@@ -41,6 +41,7 @@ class NotificationSubscriber extends \Core\Base implements EventSubscriberInterf
switch (get_class($event)) {
case 'Event\TaskEvent':
$values['task'] = $this->taskFinder->getDetails($event['task_id']);
+ $values['changes'] = isset($event['changes']) ? $event['changes'] : array();
break;
case 'Event\SubtaskEvent':
$values['subtask'] = $this->subtask->getById($event['id'], true);
diff --git a/app/Template/notification/task_update.php b/app/Template/notification/task_update.php
index ffea49cd8..0352788b1 100644
--- a/app/Template/notification/task_update.php
+++ b/app/Template/notification/task_update.php
@@ -1,43 +1,65 @@
= $this->e($task['title']) ?> (#= $task['id'] ?>)
-
- -
- = dt('Created on %B %e, %Y at %k:%M %p', $task['date_creation']) ?>
-
-
- -
- = dt('Must be done before %B %e, %Y', $task['date_due']) ?>
-
-
-
- -
- = t('Created by %s', $task['creator_name'] ?: $task['creator_username']) ?>
-
-
- -
-
-
- = t('Assigned to %s', $task['assignee_name'] ?: $task['assignee_username']) ?>
-
- = t('There is nobody assigned') ?>
-
-
-
- -
- = t('Column on the board:') ?>
- = $this->e($task['column_title']) ?>
-
- - = t('Task position:').' '.$this->e($task['position']) ?>
-
- -
- = t('Category:') ?> = $this->e($task['category_name']) ?>
-
-
-
+= t('The task have been updated.') ?>
-
- = t('Description') ?>
- = $this->text->markdown($task['description']) ?: t('There is no description.') ?>
+
+ = t('List of changes') ?>
+
+ $value) {
+
+ switch ($field) {
+ case 'title':
+ echo '- '.t('New title: %s', $task['title']).'
';
+ break;
+ case 'owner_id':
+ if (empty($task['owner_id'])) {
+ echo '- '.t('The task is not assigned anymore').'
';
+ }
+ else {
+ echo '- '.t('New assignee: %s', $task['assignee_name'] ?: $task['assignee_username']).'
';
+ }
+ break;
+ case 'category_id':
+ if (empty($task['category_id'])) {
+ echo '- '.t('There is no category now').'
';
+ }
+ else {
+ echo '- '.t('New category: %s', $task['category_name']).'
';
+ }
+ break;
+ case 'color_id':
+ echo '- '.t('New color: %s', $this->text->in($task['color_id'], $colors_list)).'
';
+ break;
+ case 'score':
+ echo '- '.t('New complexity: %d', $task['score']).'
';
+ break;
+ case 'date_due':
+ if (empty($task['date_due'])) {
+ echo '- '.t('The due date have been removed').'
';
+ }
+ else {
+ echo '- '.dt('New due date: %B %e, %Y', $task['date_due']).'
';
+ }
+ break;
+ case 'description':
+ if (empty($task['description'])) {
+ echo '- '.t('There is no description anymore').'
';
+ }
+ break;
+ default:
+ echo '- '.t('The field "%s" have been updated', $field).'
';
+ }
+ }
+
+ ?>
+
+
+
+ = t('New description') ?>
+ = $this->text->markdown($task['description']) ?>
+
= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
\ No newline at end of file