diff options
| author | Frederic Guillot <fred@kanboard.net> | 2015-10-17 22:19:49 -0400 |
|---|---|---|
| committer | Frederic Guillot <fred@kanboard.net> | 2015-10-17 22:19:49 -0400 |
| commit | 09da289c2fb18475f372bee24e885617da484e0b (patch) | |
| tree | 95d1869ba3236ccdd9234d7909fc16c495c84d44 /app/Controller/Project.php | |
| parent | 9283fb88d80cb355ff98364a9a57b657fc511d98 (diff) | |
Move slack, hipchat and jabber integrations to plugins
Diffstat (limited to 'app/Controller/Project.php')
| -rw-r--r-- | app/Controller/Project.php | 37 |
1 files changed, 29 insertions, 8 deletions
diff --git a/app/Controller/Project.php b/app/Controller/Project.php index af01ea77..f30d70e2 100644 --- a/app/Controller/Project.php +++ b/app/Controller/Project.php @@ -89,29 +89,50 @@ 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 * * @access public |
