Skip to content
This repository was archived by the owner on Apr 5, 2020. It is now read-only.

Commit 7e1ad3f

Browse files
committed
Update to the latest version of KB
1 parent 0bbd18d commit 7e1ad3f

3 files changed

Lines changed: 15 additions & 13 deletions

File tree

Plugin.php

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,6 @@ class Plugin extends Base
99
{
1010
public function initialize()
1111
{
12-
$this->on('app.bootstrap', function($container) {
13-
Translator::load($container['config']->getCurrentLanguage(), __DIR__.'/Locale');
14-
15-
$container['eventManager']->register(WebhookHandler::EVENT_COMMIT, t('Gitlab commit received'));
16-
$container['eventManager']->register(WebhookHandler::EVENT_ISSUE_OPENED, t('Gitlab issue opened'));
17-
$container['eventManager']->register(WebhookHandler::EVENT_ISSUE_CLOSED, t('Gitlab issue closed'));
18-
$container['eventManager']->register(WebhookHandler::EVENT_ISSUE_REOPENED, t('Gitlab issue reopened'));
19-
$container['eventManager']->register(WebhookHandler::EVENT_ISSUE_COMMENT, t('Gitlab issue comment created'));
20-
});
21-
2212
$this->actionManager->getAction('\Kanboard\Action\CommentCreation')->addEvent(WebhookHandler::EVENT_ISSUE_COMMENT);
2313
$this->actionManager->getAction('\Kanboard\Action\CommentCreation')->addEvent(WebhookHandler::EVENT_COMMIT);
2414
$this->actionManager->getAction('\Kanboard\Action\TaskClose')->addEvent(WebhookHandler::EVENT_COMMIT);
@@ -31,6 +21,17 @@ public function initialize()
3121
$this->route->addRoute('/webhook/gitlab/:project_id/:token', 'webhook', 'handler', 'GitlabWebhook');
3222
}
3323

24+
public function onStartup()
25+
{
26+
Translator::load($this->language->getCurrentLanguage(), __DIR__.'/Locale');
27+
28+
$this->eventManager->register(WebhookHandler::EVENT_COMMIT, t('Gitlab commit received'));
29+
$this->eventManager->register(WebhookHandler::EVENT_ISSUE_OPENED, t('Gitlab issue opened'));
30+
$this->eventManager->register(WebhookHandler::EVENT_ISSUE_CLOSED, t('Gitlab issue closed'));
31+
$this->eventManager->register(WebhookHandler::EVENT_ISSUE_REOPENED, t('Gitlab issue reopened'));
32+
$this->eventManager->register(WebhookHandler::EVENT_ISSUE_COMMENT, t('Gitlab issue comment created'));
33+
}
34+
3435
public function getPluginName()
3536
{
3637
return 'Gitlab Webhook';
@@ -48,7 +49,7 @@ public function getPluginAuthor()
4849

4950
public function getPluginVersion()
5051
{
51-
return '1.0.2';
52+
return '1.0.3';
5253
}
5354

5455
public function getPluginHomepage()

Template/project/integrations.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<h3><img src="<?= $this->url->dir() ?>plugins/GitlabWebhook/gitlab-icon.png"/>&nbsp;<?= t('Gitlab webhooks') ?></h3>
22
<div class="listing">
33
<input type="text" class="auto-select" readonly="readonly" value="<?= $this->url->href('webhook', 'handler', array('plugin' => 'GitlabWebhook', 'token' => $webhook_token, 'project_id' => $project['id']), false, '', true) ?>"/><br/>
4-
<p class="form-help"><a href="http://kanboard.net/plugins/gitlab-webhook" target="_blank"><?= t('Help on Gitlab webhooks') ?></a></p>
5-
</div>
4+
<p class="form-help"><a href="https://kanboard.net/plugin/gitlab-webhook" target="_blank"><?= t('Help on Gitlab webhooks') ?></a></p>
5+
</div>

Test/PluginTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public function testPlugin()
1010
{
1111
$plugin = new Plugin($this->container);
1212
$this->assertSame(null, $plugin->initialize());
13+
$this->assertSame(null, $plugin->onStartup());
1314
$this->assertNotEmpty($plugin->getPluginName());
1415
$this->assertNotEmpty($plugin->getPluginDescription());
1516
$this->assertNotEmpty($plugin->getPluginAuthor());

0 commit comments

Comments
 (0)