-
Notifications
You must be signed in to change notification settings - Fork 12
/
Plugin.php
70 lines (58 loc) · 2.02 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
<?php
namespace Kanboard\Plugin\Milestone;
use Kanboard\Core\Plugin\Base;
use Kanboard\Core\Translator;
use Kanboard\Plugin\Milestone\Formatter\TaskGanttLinkAwareFormatter;
class Plugin extends Base
{
public function initialize()
{
$this->hook->on('template:layout:css', array('template' => 'plugins/Milestone/Css/milestone.css'));
$this->template->hook->attach('template:task:dropdown', 'milestone:milestone/dropdown');
$this->template->setTemplateOverride('task_internal_link/show', 'milestone:task_internal_link/show');
$this->template->setTemplateOverride('milestone/show', 'milestone:milestone/show');
$this->template->setTemplateOverride('milestone/table', 'milestone:milestone/table');
$this->hook->on('controller:tasklink:form:default', function (array $default_values) {
return (0 != $this->request->getIntegerParam('link_id')) ? array('link_id' => $this->request->getIntegerParam('link_id')) : array();
});
$this->container['taskGanttFormatter'] = $this->container->factory(function ($c) {
return new TaskGanttLinkAwareFormatter($c);
});
}
public function onStartup()
{
Translator::load($this->languageModel->getCurrentLanguage(), __DIR__.'/Locale');
}
public function getClasses()
{
return array(
'Plugin\Milestone\Model' => array(
'TaskLinkExtModel'
)
);
}
public function getPluginName()
{
return t('Milestone');
}
public function getPluginAuthor()
{
return 'Olivier Maridat';
}
public function getPluginVersion()
{
return '1.1.2';
}
public function getPluginHomepage()
{
return 'https://github.com/oliviermaridat/kanboard-milestone-plugin';
}
public function getPluginDescription()
{
return t('The Milestone Plugin for Kanboard adds a section for milestones to show their related tasks.');
}
public function getCompatibleVersion()
{
return '>=1.0.43';
}
}