summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2019-02-12 20:24:48 -0800
committerFrédéric Guillot <fred@kanboard.net>2019-02-13 18:23:12 -0800
commitb1c5b47d841d5d3c03a904eb7398be84fc73a853 (patch)
treec5a4dcba9ad39b61181df2b444a0c7cfd462beb4 /app
parent029538846181309e9135a17f893e874b2e90f72b (diff)
Add missing webhook event: task.move.project
Fixes #3969
Diffstat (limited to 'app')
-rw-r--r--app/EventBuilder/TaskEventBuilder.php10
-rw-r--r--app/Subscriber/NotificationSubscriber.php1
-rw-r--r--app/Template/notification/task_move_project.php5
3 files changed, 16 insertions, 0 deletions
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 @@
+<h2><?= $this->text->e($task['title']) ?> (#<?= $task['id'] ?>)</h2>
+
+<p><?= t('Task #%d "%s" has been moved to the project "%s"', $task['id'], $task['title'], $task['project_name']) ?></p>
+
+<?= $this->render('notification/footer', array('task' => $task)) ?>