-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathMyTaskHelper.php
62 lines (51 loc) · 1.99 KB
/
MyTaskHelper.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
<?php
namespace Kanboard\Plugin\Greenwing;
use Kanboard\Core\Base;
class MyTaskHelper extends Base
{
public function getNewBoardTaskButton(array $swimlane, array $column)
{
$html = '<div class="board-add-icon btn btn-blue btn-circle btn-sm">';
$providers = $this->externalTaskManager->getProviders();
if (empty($providers)) {
$html .= $this->helper->modal->largeIcon(
'plus',
t('Add a new task'),
'TaskCreationController',
'show', array(
'project_id' => $column['project_id'],
'column_id' => $column['id'],
'swimlane_id' => $swimlane['id'],
)
);
} else {
$html .= '<div class="dropdown">';
$html .= '<a href="#" class="dropdown-menu"><i class="fa fa-plus" aria-hidden="true"></i></a><ul>';
$link = $this->helper->modal->large(
'plus',
t('Add a new Kanboard task'),
'TaskCreationController',
'show', array(
'project_id' => $column['project_id'],
'column_id' => $column['id'],
'swimlane_id' => $swimlane['id'],
)
);
$html .= '<li>'.$link.'</li>';
foreach ($providers as $provider) {
$link = $this->helper->url->link(
$provider->getMenuAddLabel(),
'ExternalTaskCreationController',
'step1',
array('project_id' => $column['project_id'], 'swimlane_id' => $swimlane['id'], 'column_id' => $column['id'], 'provider_name' => $provider->getName()),
false,
'js-modal-large'
);
$html .= '<li>'.$provider->getIcon().' '.$link.'</li>';
}
$html .= '</ul></div>';
}
$html .= '</div>';
return $html;
}
}