summaryrefslogtreecommitdiff
path: root/app/Model/ProjectActivity.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-03-28 21:37:53 -0400
committerFrederic Guillot <fred@kanboard.net>2015-03-28 21:37:53 -0400
commit5536f6c6ce591ba05a169d2e33b6fb240378d8a4 (patch)
treebac0cb1563d8258965384b97be8d425578f71ef6 /app/Model/ProjectActivity.php
parentf9891a966fb87d2112f174b7c3a1b3a705b73bdd (diff)
Add Slack integration
Diffstat (limited to 'app/Model/ProjectActivity.php')
-rw-r--r--app/Model/ProjectActivity.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/Model/ProjectActivity.php b/app/Model/ProjectActivity.php
index 652cc842..c5fbbd38 100644
--- a/app/Model/ProjectActivity.php
+++ b/app/Model/ProjectActivity.php
@@ -162,7 +162,13 @@ class ProjectActivity extends Base
{
switch ($event['event_name']) {
case Task::EVENT_ASSIGNEE_CHANGE:
- return t('%s change the assignee of the task #%d to %s', $event['author'], $event['task']['id'], $event['task']['assignee_name'] ?: $event['task']['assignee_username']);
+ $assignee = $event['task']['assignee_name'] ?: $event['task']['assignee_username'];
+
+ if (! empty($assignee)) {
+ return t('%s change the assignee of the task #%d to %s', $event['author'], $event['task']['id'], $assignee);
+ }
+
+ return t('%s remove the assignee of the task %s', $event['author'], e('#%d', $event['task']['id']));
case Task::EVENT_UPDATE:
return t('%s updated the task #%d', $event['author'], $event['task']['id']);
case Task::EVENT_CREATE: