This repository was archived by the owner on Feb 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPlugin.php
More file actions
executable file
·79 lines (69 loc) · 2.48 KB
/
Copy pathPlugin.php
File metadata and controls
executable file
·79 lines (69 loc) · 2.48 KB
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
73
74
75
76
77
78
79
<?php
namespace Kanboard\Plugin\KanboardCommentActions;
use Kanboard\Core\Plugin\Base;
use Kanboard\Core\Translator;
class Plugin extends Base
{
public function initialize()
{
$this->template->hook->attachCallable("template:task:comment:after-texteditor",
"KanboardCommentActions:comment_actions", function ($variables) {
if (!array_key_exists('project_id', $variables)) {
return array();
}
$projectId = $variables['project_id'];
return array(
'users_list' => $this->getAllProjectUsers($projectId),
);
});
$this->template->hook->attachCallable("template:task:show:after-texteditor",
"KanboardCommentActions:comment_actions", function ($variables) {
if (!array_key_exists('project_id', $variables)) {
return array();
}
$projectId = $variables['project_id'];
return array(
'users_list' => $this->getAllProjectUsers($projectId),
);
});
$this->template->setTemplateOverride('task_comments/create', 'KanboardCommentActions:task_comments/create');
$this->template->setTemplateOverride('comment/create', 'KanboardCommentActions:comment/create');
$this->template->setTemplateOverride('comment/edit', 'KanboardCommentActions:comment/edit');
}
public function getAllProjectUsers($project_id)
{
return $this->projectUserRoleModel->getAllUsers($project_id);
}
public function onStartup()
{
Translator::load($this->languageModel->getCurrentLanguage(), __DIR__ . '/Locale');
}
public function getClasses()
{
return array(
'Plugin\KanboardCommentActions\Controller' => array(
'CommentActionsController',
)
);
}
public function getPluginName()
{
return 'KanboardCommentActions';
}
public function getPluginDescription()
{
return t('This plugin gives the ability to assign actual Task (direct in comment-create section) to one of the users in Project.');
}
public function getPluginAuthor()
{
return 'Andrei Volgin, ipunkt Business Solutions';
}
public function getPluginVersion()
{
return '1.0.1';
}
public function getPluginHomepage()
{
return 'https://www.ipunkt.biz/unternehmen/opensource';
}
}