forked from Zayon/kanboard-redmine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Plugin.php
72 lines (59 loc) · 1.97 KB
/
Plugin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
namespace Kanboard\Plugin\Redmine;
use Kanboard\Core\Translator;
use Kanboard\Plugin\Redmine\RedmineTaskProvider;
use Kanboard\Plugin\Redmine\Action\RedmineTaskUpdateStatusColumn;
use Kanboard\Plugin\Redmine\Helper\RedmineHelper;
use Kanboard\Plugin\Redmine\RedmineClient;
use Kanboard\Core\Plugin\Base;
require_once __DIR__ . '/vendor/autoload.php';
/**
* Redmine Plugin
*
* @package redmine
* @author Pablo Godinez
*/
class Plugin extends Base
{
public function initialize()
{
$this->helper->register('redmine', '\Kanboard\Plugin\Redmine\Helper\RedmineHelper');
$this->container['RedmineClient'] = $this->container->factory(function ($container) {
$apiToken = $container['userMetadataCacheDecorator']->get('redmine_api_token', '');
$redmineUrl = $container['helper']->redmine->getRedmineRootUrl();
return new RedmineClient($redmineUrl, $apiToken);
});
$this->template->hook->attach('template:config:integrations', 'Redmine:config/integration');
$this->template->hook->attach('template:user:integrations', 'Redmine:user/integration');
$this->externalTaskManager->register(new RedmineTaskProvider($this->container));
$this->actionManager->register(new RedmineTaskUpdateStatusColumn($this->container));
}
public function getPluginName()
{
return 'Redmine Import Tool';
}
public function onStartup()
{
Translator::load($this->languageModel->getCurrentLanguage(), __DIR__.'/Locale');
}
public function getPluginDescription()
{
return t('Import Redmine Issues in Kanboard');
}
public function getPluginAuthor()
{
return 'Pablo Godinez';
}
public function getPluginVersion()
{
return '1.0.4';
}
public function getPluginHomepage()
{
return 'https://github.com/Zayon/kanboard-redmine';
}
public function getCompatibleVersion()
{
return '>=1.0.37';
}
}