Move slack, hipchat and jabber integrations to plugins
This commit is contained in:
@@ -44,7 +44,7 @@ class Config extends Base
|
||||
$values += array('subtask_restriction' => 0, 'subtask_time_tracking' => 0, 'cfd_include_closed_tasks' => 0);
|
||||
break;
|
||||
case 'integrations':
|
||||
$values += array('integration_slack_webhook' => 0, 'integration_hipchat' => 0, 'integration_gravatar' => 0, 'integration_jabber' => 0);
|
||||
$values += array('integration_gravatar' => 0);
|
||||
break;
|
||||
case 'calendar':
|
||||
$values += array('calendar_user_subtasks_time_tracking' => 0);
|
||||
|
||||
@@ -89,28 +89,49 @@ class Project extends Base
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function integration()
|
||||
public function integrations()
|
||||
{
|
||||
$project = $this->getProject();
|
||||
|
||||
if ($this->request->isPost()) {
|
||||
$params = $this->request->getValues();
|
||||
$params += array('hipchat' => 0, 'slack' => 0, 'jabber' => 0);
|
||||
$this->projectIntegration->saveParameters($project['id'], $params);
|
||||
$this->projectMetadata->save($project['id'], $this->request->getValues());
|
||||
$this->session->flash(t('Project updated successfully.'));
|
||||
$this->response->redirect($this->helper->url->to('project', 'integrations', array('project_id' => $project['id'])));
|
||||
}
|
||||
|
||||
$values = $this->projectIntegration->getParameters($project['id']);
|
||||
$values += array('hipchat_api_url' => 'https://api.hipchat.com');
|
||||
|
||||
$this->response->html($this->projectLayout('project/integrations', array(
|
||||
'project' => $project,
|
||||
'title' => t('Integrations'),
|
||||
'webhook_token' => $this->config->get('webhook_token'),
|
||||
'values' => $values,
|
||||
'values' => $this->projectMetadata->getAll($project['id']),
|
||||
'errors' => array(),
|
||||
)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Display project notifications
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function notifications()
|
||||
{
|
||||
$project = $this->getProject();
|
||||
|
||||
if ($this->request->isPost()) {
|
||||
$values = $this->request->getValues();
|
||||
$this->projectNotification->saveSettings($project['id'], $values);
|
||||
$this->session->flash(t('Project updated successfully.'));
|
||||
$this->response->redirect($this->helper->url->to('project', 'notifications', array('project_id' => $project['id'])));
|
||||
}
|
||||
|
||||
$this->response->html($this->projectLayout('project/notifications', array(
|
||||
'notifications' => $this->projectNotification->readSettings($project['id']),
|
||||
'types' => $this->projectNotificationType->getTypes(),
|
||||
'project' => $project,
|
||||
'title' => t('Notifications'),
|
||||
)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a form to edit a project
|
||||
*
|
||||
|
||||
@@ -213,6 +213,28 @@ class User extends Base
|
||||
)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Display user integrations
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function integrations()
|
||||
{
|
||||
$user = $this->getUser();
|
||||
|
||||
if ($this->request->isPost()) {
|
||||
$values = $this->request->getValues();
|
||||
$this->userMetadata->save($user['id'], $values);
|
||||
$this->session->flash(t('User updated successfully.'));
|
||||
$this->response->redirect($this->helper->url->to('user', 'integrations', array('user_id' => $user['id'])));
|
||||
}
|
||||
|
||||
$this->response->html($this->layout('user/integrations', array(
|
||||
'user' => $user,
|
||||
'values' => $this->userMetadata->getall($user['id']),
|
||||
)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Display external accounts
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user