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

Commit

Permalink
Update to the latest version of KB
Browse files Browse the repository at this point in the history
  • Loading branch information
fguillot committed May 8, 2016
1 parent c6c4cf4 commit 37153a4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
26 changes: 13 additions & 13 deletions Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,6 @@ class Plugin extends Base
{
public function initialize()
{
$this->on('app.bootstrap', function($container) {
Translator::load($container['config']->getCurrentLanguage(), __DIR__.'/Locale');

$container['eventManager']->register(WebhookHandler::EVENT_COMMIT, t('Bitbucket commit received'));
$container['eventManager']->register(WebhookHandler::EVENT_ISSUE_OPENED, t('Bitbucket issue opened'));
$container['eventManager']->register(WebhookHandler::EVENT_ISSUE_CLOSED, t('Bitbucket issue closed'));
$container['eventManager']->register(WebhookHandler::EVENT_ISSUE_REOPENED, t('Bitbucket issue reopened'));
$container['eventManager']->register(WebhookHandler::EVENT_ISSUE_ASSIGNEE_CHANGE, t('Bitbucket issue assignee change'));
$container['eventManager']->register(WebhookHandler::EVENT_ISSUE_COMMENT, t('Bitbucket issue comment created'));
});

$this->actionManager->getAction('\Kanboard\Action\CommentCreation')->addEvent(WebhookHandler::EVENT_ISSUE_COMMENT);
$this->actionManager->getAction('\Kanboard\Action\CommentCreation')->addEvent(WebhookHandler::EVENT_COMMIT);
$this->actionManager->getAction('\Kanboard\Action\TaskAssignUser')->addEvent(WebhookHandler::EVENT_ISSUE_ASSIGNEE_CHANGE);
Expand All @@ -29,10 +18,21 @@ public function initialize()
$this->actionManager->getAction('\Kanboard\Action\TaskOpen')->addEvent(WebhookHandler::EVENT_ISSUE_REOPENED);

$this->template->hook->attach('template:project:integrations', 'BitbucketWebhook:project/integrations');

$this->route->addRoute('/webhook/bitbucket/:project_id/:token', 'webhook', 'handler', 'BitbucketWebhook');
}

public function onStartup()
{
Translator::load($this->language->getCurrentLanguage(), __DIR__.'/Locale');

$this->eventManager->register(WebhookHandler::EVENT_COMMIT, t('Bitbucket commit received'));
$this->eventManager->register(WebhookHandler::EVENT_ISSUE_OPENED, t('Bitbucket issue opened'));
$this->eventManager->register(WebhookHandler::EVENT_ISSUE_CLOSED, t('Bitbucket issue closed'));
$this->eventManager->register(WebhookHandler::EVENT_ISSUE_REOPENED, t('Bitbucket issue reopened'));
$this->eventManager->register(WebhookHandler::EVENT_ISSUE_ASSIGNEE_CHANGE, t('Bitbucket issue assignee change'));
$this->eventManager->register(WebhookHandler::EVENT_ISSUE_COMMENT, t('Bitbucket issue comment created'));
}

public function getPluginName()
{
return 'Bitbucket Webhook';
Expand All @@ -50,7 +50,7 @@ public function getPluginAuthor()

public function getPluginVersion()
{
return '1.0.1';
return '1.0.2';
}

public function getPluginHomepage()
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Documentation

### Configuration

![Bitbucket configuration](http://kanboard.net/screenshots/documentation/bitbucket-webhooks.png)
![Bitbucket configuration](https://kanboard.net/screenshots/documentation/bitbucket-webhooks.png)

1. On Kanboard, go to the project settings and choose the section **Integrations**
2. Copy the Bitbucket webhook URL
Expand Down
4 changes: 2 additions & 2 deletions Template/project/integrations.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h3><i class="fa fa-bitbucket fa-fw"></i>&nbsp;<?= t('Bitbucket webhooks') ?></h3>
<div class="listing">
<input type="text" class="auto-select" readonly="readonly" value="<?= $this->url->href('webhook', 'handler', array('plugin' => 'BitbucketWebhook', 'token' => $webhook_token, 'project_id' => $project['id']), false, '', true) ?>"/><br/>
<p class="form-help"><a href="http://kanboard.net/plugins/bitbucket-webhook" target="_blank"><?= t('Help on Bitbucket webhooks') ?></a></p>
</div>
<p class="form-help"><a href="https://kanboard.net/plugin/bitbucket-webhook" target="_blank"><?= t('Help on Bitbucket webhooks') ?></a></p>
</div>

0 comments on commit 37153a4

Please sign in to comment.