Move slack, hipchat and jabber integrations to plugins
This commit is contained in:
@@ -22,8 +22,44 @@ class ProjectNotification extends Base
|
||||
{
|
||||
$project = $this->project->getById($project_id);
|
||||
|
||||
foreach ($this->projectNotificationType->getSelectedTypes($project_id) as $type) {
|
||||
$types = array_merge(
|
||||
$this->projectNotificationType->getHiddenTypes(),
|
||||
$this->projectNotificationType->getSelectedTypes($project_id)
|
||||
);
|
||||
|
||||
foreach ($types as $type) {
|
||||
$this->projectNotificationType->getType($type)->notifyProject($project, $event_name, $event_data);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Save settings for the given project
|
||||
*
|
||||
* @access public
|
||||
* @param integer $project_id
|
||||
* @param array $values
|
||||
*/
|
||||
public function saveSettings($project_id, array $values)
|
||||
{
|
||||
$this->db->startTransaction();
|
||||
|
||||
$types = empty($values['notification_types']) ? array() : array_keys($values['notification_types']);
|
||||
$this->projectNotificationType->saveSelectedTypes($project_id, $types);
|
||||
|
||||
$this->db->closeTransaction();
|
||||
}
|
||||
|
||||
/**
|
||||
* Read user settings to display the form
|
||||
*
|
||||
* @access public
|
||||
* @param integer $project_id
|
||||
* @return array
|
||||
*/
|
||||
public function readSettings($project_id)
|
||||
{
|
||||
return array(
|
||||
'notification_types' => $this->projectNotificationType->getSelectedTypes($project_id),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user