From 5536f6c6ce591ba05a169d2e33b6fb240378d8a4 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 28 Mar 2015 21:37:53 -0400 Subject: Add Slack integration --- app/Template/config/integrations.php | 22 ++++++++++++++++++++++ app/Template/config/sidebar.php | 3 +++ app/Template/event/task_assignee_change.php | 16 +++++++++++----- 3 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 app/Template/config/integrations.php (limited to 'app/Template') diff --git a/app/Template/config/integrations.php b/app/Template/config/integrations.php new file mode 100644 index 00000000..104ebc16 --- /dev/null +++ b/app/Template/config/integrations.php @@ -0,0 +1,22 @@ + + +
+ + formCsrf() ?> + +

 

+
+ formCheckbox('integration_slack_webhook', t('Send notifications to a Slack channel'), 1, $values['integration_slack_webhook'] == 1) ?> + + formLabel(t('Webhook URL'), 'integration_slack_webhook_url') ?> + formText('integration_slack_webhook_url', $values, $errors) ?> + +

+
+ +
+ +
+
\ No newline at end of file diff --git a/app/Template/config/sidebar.php b/app/Template/config/sidebar.php index 2e81d48a..a4f9d8e3 100644 --- a/app/Template/config/sidebar.php +++ b/app/Template/config/sidebar.php @@ -16,6 +16,9 @@
  • a(t('Currency rates'), 'currency', 'index') ?>
  • +
  • + a(t('Integrations'), 'config', 'integrations') ?> +
  • a(t('Webhooks'), 'config', 'webhook') ?>
  • diff --git a/app/Template/event/task_assignee_change.php b/app/Template/event/task_assignee_change.php index 6eac412b..22ed936b 100644 --- a/app/Template/event/task_assignee_change.php +++ b/app/Template/event/task_assignee_change.php @@ -1,9 +1,15 @@

    - e($author), - $this->a(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), - $this->e($task['assignee_name'] ?: $task['assignee_username']) - ) ?> + + + + e($author), + $this->a(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), + $this->e($assignee) + ) ?> + + e($author), $this->a(t('#%d', $task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']))) ?> +

    e($task['title']) ?> -- cgit v1.2.3