Improve external task integration
This commit is contained in:
parent
06ebe07ddd
commit
bd695ae985
|
|
@ -244,34 +244,6 @@ 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,
|
||||
'js-modal-replace'
|
||||
);
|
||||
|
||||
$html .= '<li><i class="fa fa-fw fa-plus-square" aria-hidden="true"></i> '.$link.'</li>';
|
||||
}
|
||||
|
||||
$html .= '</ul></div></small>';
|
||||
return $html;
|
||||
}
|
||||
|
||||
public function getNewBoardTaskButton(array $swimlane, array $column)
|
||||
{
|
||||
$html = '<div class="board-add-icon">';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<div class="page-header">
|
||||
<h2><?= $this->text->e($project['name']) ?> > <?= t('New task') ?><?= $this->task->getNewTaskDropdown($project['id'], $values['swimlane_id'], $values['column_id']) ?></h2>
|
||||
<h2><?= $this->text->e($project['name']) ?> > <?= t('New task') ?></h2>
|
||||
</div>
|
||||
<form method="post" action="<?= $this->url->href('TaskCreationController', 'save', array('project_id' => $project['id'])) ?>" autocomplete="off">
|
||||
<?= $this->form->csrf() ?>
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,8 @@
|
|||
KB.component('external-task-view', function (containerElement, options) {
|
||||
|
||||
this.render = function () {
|
||||
KB.dom(containerElement).html('<div id="external-task-view"><i class="fa fa-spinner fa-2x fa-pulse"></div>');
|
||||
|
||||
$.ajax({
|
||||
cache: false,
|
||||
url: options.url,
|
||||
|
|
|
|||
Loading…
Reference in New Issue