Add Jabber/XMPP integration
This commit is contained in:
@@ -44,7 +44,7 @@ class Config extends Base
|
||||
$values += array('subtask_restriction' => 0, 'subtask_time_tracking' => 0, 'subtask_forecast' => 0);
|
||||
}
|
||||
else if ($redirect === 'integrations') {
|
||||
$values += array('integration_slack_webhook' => 0, 'integration_hipchat' => 0, 'integration_gravatar' => 0);
|
||||
$values += array('integration_slack_webhook' => 0, 'integration_hipchat' => 0, 'integration_gravatar' => 0, 'integration_jabber' => 0);
|
||||
}
|
||||
|
||||
if ($this->config->save($values)) {
|
||||
|
||||
@@ -97,7 +97,7 @@ class Project extends Base
|
||||
|
||||
if ($this->request->isPost()) {
|
||||
$params = $this->request->getValues();
|
||||
$params += array('hipchat' => 0, 'slack' => 0);
|
||||
$params += array('hipchat' => 0, 'slack' => 0, 'jabber' => 0);
|
||||
$this->projectIntegration->saveParameters($project['id'], $params);
|
||||
}
|
||||
|
||||
|
||||
129
app/Integration/Jabber.php
Normal file
129
app/Integration/Jabber.php
Normal file
@@ -0,0 +1,129 @@
|
||||
<?php
|
||||
|
||||
namespace Integration;
|
||||
|
||||
use Exception;
|
||||
use Fabiang\Xmpp\Options;
|
||||
use Fabiang\Xmpp\Client;
|
||||
use Fabiang\Xmpp\Protocol\Message;
|
||||
use Fabiang\Xmpp\Protocol\Presence;
|
||||
|
||||
/**
|
||||
* Jabber
|
||||
*
|
||||
* @package integration
|
||||
* @author Frederic Guillot
|
||||
*/
|
||||
class Jabber extends Base
|
||||
{
|
||||
/**
|
||||
* Return true if Jabber is enabled for this project or globally
|
||||
*
|
||||
* @access public
|
||||
* @param integer $project_id
|
||||
* @return boolean
|
||||
*/
|
||||
public function isActivated($project_id)
|
||||
{
|
||||
return $this->config->get('integration_jabber') == 1 || $this->projectIntegration->hasValue($project_id, 'jabber', 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get connection parameters
|
||||
*
|
||||
* @access public
|
||||
* @param integer $project_id
|
||||
* @return array
|
||||
*/
|
||||
public function getParameters($project_id)
|
||||
{
|
||||
if ($this->config->get('integration_jabber') == 1) {
|
||||
return array(
|
||||
'server' => $this->config->get('integration_jabber_server'),
|
||||
'domain' => $this->config->get('integration_jabber_domain'),
|
||||
'username' => $this->config->get('integration_jabber_username'),
|
||||
'password' => $this->config->get('integration_jabber_password'),
|
||||
'nickname' => $this->config->get('integration_jabber_nickname'),
|
||||
'room' => $this->config->get('integration_jabber_room'),
|
||||
);
|
||||
}
|
||||
|
||||
$options = $this->projectIntegration->getParameters($project_id);
|
||||
|
||||
return array(
|
||||
'server' => $options['jabber_server'],
|
||||
'domain' => $options['jabber_domain'],
|
||||
'username' => $options['jabber_username'],
|
||||
'password' => $options['jabber_password'],
|
||||
'nickname' => $options['jabber_nickname'],
|
||||
'room' => $options['jabber_room'],
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Build and send the message
|
||||
*
|
||||
* @access public
|
||||
* @param integer $project_id Project id
|
||||
* @param integer $task_id Task id
|
||||
* @param string $event_name Event name
|
||||
* @param array $event Event data
|
||||
*/
|
||||
public function notify($project_id, $task_id, $event_name, array $event)
|
||||
{
|
||||
if ($this->isActivated($project_id)) {
|
||||
|
||||
$project = $this->project->getbyId($project_id);
|
||||
|
||||
$event['event_name'] = $event_name;
|
||||
$event['author'] = $this->user->getFullname($this->session['user']);
|
||||
|
||||
$payload = '['.$project['name'].'] '.str_replace('"', '"', $this->projectActivity->getTitle($event)).(isset($event['task']['title']) ? ' ('.$event['task']['title'].')' : '');
|
||||
|
||||
if ($this->config->get('application_url')) {
|
||||
$payload .= ' '.$this->config->get('application_url');
|
||||
$payload .= $this->helper->url('task', 'show', array('task_id' => $task_id, 'project_id' => $project_id));
|
||||
}
|
||||
|
||||
$this->sendMessage($project_id, $payload);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Send message to the XMPP server
|
||||
*
|
||||
* @access public
|
||||
* @param integer $project_id
|
||||
* @param string $payload
|
||||
*/
|
||||
public function sendMessage($project_id, $payload)
|
||||
{
|
||||
try {
|
||||
|
||||
$params = $this->getParameters($project_id);
|
||||
|
||||
$options = new Options($params['server']);
|
||||
$options->setUsername($params['username']);
|
||||
$options->setPassword($params['password']);
|
||||
$options->setTo($params['domain']);
|
||||
|
||||
$client = new Client($options);
|
||||
|
||||
$channel = new Presence;
|
||||
$channel->setTo($params['room'])->setNickName($params['nickname']);
|
||||
$client->send($channel);
|
||||
|
||||
$message = new Message;
|
||||
$message->setMessage($payload)
|
||||
->setTo($params['room'])
|
||||
->setType(Message::TYPE_GROUPCHAT);
|
||||
|
||||
$client->send($message);
|
||||
|
||||
$client->disconnect();
|
||||
}
|
||||
catch (Exception $e) {
|
||||
$this->container['logger']->error('Jabber error: '.$e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -900,4 +900,12 @@ return array(
|
||||
// 'When task is moved from first column' => '',
|
||||
// 'When task is moved to last column' => '',
|
||||
// 'Year(s)' => '',
|
||||
// 'Jabber (XMPP)' => '',
|
||||
// 'Send notifications to Jabber' => '',
|
||||
// 'XMPP server address' => '',
|
||||
// 'Jabber domain' => '',
|
||||
// 'Jabber nickname' => '',
|
||||
// 'Multi-user chat room' => '',
|
||||
// 'Help on Jabber integration' => '',
|
||||
// 'The server address must use this format: "tcp://hostname:5222"' => '',
|
||||
);
|
||||
|
||||
@@ -900,4 +900,12 @@ return array(
|
||||
// 'When task is moved from first column' => '',
|
||||
// 'When task is moved to last column' => '',
|
||||
// 'Year(s)' => '',
|
||||
// 'Jabber (XMPP)' => '',
|
||||
// 'Send notifications to Jabber' => '',
|
||||
// 'XMPP server address' => '',
|
||||
// 'Jabber domain' => '',
|
||||
// 'Jabber nickname' => '',
|
||||
// 'Multi-user chat room' => '',
|
||||
// 'Help on Jabber integration' => '',
|
||||
// 'The server address must use this format: "tcp://hostname:5222"' => '',
|
||||
);
|
||||
|
||||
@@ -900,4 +900,12 @@ return array(
|
||||
// 'When task is moved from first column' => '',
|
||||
// 'When task is moved to last column' => '',
|
||||
// 'Year(s)' => '',
|
||||
// 'Jabber (XMPP)' => '',
|
||||
// 'Send notifications to Jabber' => '',
|
||||
// 'XMPP server address' => '',
|
||||
// 'Jabber domain' => '',
|
||||
// 'Jabber nickname' => '',
|
||||
// 'Multi-user chat room' => '',
|
||||
// 'Help on Jabber integration' => '',
|
||||
// 'The server address must use this format: "tcp://hostname:5222"' => '',
|
||||
);
|
||||
|
||||
@@ -900,4 +900,12 @@ return array(
|
||||
// 'When task is moved from first column' => '',
|
||||
// 'When task is moved to last column' => '',
|
||||
// 'Year(s)' => '',
|
||||
// 'Jabber (XMPP)' => '',
|
||||
// 'Send notifications to Jabber' => '',
|
||||
// 'XMPP server address' => '',
|
||||
// 'Jabber domain' => '',
|
||||
// 'Jabber nickname' => '',
|
||||
// 'Multi-user chat room' => '',
|
||||
// 'Help on Jabber integration' => '',
|
||||
// 'The server address must use this format: "tcp://hostname:5222"' => '',
|
||||
);
|
||||
|
||||
@@ -902,4 +902,12 @@ return array(
|
||||
'When task is moved from first column' => 'Lorsque la tâche est déplacée en dehors de la première colonne',
|
||||
'When task is moved to last column' => 'Lorsque la tâche est déplacée dans la dernière colonne',
|
||||
'Year(s)' => 'Année(s)',
|
||||
'Jabber (XMPP)' => 'Jabber (XMPP)',
|
||||
'Send notifications to Jabber' => 'Envoyer les notifications vers Jabber',
|
||||
'XMPP server address' => 'Adresse du serveur XMPP',
|
||||
'Jabber domain' => 'Nom de domaine Jabber',
|
||||
'Jabber nickname' => 'Pseudonyme Jabber',
|
||||
'Multi-user chat room' => 'Salon de discussion multi-utilisateurs',
|
||||
'Help on Jabber integration' => 'Aide sur l\'intégration avec Jabber',
|
||||
'The server address must use this format: "tcp://hostname:5222"' => 'L\'adresse du serveur doit utiliser le format suivant : « tcp://hostname:5222 »',
|
||||
);
|
||||
|
||||
@@ -900,4 +900,12 @@ return array(
|
||||
// 'When task is moved from first column' => '',
|
||||
// 'When task is moved to last column' => '',
|
||||
// 'Year(s)' => '',
|
||||
// 'Jabber (XMPP)' => '',
|
||||
// 'Send notifications to Jabber' => '',
|
||||
// 'XMPP server address' => '',
|
||||
// 'Jabber domain' => '',
|
||||
// 'Jabber nickname' => '',
|
||||
// 'Multi-user chat room' => '',
|
||||
// 'Help on Jabber integration' => '',
|
||||
// 'The server address must use this format: "tcp://hostname:5222"' => '',
|
||||
);
|
||||
|
||||
@@ -900,4 +900,12 @@ return array(
|
||||
// 'When task is moved from first column' => '',
|
||||
// 'When task is moved to last column' => '',
|
||||
// 'Year(s)' => '',
|
||||
// 'Jabber (XMPP)' => '',
|
||||
// 'Send notifications to Jabber' => '',
|
||||
// 'XMPP server address' => '',
|
||||
// 'Jabber domain' => '',
|
||||
// 'Jabber nickname' => '',
|
||||
// 'Multi-user chat room' => '',
|
||||
// 'Help on Jabber integration' => '',
|
||||
// 'The server address must use this format: "tcp://hostname:5222"' => '',
|
||||
);
|
||||
|
||||
@@ -900,4 +900,12 @@ return array(
|
||||
// 'When task is moved from first column' => '',
|
||||
// 'When task is moved to last column' => '',
|
||||
// 'Year(s)' => '',
|
||||
// 'Jabber (XMPP)' => '',
|
||||
// 'Send notifications to Jabber' => '',
|
||||
// 'XMPP server address' => '',
|
||||
// 'Jabber domain' => '',
|
||||
// 'Jabber nickname' => '',
|
||||
// 'Multi-user chat room' => '',
|
||||
// 'Help on Jabber integration' => '',
|
||||
// 'The server address must use this format: "tcp://hostname:5222"' => '',
|
||||
);
|
||||
|
||||
@@ -900,4 +900,12 @@ return array(
|
||||
// 'When task is moved from first column' => '',
|
||||
// 'When task is moved to last column' => '',
|
||||
// 'Year(s)' => '',
|
||||
// 'Jabber (XMPP)' => '',
|
||||
// 'Send notifications to Jabber' => '',
|
||||
// 'XMPP server address' => '',
|
||||
// 'Jabber domain' => '',
|
||||
// 'Jabber nickname' => '',
|
||||
// 'Multi-user chat room' => '',
|
||||
// 'Help on Jabber integration' => '',
|
||||
// 'The server address must use this format: "tcp://hostname:5222"' => '',
|
||||
);
|
||||
|
||||
@@ -900,4 +900,12 @@ return array(
|
||||
// 'When task is moved from first column' => '',
|
||||
// 'When task is moved to last column' => '',
|
||||
// 'Year(s)' => '',
|
||||
// 'Jabber (XMPP)' => '',
|
||||
// 'Send notifications to Jabber' => '',
|
||||
// 'XMPP server address' => '',
|
||||
// 'Jabber domain' => '',
|
||||
// 'Jabber nickname' => '',
|
||||
// 'Multi-user chat room' => '',
|
||||
// 'Help on Jabber integration' => '',
|
||||
// 'The server address must use this format: "tcp://hostname:5222"' => '',
|
||||
);
|
||||
|
||||
@@ -900,4 +900,12 @@ return array(
|
||||
// 'When task is moved from first column' => '',
|
||||
// 'When task is moved to last column' => '',
|
||||
// 'Year(s)' => '',
|
||||
// 'Jabber (XMPP)' => '',
|
||||
// 'Send notifications to Jabber' => '',
|
||||
// 'XMPP server address' => '',
|
||||
// 'Jabber domain' => '',
|
||||
// 'Jabber nickname' => '',
|
||||
// 'Multi-user chat room' => '',
|
||||
// 'Help on Jabber integration' => '',
|
||||
// 'The server address must use this format: "tcp://hostname:5222"' => '',
|
||||
);
|
||||
|
||||
@@ -900,4 +900,12 @@ return array(
|
||||
// 'When task is moved from first column' => '',
|
||||
// 'When task is moved to last column' => '',
|
||||
// 'Year(s)' => '',
|
||||
// 'Jabber (XMPP)' => '',
|
||||
// 'Send notifications to Jabber' => '',
|
||||
// 'XMPP server address' => '',
|
||||
// 'Jabber domain' => '',
|
||||
// 'Jabber nickname' => '',
|
||||
// 'Multi-user chat room' => '',
|
||||
// 'Help on Jabber integration' => '',
|
||||
// 'The server address must use this format: "tcp://hostname:5222"' => '',
|
||||
);
|
||||
|
||||
@@ -900,4 +900,12 @@ return array(
|
||||
// 'When task is moved from first column' => '',
|
||||
// 'When task is moved to last column' => '',
|
||||
// 'Year(s)' => '',
|
||||
// 'Jabber (XMPP)' => '',
|
||||
// 'Send notifications to Jabber' => '',
|
||||
// 'XMPP server address' => '',
|
||||
// 'Jabber domain' => '',
|
||||
// 'Jabber nickname' => '',
|
||||
// 'Multi-user chat room' => '',
|
||||
// 'Help on Jabber integration' => '',
|
||||
// 'The server address must use this format: "tcp://hostname:5222"' => '',
|
||||
);
|
||||
|
||||
@@ -900,4 +900,12 @@ return array(
|
||||
// 'When task is moved from first column' => '',
|
||||
// 'When task is moved to last column' => '',
|
||||
// 'Year(s)' => '',
|
||||
// 'Jabber (XMPP)' => '',
|
||||
// 'Send notifications to Jabber' => '',
|
||||
// 'XMPP server address' => '',
|
||||
// 'Jabber domain' => '',
|
||||
// 'Jabber nickname' => '',
|
||||
// 'Multi-user chat room' => '',
|
||||
// 'Help on Jabber integration' => '',
|
||||
// 'The server address must use this format: "tcp://hostname:5222"' => '',
|
||||
);
|
||||
|
||||
@@ -900,4 +900,12 @@ return array(
|
||||
// 'When task is moved from first column' => '',
|
||||
// 'When task is moved to last column' => '',
|
||||
// 'Year(s)' => '',
|
||||
// 'Jabber (XMPP)' => '',
|
||||
// 'Send notifications to Jabber' => '',
|
||||
// 'XMPP server address' => '',
|
||||
// 'Jabber domain' => '',
|
||||
// 'Jabber nickname' => '',
|
||||
// 'Multi-user chat room' => '',
|
||||
// 'Help on Jabber integration' => '',
|
||||
// 'The server address must use this format: "tcp://hostname:5222"' => '',
|
||||
);
|
||||
|
||||
@@ -900,4 +900,12 @@ return array(
|
||||
// 'When task is moved from first column' => '',
|
||||
// 'When task is moved to last column' => '',
|
||||
// 'Year(s)' => '',
|
||||
// 'Jabber (XMPP)' => '',
|
||||
// 'Send notifications to Jabber' => '',
|
||||
// 'XMPP server address' => '',
|
||||
// 'Jabber domain' => '',
|
||||
// 'Jabber nickname' => '',
|
||||
// 'Multi-user chat room' => '',
|
||||
// 'Help on Jabber integration' => '',
|
||||
// 'The server address must use this format: "tcp://hostname:5222"' => '',
|
||||
);
|
||||
|
||||
@@ -900,4 +900,12 @@ return array(
|
||||
// 'When task is moved from first column' => '',
|
||||
// 'When task is moved to last column' => '',
|
||||
// 'Year(s)' => '',
|
||||
// 'Jabber (XMPP)' => '',
|
||||
// 'Send notifications to Jabber' => '',
|
||||
// 'XMPP server address' => '',
|
||||
// 'Jabber domain' => '',
|
||||
// 'Jabber nickname' => '',
|
||||
// 'Multi-user chat room' => '',
|
||||
// 'Help on Jabber integration' => '',
|
||||
// 'The server address must use this format: "tcp://hostname:5222"' => '',
|
||||
);
|
||||
|
||||
@@ -6,7 +6,27 @@ use PDO;
|
||||
use Core\Security;
|
||||
use Model\Link;
|
||||
|
||||
const VERSION = 67;
|
||||
const VERSION = 68;
|
||||
|
||||
function version_68($pdo)
|
||||
{
|
||||
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
|
||||
$rq->execute(array('integration_jabber', '0'));
|
||||
$rq->execute(array('integration_jabber_server', ''));
|
||||
$rq->execute(array('integration_jabber_domain', ''));
|
||||
$rq->execute(array('integration_jabber_username', ''));
|
||||
$rq->execute(array('integration_jabber_password', ''));
|
||||
$rq->execute(array('integration_jabber_nickname', 'kanboard'));
|
||||
$rq->execute(array('integration_jabber_room', ''));
|
||||
|
||||
$pdo->exec("ALTER TABLE project_integrations ADD COLUMN jabber INTEGER DEFAULT '0'");
|
||||
$pdo->exec("ALTER TABLE project_integrations ADD COLUMN jabber_server TEXT DEFAULT ''");
|
||||
$pdo->exec("ALTER TABLE project_integrations ADD COLUMN jabber_domain TEXT DEFAULT ''");
|
||||
$pdo->exec("ALTER TABLE project_integrations ADD COLUMN jabber_username TEXT DEFAULT ''");
|
||||
$pdo->exec("ALTER TABLE project_integrations ADD COLUMN jabber_password TEXT DEFAULT ''");
|
||||
$pdo->exec("ALTER TABLE project_integrations ADD COLUMN jabber_nickname TEXT DEFAULT 'kanboard'");
|
||||
$pdo->exec("ALTER TABLE project_integrations ADD COLUMN jabber_room TEXT DEFAULT ''");
|
||||
}
|
||||
|
||||
function version_67($pdo)
|
||||
{
|
||||
|
||||
@@ -6,7 +6,27 @@ use PDO;
|
||||
use Core\Security;
|
||||
use Model\Link;
|
||||
|
||||
const VERSION = 48;
|
||||
const VERSION = 49;
|
||||
|
||||
function version_49($pdo)
|
||||
{
|
||||
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
|
||||
$rq->execute(array('integration_jabber', '0'));
|
||||
$rq->execute(array('integration_jabber_server', ''));
|
||||
$rq->execute(array('integration_jabber_domain', ''));
|
||||
$rq->execute(array('integration_jabber_username', ''));
|
||||
$rq->execute(array('integration_jabber_password', ''));
|
||||
$rq->execute(array('integration_jabber_nickname', 'kanboard'));
|
||||
$rq->execute(array('integration_jabber_room', ''));
|
||||
|
||||
$pdo->exec("ALTER TABLE project_integrations ADD COLUMN jabber INTEGER DEFAULT '0'");
|
||||
$pdo->exec("ALTER TABLE project_integrations ADD COLUMN jabber_server TEXT DEFAULT ''");
|
||||
$pdo->exec("ALTER TABLE project_integrations ADD COLUMN jabber_domain TEXT DEFAULT ''");
|
||||
$pdo->exec("ALTER TABLE project_integrations ADD COLUMN jabber_username TEXT DEFAULT ''");
|
||||
$pdo->exec("ALTER TABLE project_integrations ADD COLUMN jabber_password TEXT DEFAULT ''");
|
||||
$pdo->exec("ALTER TABLE project_integrations ADD COLUMN jabber_nickname TEXT DEFAULT 'kanboard'");
|
||||
$pdo->exec("ALTER TABLE project_integrations ADD COLUMN jabber_room TEXT DEFAULT ''");
|
||||
}
|
||||
|
||||
function version_48($pdo)
|
||||
{
|
||||
|
||||
@@ -6,7 +6,27 @@ use Core\Security;
|
||||
use PDO;
|
||||
use Model\Link;
|
||||
|
||||
const VERSION = 66;
|
||||
const VERSION = 67;
|
||||
|
||||
function version_67($pdo)
|
||||
{
|
||||
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
|
||||
$rq->execute(array('integration_jabber', '0'));
|
||||
$rq->execute(array('integration_jabber_server', ''));
|
||||
$rq->execute(array('integration_jabber_domain', ''));
|
||||
$rq->execute(array('integration_jabber_username', ''));
|
||||
$rq->execute(array('integration_jabber_password', ''));
|
||||
$rq->execute(array('integration_jabber_nickname', 'kanboard'));
|
||||
$rq->execute(array('integration_jabber_room', ''));
|
||||
|
||||
$pdo->exec("ALTER TABLE project_integrations ADD COLUMN jabber INTEGER DEFAULT '0'");
|
||||
$pdo->exec("ALTER TABLE project_integrations ADD COLUMN jabber_server TEXT DEFAULT ''");
|
||||
$pdo->exec("ALTER TABLE project_integrations ADD COLUMN jabber_domain TEXT DEFAULT ''");
|
||||
$pdo->exec("ALTER TABLE project_integrations ADD COLUMN jabber_username TEXT DEFAULT ''");
|
||||
$pdo->exec("ALTER TABLE project_integrations ADD COLUMN jabber_password TEXT DEFAULT ''");
|
||||
$pdo->exec("ALTER TABLE project_integrations ADD COLUMN jabber_nickname TEXT DEFAULT 'kanboard'");
|
||||
$pdo->exec("ALTER TABLE project_integrations ADD COLUMN jabber_room TEXT DEFAULT ''");
|
||||
}
|
||||
|
||||
function version_66($pdo)
|
||||
{
|
||||
|
||||
@@ -81,6 +81,7 @@ class ClassProvider implements ServiceProviderInterface
|
||||
'SendgridWebhook',
|
||||
'SlackWebhook',
|
||||
'PostmarkWebhook',
|
||||
'Jabber',
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@@ -42,31 +42,18 @@ class ProjectActivitySubscriber extends Base implements EventSubscriberInterface
|
||||
$values
|
||||
);
|
||||
|
||||
$this->sendSlackNotification($event_name, $values);
|
||||
$this->sendHipchatNotification($event_name, $values);
|
||||
// Send notifications to third-party services
|
||||
foreach (array('slackWebhook', 'hipchatWebhook', 'jabber') as $model) {
|
||||
$this->$model->notify(
|
||||
$values['task']['project_id'],
|
||||
$values['task']['id'],
|
||||
$event_name,
|
||||
$values
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function sendSlackNotification($event_name, array $values)
|
||||
{
|
||||
$this->slackWebhook->notify(
|
||||
$values['task']['project_id'],
|
||||
$values['task']['id'],
|
||||
$event_name,
|
||||
$values
|
||||
);
|
||||
}
|
||||
|
||||
private function sendHipchatNotification($event_name, array $values)
|
||||
{
|
||||
$this->hipchatWebhook->notify(
|
||||
$values['task']['project_id'],
|
||||
$values['task']['id'],
|
||||
$event_name,
|
||||
$values
|
||||
);
|
||||
}
|
||||
|
||||
private function getValues(GenericEvent $event)
|
||||
{
|
||||
$values = array();
|
||||
|
||||
@@ -29,6 +29,32 @@
|
||||
<?= $this->formCheckbox('integration_gravatar', t('Enable Gravatar images'), 1, $values['integration_gravatar'] == 1) ?>
|
||||
</div>
|
||||
|
||||
<h3><img src="assets/img/jabber-icon.png"/> <?= t('Jabber (XMPP)') ?></h3>
|
||||
<div class="listing">
|
||||
<?= $this->formCheckbox('integration_jabber', t('Send notifications to Jabber'), 1, $values['integration_jabber'] == 1) ?>
|
||||
|
||||
<?= $this->formLabel(t('XMPP server address'), 'integration_jabber_server') ?>
|
||||
<?= $this->formText('integration_jabber_server', $values, $errors, array('placeholder="tcp://myserver:5222"')) ?>
|
||||
<p class="form-help"><?= t('The server address must use this format: "tcp://hostname:5222"') ?></p>
|
||||
|
||||
<?= $this->formLabel(t('Jabber domain'), 'integration_jabber_domain') ?>
|
||||
<?= $this->formText('integration_jabber_domain', $values, $errors, array('placeholder="example.com"')) ?>
|
||||
|
||||
<?= $this->formLabel(t('Username'), 'integration_jabber_username') ?>
|
||||
<?= $this->formText('integration_jabber_username', $values, $errors) ?>
|
||||
|
||||
<?= $this->formLabel(t('Password'), 'integration_jabber_password') ?>
|
||||
<?= $this->formPassword('integration_jabber_password', $values, $errors) ?>
|
||||
|
||||
<?= $this->formLabel(t('Jabber nickname'), 'integration_jabber_nickname') ?>
|
||||
<?= $this->formText('integration_jabber_nickname', $values, $errors) ?>
|
||||
|
||||
<?= $this->formLabel(t('Multi-user chat room'), 'integration_jabber_room') ?>
|
||||
<?= $this->formText('integration_jabber_room', $values, $errors, array('placeholder="myroom@conference.example.com"')) ?>
|
||||
|
||||
<p class="form-help"><a href="http://kanboard.net/documentation/jabber" target="_blank"><?= t('Help on Jabber integration') ?></a></p>
|
||||
</div>
|
||||
|
||||
<h3><img src="assets/img/hipchat-icon.png"/> <?= t('Hipchat') ?></h3>
|
||||
<div class="listing">
|
||||
<?= $this->formCheckbox('integration_hipchat', t('Send notifications to Hipchat'), 1, $values['integration_hipchat'] == 1) ?>
|
||||
|
||||
@@ -27,6 +27,37 @@
|
||||
</div>
|
||||
|
||||
|
||||
<h3><img src="assets/img/jabber-icon.png"/> <?= t('Jabber (XMPP)') ?></h3>
|
||||
<div class="listing">
|
||||
<?= $this->formCheckbox('jabber', t('Send notifications to Jabber'), 1, isset($values['jabber']) && $values['jabber'] == 1) ?>
|
||||
|
||||
<?= $this->formLabel(t('XMPP server address'), 'jabber_server') ?>
|
||||
<?= $this->formText('jabber_server', $values, $errors, array('placeholder="tcp://myserver:5222"')) ?>
|
||||
<p class="form-help"><?= t('The server address must use this format: "tcp://hostname:5222"') ?></p>
|
||||
|
||||
<?= $this->formLabel(t('Jabber domain'), 'jabber_domain') ?>
|
||||
<?= $this->formText('jabber_domain', $values, $errors, array('placeholder="example.com"')) ?>
|
||||
|
||||
<?= $this->formLabel(t('Username'), 'jabber_username') ?>
|
||||
<?= $this->formText('jabber_username', $values, $errors) ?>
|
||||
|
||||
<?= $this->formLabel(t('Password'), 'jabber_password') ?>
|
||||
<?= $this->formPassword('jabber_password', $values, $errors) ?>
|
||||
|
||||
<?= $this->formLabel(t('Jabber nickname'), 'jabber_nickname') ?>
|
||||
<?= $this->formText('jabber_nickname', $values, $errors) ?>
|
||||
|
||||
<?= $this->formLabel(t('Multi-user chat room'), 'jabber_room') ?>
|
||||
<?= $this->formText('jabber_room', $values, $errors, array('placeholder="myroom@conference.example.com"')) ?>
|
||||
|
||||
<p class="form-help"><a href="http://kanboard.net/documentation/jabber" target="_blank"><?= t('Help on Jabber integration') ?></a></p>
|
||||
|
||||
<div class="form-actions">
|
||||
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<h3><img src="assets/img/hipchat-icon.png"/> <?= t('Hipchat') ?></h3>
|
||||
<div class="listing">
|
||||
<?= $this->formCheckbox('hipchat', t('Send notifications to Hipchat'), 1, isset($values['hipchat']) && $values['hipchat'] == 1) ?>
|
||||
|
||||
Reference in New Issue
Block a user