summaryrefslogtreecommitdiff
path: root/app/Model/ProjectActivity.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-10-17 22:19:49 -0400
committerFrederic Guillot <fred@kanboard.net>2015-10-17 22:19:49 -0400
commit09da289c2fb18475f372bee24e885617da484e0b (patch)
tree95d1869ba3236ccdd9234d7909fc16c495c84d44 /app/Model/ProjectActivity.php
parent9283fb88d80cb355ff98364a9a57b657fc511d98 (diff)
Move slack, hipchat and jabber integrations to plugins
Diffstat (limited to 'app/Model/ProjectActivity.php')
-rw-r--r--app/Model/ProjectActivity.php52
1 files changed, 1 insertions, 51 deletions
diff --git a/app/Model/ProjectActivity.php b/app/Model/ProjectActivity.php
index 032c1fa6..309bab9a 100644
--- a/app/Model/ProjectActivity.php
+++ b/app/Model/ProjectActivity.php
@@ -153,7 +153,7 @@ class ProjectActivity extends Base
unset($event['data']);
$event['author'] = $event['author_name'] ?: $event['author_username'];
- $event['event_title'] = $this->getTitle($event);
+ $event['event_title'] = $this->notification->getTitleWithAuthor($event['author'], $event['event_name'], $event);
$event['event_content'] = $this->getContent($event);
}
@@ -196,56 +196,6 @@ class ProjectActivity extends Base
}
/**
- * Get the event title (translated)
- *
- * @access public
- * @param array $event Event properties
- * @return string
- */
- public function getTitle(array $event)
- {
- switch ($event['event_name']) {
- case Task::EVENT_ASSIGNEE_CHANGE:
- $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:
- return t('%s created the task #%d', $event['author'], $event['task']['id']);
- case Task::EVENT_CLOSE:
- return t('%s closed the task #%d', $event['author'], $event['task']['id']);
- case Task::EVENT_OPEN:
- return t('%s open the task #%d', $event['author'], $event['task']['id']);
- case Task::EVENT_MOVE_COLUMN:
- 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:
- return t('%s created a subtask for the task #%d', $event['author'], $event['task']['id']);
- case Comment::EVENT_UPDATE:
- return t('%s updated a comment on the task #%d', $event['author'], $event['task']['id']);
- case Comment::EVENT_CREATE:
- return t('%s commented on the task #%d', $event['author'], $event['task']['id']);
- case File::EVENT_CREATE:
- return t('%s attached a file to the task #%d', $event['author'], $event['task']['id']);
- default:
- return '';
- }
- }
-
- /**
* Decode event data, supports unserialize() and json_decode()
*
* @access public