From b1c5b47d841d5d3c03a904eb7398be84fc73a853 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Tue, 12 Feb 2019 20:24:48 -0800 Subject: Add missing webhook event: task.move.project Fixes #3969 --- app/EventBuilder/TaskEventBuilder.php | 10 ++++++++++ app/Subscriber/NotificationSubscriber.php | 1 + app/Template/notification/task_move_project.php | 5 +++++ 3 files changed, 16 insertions(+) create mode 100644 app/Template/notification/task_move_project.php (limited to 'app') diff --git a/app/EventBuilder/TaskEventBuilder.php b/app/EventBuilder/TaskEventBuilder.php index aa897632..f0191be1 100644 --- a/app/EventBuilder/TaskEventBuilder.php +++ b/app/EventBuilder/TaskEventBuilder.php @@ -150,6 +150,14 @@ class TaskEventBuilder extends BaseEventBuilder return e('%s closed the task #%d', $author, $eventData['task']['id']); case TaskModel::EVENT_OPEN: return e('%s opened the task #%d', $author, $eventData['task']['id']); + case TaskModel::EVENT_MOVE_PROJECT: + return e( + '%s moved the task #%d "%s" to the project "%s"', + $author, + $eventData['task']['id'], + $eventData['task']['title'], + $eventData['task']['project_name'] + ); case TaskModel::EVENT_MOVE_COLUMN: return e( '%s moved the task #%d to the column "%s"', @@ -203,6 +211,8 @@ class TaskEventBuilder extends BaseEventBuilder return e('Task #%d closed', $eventData['task']['id']); case TaskModel::EVENT_OPEN: return e('Task #%d opened', $eventData['task']['id']); + case TaskModel::EVENT_MOVE_PROJECT: + return e('Task #%d "%s" has been moved to the project "%s"', $eventData['task']['id'], $eventData['task']['title'], $eventData['task']['project_name']); case TaskModel::EVENT_MOVE_COLUMN: return e('Column changed for task #%d', $eventData['task']['id']); case TaskModel::EVENT_MOVE_POSITION: diff --git a/app/Subscriber/NotificationSubscriber.php b/app/Subscriber/NotificationSubscriber.php index 6db48b46..8f9b086d 100644 --- a/app/Subscriber/NotificationSubscriber.php +++ b/app/Subscriber/NotificationSubscriber.php @@ -21,6 +21,7 @@ class NotificationSubscriber extends BaseSubscriber implements EventSubscriberIn TaskModel::EVENT_CLOSE => 'handleEvent', TaskModel::EVENT_OPEN => 'handleEvent', TaskModel::EVENT_MOVE_COLUMN => 'handleEvent', + TaskModel::EVENT_MOVE_PROJECT => 'handleEvent', TaskModel::EVENT_MOVE_POSITION => 'handleEvent', TaskModel::EVENT_MOVE_SWIMLANE => 'handleEvent', TaskModel::EVENT_ASSIGNEE_CHANGE => 'handleEvent', diff --git a/app/Template/notification/task_move_project.php b/app/Template/notification/task_move_project.php new file mode 100644 index 00000000..64037bd6 --- /dev/null +++ b/app/Template/notification/task_move_project.php @@ -0,0 +1,5 @@ +

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

+ +

+ +render('notification/footer', array('task' => $task)) ?> -- cgit v1.2.3