This repository has been archived by the owner on May 20, 2018. It is now read-only.
/
Plugin.php
68 lines (55 loc) · 1.79 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
<?php
namespace Kanboard\Plugin\Budget;
use Kanboard\Core\Translator;
use Kanboard\Core\Plugin\Base;
use Kanboard\Core\Security\Role;
class Plugin extends Base
{
public function initialize()
{
$this->applicationAccessMap->add('HourlyRateController', '*', Role::APP_ADMIN);
$this->projectAccessMap->add('BudgetController', '*', Role::PROJECT_MANAGER);
$this->route->addRoute('/budget/project/:project_id', 'BudgetController', 'show', 'budget');
$this->route->addRoute('/budget/project/:project_id/lines', 'BudgetLineController', 'show', 'budget');
$this->route->addRoute('/budget/project/:project_id/breakdown', 'BudgetController', 'breakdown', 'budget');
$this->template->hook->attach('template:project:dropdown', 'budget:project/dropdown');
$this->template->hook->attach('template:user:sidebar:actions', 'budget:user/sidebar');
}
public function onStartup()
{
Translator::load($this->languageModel->getCurrentLanguage(), __DIR__.'/Locale');
}
public function getClasses()
{
return array(
'Plugin\Budget\Model' => array(
'HourlyRate',
'Budget',
)
);
}
public function getPluginName()
{
return 'Budget Planning';
}
public function getPluginDescription()
{
return t('Add budget section for projects and expense reports based on user hourly rates');
}
public function getPluginAuthor()
{
return 'Frédéric Guillot';
}
public function getPluginVersion()
{
return '1.0.9';
}
public function getPluginHomepage()
{
return 'https://github.com/kanboard/plugin-budget';
}
public function getCompatibleVersion()
{
return '>=1.0.37';
}
}