Move slack, hipchat and jabber integrations to plugins

This commit is contained in:
Frederic Guillot
2015-10-17 22:19:49 -04:00
parent 9283fb88d8
commit 09da289c2f
68 changed files with 544 additions and 1644 deletions

View File

@@ -4,12 +4,9 @@ Notifications
Kanboard est capable d'envoyer des notifications via différents canaux :
- Email
- Jabber/XMPP
- Hipchat
- Slack
- Web (Liste de message non lus)
En fait, pour Jabber/Hipchat/Slack les notifications sont envoyées dans des salons de discussion car ils sont configurés au niveau projet.
Cependant, les notifications par email sont envoyées à un individu.
Vous pouvez ajouter d'autres cannaux an ajoutant des extensions comme par exemple Hipchat, Slack ou encore Jabber.
Configuration
--------------
@@ -26,7 +23,7 @@ Vous pouvez choisir votre méthode favorite de notification :
- Web
Pour chaque projet dont vous êtes membre, vous pouvez choisir de recevoir des notifications pour :
- Toutes les tâches
- Seulement les tâches qui vous sont assignées
- Seulement les tâches que vous avez créées
@@ -41,7 +38,7 @@ Les notifications web sont accéssibles depuis le tableau de bord ou depuis l'ic
![Icône des notifications web](http://kanboard.net/screenshots/documentation/web-notifications-icon.png)
Les notifications sont affichés sous forme de liste. Vous pouvez marquer comme lu chacune d'entre-elle ou toutes en même temps.
Les notifications sont affichés sous forme de liste. Vous pouvez marquer comme lu chacune d'entre-elle ou toutes en même temps.
![Notifications web](http://kanboard.net/screenshots/documentation/web-notifications.png)

View File

@@ -1,38 +0,0 @@
Hipchat integration
===================
You can send notifications to Hipchat for all projects or only for specific projects.
- To send notifications for all projects, go to **Settings > Integrations > Hipchat**
- To send notifications for only some projects, go to **Project settings > Integrations > Hipchat**
Each project can send notifications to a separate room.
Send notifications to a room
-----------------------------
Example of notifications:
![Hipchat notification](http://kanboard.net/screenshots/documentation/hipchat-notification.png)
This feature use the room notification token system of Hipchat.
### Hipchat configuration
![Hipchat room token](http://kanboard.net/screenshots/documentation/hipchat-room-token.png)
1. Go to to **My account**
2. Click on the tab **Rooms** and select the room you want to send the notifications
3. On the left, choose **Tokens**
4. Enter a label, by example "Kanboard" and save
### Kanboard configuration
![Hipchat settings](http://kanboard.net/screenshots/documentation/hipchat-settings.png)
1. Go to **Settings > Integrations > Hipchat** or **Project settings > Integrations > Hipchat**
2. Replace the API url if you use the self-hosted version of Hipchat
3. Set the room name or the room API ID
4. Copy and paste the token generated previously
Now, Kanboard events will be sent to the Hipchat room.

View File

@@ -66,9 +66,6 @@ Using Kanboard
- [Bitbucket webhooks](bitbucket-webhooks.markdown)
- [Github webhooks](github-webhooks.markdown)
- [Gitlab webhooks](gitlab-webhooks.markdown)
- [Hipchat](hipchat.markdown)
- [Jabber](jabber.markdown)
- [Slack](slack.markdown)
- [iCalendar subscriptions](ical.markdown)
- [RSS/Atom subscriptions](rss.markdown)
- [Json-RPC API](api-json-rpc.markdown)

View File

@@ -1,34 +0,0 @@
Jabber/XMPP integration
=======================
You can send notifications to a Jabber room for all projects or only for specific projects.
- To send notifications for all projects, go to **Settings > Integrations > Jabber**
- To send notifications for only some projects, go to **Project settings > Integrations > Jabber**
Each project can send notifications to a separate room.
## Example of notification
Here an example with the Jabber client Adium:
![Jabber notification](http://kanboard.net/screenshots/documentation/jabber-notification.png)
## Configuration
![Jabber settings](http://kanboard.net/screenshots/documentation/jabber-settings.png)
1. Go to **Settings > Integrations > Jabber** or **Project settings > Integrations > Jabber**
2. **XMPP server address**: URL of the XMPP server, example: **tcp://172.28.128.3:5222**
3. **Jabber domain**: The **"to"** attribute of the XMPP protocol, example: **example.com**
4. **Username**: The Jabber username used by Kanboard, example: **kanboard**
5. **Password**: The Jabber password
6. **Jabber nickname**: The nickname used to connect to the room
7. **Multi-user chat room**: The address of the room, example: **demo@conference.example.com**
Now, Kanboard events will be sent to the Jabber conference room.
## Troubleshooting
- Enable the debug mode
- All connection errors with the XMPP server are recorded in the log files `data/debug.log` or syslog

View File

@@ -4,14 +4,9 @@ Notifications
Kanboard is able to send notifications through several channels:
- Email
- Web
- Jabber/XMPP
- Hipchat
- Slack
- Web (List of unread messages)
Actually, Jabber/Hipchat/Slack notifications are sent to a room or group channel because they are configured at the project level.
However, email or web notifications are sent to an individual person.
External plugins allow you to send notifications to Slack, Hipchat, Jabber or any chat system.
Configuration
-------------

View File

@@ -134,6 +134,8 @@ List of template hooks:
- `template:dashboard:sidebar`
- `template:config:sidebar`
- `template:config:integrations`
- `template:project:integrations`
- `template:user:integrations`
- `template:export:sidebar`
- `template:layout:head`
- `template:layout:top`

View File

@@ -0,0 +1,60 @@
Add Notification Types with Plugins
===================================
You can send notifications to almost any system by adding a new type.
There are two kinds of notifications: project and user.
- Project: Notifications configured at the project level
- User: Notifications sent individually and configured at the user profile
Register a new notification type
--------------------------------
In your plugin registration file call the method `setType()`:
```php
$this->userNotificationType->setType('irc', t('IRC'), '\Kanboard\Plugin\IRC\Notification\IrcHandler');
$this->projectNotificationType->setType('irc', t('IRC'), '\Kanboard\Plugin\IRC\Notification\IrcHandler');
```
Your handler can be registered for user or project notification. You don't necessary need to support both.
When your handler is registered, the end-user can choose to receive the new notification type or not.
Notification Handler
--------------------
Your notification handler must implements the interface `Kanboard\Notification\NotificationInterface`:
```php
interface NotificationInterface
{
/**
* Send notification to a user
*
* @access public
* @param array $user
* @param string $event_name
* @param array $event_data
*/
public function notifyUser(array $user, $event_name, array $event_data);
/**
* Send notification to a project
*
* @access public
* @param array $project
* @param string $event_name
* @param array $event_data
*/
public function notifyProject(array $project, $event_name, array $event_data);
}
```
Example of notification plugins
-------------------------------
- [Slack](https://github.com/kanboard/plugin-slack)
- [Hipchat](https://github.com/kanboard/plugin-hipchat)
- [Jabber](https://github.com/kanboard/plugin-jabber)

View File

@@ -156,8 +156,8 @@ class Plugin extends Base
public function initialize()
{
$this->action->extendActions(
'\Kanboard\Plugin\AutomaticAction\Action\SendSlackMessage', // Use absolute namespace
t('Send a message to Slack when the task color change')
'\Kanboard\Plugin\AutomaticAction\Action\DoSomething', // Use absolute namespace
t('Do something when the task color change')
);
}
}

View File

@@ -12,10 +12,14 @@ Plugin creators should specify explicitly the compatible versions of Kanboard. I
- [Override default application behaviors](plugin-overrides.markdown)
- [Add schema migrations for plugins](plugin-schema-migrations.markdown)
- [Add mail transports](plugin-mail-transports.markdown)
- [Add notification types](plugin-notifications.markdown)
Examples of plugins
-------------------
- [Slack](https://github.com/kanboard/plugin-slack)
- [Hipchat](https://github.com/kanboard/plugin-hipchat)
- [Jabber](https://github.com/kanboard/plugin-jabber)
- [Sendgrid](https://github.com/kanboard/plugin-sendgrid)
- [Mailgun](https://github.com/kanboard/plugin-mailgun)
- [Postmark](https://github.com/kanboard/plugin-postmark)

View File

@@ -1,38 +0,0 @@
Slack integration
=================
You can send notifications to Slack for all projects or only for specific projects.
- To send notifications for all projects, go to **Settings > Integrations > Slack**
- To send notifications for only some projects, go to **Project settings > Integrations > Slack**
Each project can send notifications to a separate channel.
Send notifications to a channel
-------------------------------
Example of notifications:
![Slack notification](http://kanboard.net/screenshots/documentation/slack-notification.png)
This feature use the [Incoming webhook](https://api.slack.com/incoming-webhooks) system of Slack.
### Slack configuration
![Slack webhook creation](http://kanboard.net/screenshots/documentation/slack-add-incoming-webhook.png)
1. Click on the Team dropdown and choose **Configure Integrations**
2. On the list of services, scroll-down and choose **DIY Integrations & Customizations > Incoming WebHooks**
3. Copy the webhook url to the Kanboard settings page: **Settings > Integrations > Slack** or **Project settings > Integrations > Slack**
Now, Kanboard events will be sent to the Slack channel.
### Overriding Channel (Optional)
Optionally you can override the channel, private group or send direct messages by filling up **Channel/Group/User** text box. Leaving it empty will post to the channel configured during webhook configuration.
Examples:
- Send messages to another channel: **#mychannel1**
- Send messages to a private group: **#myprivategroup1**
- Send messages directly to someone: **@anotheruser1**