diff --git a/app/Helper/Task.php b/app/Helper/Task.php index b3931cdbd..13bdb07a7 100644 --- a/app/Helper/Task.php +++ b/app/Helper/Task.php @@ -37,6 +37,11 @@ class Task extends \Core\Base return t('%dd', ($now - $timestamp) / 86400); } + public function getColors() + { + return $this->color->getList(); + } + public function recurrenceTriggers() { return $this->task->getRecurrenceTriggerList(); diff --git a/app/Model/Notification.php b/app/Model/Notification.php index 1ef6a88f2..d18e7642e 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'), 'colors_list' => $this->color->getList()) + $event_data + array('application_url' => $this->config->get('application_url')) ); } @@ -311,13 +311,16 @@ class Notification extends Base $subject = $this->getStandardMailSubject(e('Task opened'), $event_data); break; case Task::EVENT_MOVE_COLUMN: - $subject = $this->getStandardMailSubject(e('Column Change'), $event_data); + $subject = $this->getStandardMailSubject(e('Column change'), $event_data); break; case Task::EVENT_MOVE_POSITION: - $subject = $this->getStandardMailSubject(e('Position Change'), $event_data); + $subject = $this->getStandardMailSubject(e('Position change'), $event_data); + break; + case Task::EVENT_MOVE_SWIMLANE: + $subject = $this->getStandardMailSubject(e('Swimlane change'), $event_data); break; case Task::EVENT_ASSIGNEE_CHANGE: - $subject = $this->getStandardMailSubject(e('Assignee Change'), $event_data); + $subject = $this->getStandardMailSubject(e('Assignee change'), $event_data); break; case Task::EVENT_OVERDUE: $subject = e('[%s] Overdue tasks', $event_data['project_name']); diff --git a/app/Model/ProjectActivity.php b/app/Model/ProjectActivity.php index 27f1cfcde..a9222fcc7 100644 --- a/app/Model/ProjectActivity.php +++ b/app/Model/ProjectActivity.php @@ -227,6 +227,11 @@ class ProjectActivity extends Base return t('%s moved the task #%d to the column "%s"', $event['author'], $event['task']['id'], $event['task']['column_title']); case Task::EVENT_MOVE_POSITION: return t('%s moved the task #%d to the position %d in the column "%s"', $event['author'], $event['task']['id'], $event['task']['position'], $event['task']['column_title']); + case Task::EVENT_MOVE_SWIMLANE: + if ($event['task']['swimlane_id'] == 0) { + return t('%s moved the task #%d to the first swimlane', $event['author'], $event['task']['id']); + } + return t('%s moved the task #%d to the swimlane "%s"', $event['author'], $event['task']['id'], $event['task']['swimlane_name']); case Subtask::EVENT_UPDATE: return t('%s updated a subtask for the task #%d', $event['author'], $event['task']['id']); case Subtask::EVENT_CREATE: diff --git a/app/Model/TaskFinder.php b/app/Model/TaskFinder.php index 5a1d33c6a..327b480f4 100644 --- a/app/Model/TaskFinder.php +++ b/app/Model/TaskFinder.php @@ -263,6 +263,7 @@ class TaskFinder extends Base tasks.recurrence_parent, tasks.recurrence_child, project_has_categories.name AS category_name, + swimlanes.name AS swimlane_name, projects.name AS project_name, columns.title AS column_title, users.username AS assignee_username, @@ -275,6 +276,7 @@ class TaskFinder extends Base LEFT JOIN project_has_categories ON project_has_categories.id = tasks.category_id LEFT JOIN projects ON projects.id = tasks.project_id LEFT JOIN columns ON columns.id = tasks.column_id + LEFT JOIN swimlanes ON swimlanes.id = tasks.swimlane_id WHERE tasks.id = ? '; diff --git a/app/Subscriber/NotificationSubscriber.php b/app/Subscriber/NotificationSubscriber.php index d605c9f35..b99c29450 100644 --- a/app/Subscriber/NotificationSubscriber.php +++ b/app/Subscriber/NotificationSubscriber.php @@ -20,6 +20,7 @@ class NotificationSubscriber extends \Core\Base implements EventSubscriberInterf Task::EVENT_OPEN => array('execute', 0), Task::EVENT_MOVE_COLUMN => array('execute', 0), Task::EVENT_MOVE_POSITION => array('execute', 0), + Task::EVENT_MOVE_SWIMLANE => array('execute', 0), Task::EVENT_ASSIGNEE_CHANGE => array('execute', 0), Subtask::EVENT_CREATE => array('execute', 0), Subtask::EVENT_UPDATE => array('execute', 0), diff --git a/app/Subscriber/ProjectActivitySubscriber.php b/app/Subscriber/ProjectActivitySubscriber.php index 31f771f84..82b13d8e3 100644 --- a/app/Subscriber/ProjectActivitySubscriber.php +++ b/app/Subscriber/ProjectActivitySubscriber.php @@ -20,6 +20,7 @@ class ProjectActivitySubscriber extends \Core\Base implements EventSubscriberInt Task::EVENT_OPEN => array('execute', 0), Task::EVENT_MOVE_COLUMN => array('execute', 0), Task::EVENT_MOVE_POSITION => array('execute', 0), + Task::EVENT_MOVE_SWIMLANE => array('execute', 0), Comment::EVENT_UPDATE => array('execute', 0), Comment::EVENT_CREATE => array('execute', 0), Subtask::EVENT_UPDATE => array('execute', 0), @@ -58,6 +59,7 @@ class ProjectActivitySubscriber extends \Core\Base implements EventSubscriberInt { $values = array(); $values['task'] = $this->taskFinder->getDetails($event['task_id']); + $values['changes'] = isset($event['changes']) ? $event['changes'] : array(); switch (get_class($event)) { case 'Event\SubtaskEvent': diff --git a/app/Template/event/events.php b/app/Template/event/events.php index 2dc798711..971f6587e 100644 --- a/app/Template/event/events.php +++ b/app/Template/event/events.php @@ -7,6 +7,8 @@

text->contains($event['event_name'], 'subtask')): ?> + text->contains($event['event_name'], 'task.move')): ?> + text->contains($event['event_name'], 'task')): ?> text->contains($event['event_name'], 'comment')): ?> diff --git a/app/Template/event/task_move_swimlane.php b/app/Template/event/task_move_swimlane.php new file mode 100644 index 000000000..ca440dbf9 --- /dev/null +++ b/app/Template/event/task_move_swimlane.php @@ -0,0 +1,19 @@ +user->avatar($email, $author) ?> + +

+ + e($author), + $this->url->link(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) + ) ?> + + e($author), + $this->url->link(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), + $this->e($task['swimlane_name']) + ) ?> + +

+

+ e($task['title']) ?> +

\ No newline at end of file diff --git a/app/Template/event/task_update.php b/app/Template/event/task_update.php index 7d036d438..e8254bcb8 100644 --- a/app/Template/event/task_update.php +++ b/app/Template/event/task_update.php @@ -8,4 +8,9 @@

e($task['title']) ?> + +

+ render('task/changes', array('changes' => $changes, 'task' => $task)) ?> +
+

\ No newline at end of file diff --git a/app/Template/notification/task_move_swimlane.php b/app/Template/notification/task_move_swimlane.php new file mode 100644 index 000000000..04de7cc65 --- /dev/null +++ b/app/Template/notification/task_move_swimlane.php @@ -0,0 +1,19 @@ +

e($task['title']) ?> (#)

+ + + +render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?> \ No newline at end of file diff --git a/app/Template/notification/task_update.php b/app/Template/notification/task_update.php index 0352788b1..54f5c6d1c 100644 --- a/app/Template/notification/task_update.php +++ b/app/Template/notification/task_update.php @@ -1,65 +1,4 @@

e($task['title']) ?> (#)

- - - -

- - - -

- text->markdown($task['description']) ?> - - - +render('task/changes', array('changes' => $changes, 'task' => $task)) ?> render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?> \ No newline at end of file diff --git a/app/Template/task/changes.php b/app/Template/task/changes.php new file mode 100644 index 000000000..c7fc0d52b --- /dev/null +++ b/app/Template/task/changes.php @@ -0,0 +1,78 @@ + + + + +

+
text->markdown($task['description']) ?>
+ + \ No newline at end of file diff --git a/assets/css/app.css b/assets/css/app.css index 6a0315108..73df92fcf 100644 --- a/assets/css/app.css +++ b/assets/css/app.css @@ -264,7 +264,6 @@ select { select:focus { outline: 0; - font-weight: bold; } ::-webkit-input-placeholder { @@ -1369,7 +1368,17 @@ span.task-board-date-overdue { .activity-description .markdown { margin-top: 10px; color: #555; -}/* dashboard */ +} + +.activity-changes { + margin-top: 10px; + font-size: 0.85em; +} + +.activity-changes ul { + margin-left: 25px; +} +/* dashboard */ @media only screen and (min-width: 1280px) { diff --git a/assets/css/src/activity.css b/assets/css/src/activity.css index 2d44aa5dc..3dd18a9d3 100644 --- a/assets/css/src/activity.css +++ b/assets/css/src/activity.css @@ -39,4 +39,13 @@ .activity-description .markdown { margin-top: 10px; color: #555; -} \ No newline at end of file +} + +.activity-changes { + margin-top: 10px; + font-size: 0.85em; +} + +.activity-changes ul { + margin-left: 25px; +} diff --git a/assets/css/src/form.css b/assets/css/src/form.css index 606cdd70a..dc1011639 100644 --- a/assets/css/src/form.css +++ b/assets/css/src/form.css @@ -59,7 +59,6 @@ select { select:focus { outline: 0; - font-weight: bold; } ::-webkit-input-placeholder { diff --git a/tests/units/NotificationTest.php b/tests/units/NotificationTest.php index f86d02e1f..92b839c4d 100644 --- a/tests/units/NotificationTest.php +++ b/tests/units/NotificationTest.php @@ -260,7 +260,7 @@ class NotificationTest extends Base $this->assertNotEmpty($file); foreach (Subscriber\NotificationSubscriber::getSubscribedEvents() as $event => $values) { - $this->assertNotEmpty($n->getMailContent($event, array('task' => $task, 'comment' => $comment, 'subtask' => $subtask, 'file' => $file))); + $this->assertNotEmpty($n->getMailContent($event, array('task' => $task, 'comment' => $comment, 'subtask' => $subtask, 'file' => $file, 'changes' => array()))); } }