diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-11-05 22:26:58 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-11-05 22:26:58 -0400 |
commit | 3f7840c4db7384eb142f92c33330827b8d7255f9 (patch) | |
tree | 8f0cb3b6e0039eb4914534dd64718ecff6dc4715 /app/Helper | |
parent | ae5d31e4c285e0ce672de780fdacff953fe71bba (diff) |
Add the possibility to create external tasks
Diffstat (limited to 'app/Helper')
-rw-r--r-- | app/Helper/TaskHelper.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/app/Helper/TaskHelper.php b/app/Helper/TaskHelper.php index 678b4bed..1dce7c54 100644 --- a/app/Helper/TaskHelper.php +++ b/app/Helper/TaskHelper.php @@ -238,4 +238,32 @@ class TaskHelper extends Base return $this->taskModel->getProgress($task, $this->columns[$task['project_id']]); } + + public function getNewTaskDropdown($projectId, $swimlaneId, $columnId) + { + $providers = $this->externalTaskManager->getProvidersList(); + + if (empty($providers)) { + return ''; + } + + $html = '<small class="pull-right"><div class="dropdown">'; + $html .= '<a href="#" class="dropdown-menu"><i class="fa fa-cloud-download" aria-hidden="true"></i> <i class="fa fa-caret-down"></i></a><ul>'; + + foreach ($providers as $providerName) { + $link = $this->helper->url->link( + t('New External Task: %s', $providerName), + 'ExternalTaskCreationController', + 'step1', + array('project_id' => $projectId, 'swimlane_id' => $swimlaneId, 'column_id' => $columnId, 'provider_name' => $providerName), + false, + 'popover-link' + ); + + $html .= '<li><i class="fa fa-fw fa-plus-square" aria-hidden="true"></i> '.$link.'</li>'; + } + + $html .= '</ul></div></small>'; + return $html; + } } |