summaryrefslogtreecommitdiff
path: root/app/Controller
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-04-18 18:44:45 -0400
committerFrederic Guillot <fred@kanboard.net>2015-04-18 18:44:45 -0400
commit370b5a0fd7c1dba60e3b973506ba087adba42be0 (patch)
tree8da109b4fc90062d6eebb69d4ae2efca4da1bac3 /app/Controller
parentf53bb88d10836e5c31efb958683d8bf3829eecbf (diff)
Add Slack and Hipchat integrations for each projects
Diffstat (limited to 'app/Controller')
-rw-r--r--app/Controller/Base.php1
-rw-r--r--app/Controller/Project.php11
2 files changed, 12 insertions, 0 deletions
diff --git a/app/Controller/Base.php b/app/Controller/Base.php
index f4b99a79..869d5d59 100644
--- a/app/Controller/Base.php
+++ b/app/Controller/Base.php
@@ -43,6 +43,7 @@ use Symfony\Component\EventDispatcher\Event;
* @property \Model\ProjectAnalytic $projectAnalytic
* @property \Model\ProjectActivity $projectActivity
* @property \Model\ProjectDailySummary $projectDailySummary
+ * @property \Model\ProjectIntegration $projectIntegration
* @property \Model\Subtask $subtask
* @property \Model\SubtaskForecast $subtaskForecast
* @property \Model\Swimlane $swimlane
diff --git a/app/Controller/Project.php b/app/Controller/Project.php
index 4e01271a..165ed2df 100644
--- a/app/Controller/Project.php
+++ b/app/Controller/Project.php
@@ -95,10 +95,21 @@ class Project extends Base
{
$project = $this->getProject();
+ if ($this->request->isPost()) {
+ $params = $this->request->getValues();
+ $params += array('hipchat' => 0, 'slack' => 0);
+ $this->projectIntegration->saveParameters($project['id'], $params);
+ }
+
+ $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,
+ 'errors' => array(),
)));
}