diff options
Diffstat (limited to 'app/Controller')
-rw-r--r-- | app/Controller/Config.php | 2 | ||||
-rw-r--r-- | app/Controller/Project.php | 37 | ||||
-rw-r--r-- | app/Controller/User.php | 22 |
3 files changed, 52 insertions, 9 deletions
diff --git a/app/Controller/Config.php b/app/Controller/Config.php index 9a376b36..47b844e4 100644 --- a/app/Controller/Config.php +++ b/app/Controller/Config.php @@ -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); 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 diff --git a/app/Controller/User.php b/app/Controller/User.php index 85b80d79..b5f4edeb 100644 --- a/app/Controller/User.php +++ b/app/Controller/User.php @@ -214,6 +214,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 * * @access public |