* Add execution kanban actions.
This commit is contained in:
@@ -40,6 +40,134 @@ foreach($kanbanList as $current => $region)
|
||||
$laneCount += $region['laneCount'];
|
||||
}
|
||||
|
||||
$operationMenu = array();
|
||||
if(common::hasPriv('execution', 'start')) $operationMenu[] = array('text' => $lang->execution->start, 'url' => inlink('start', "id=$execution->id"), 'data-toggle' => 'modal', 'icon' => 'start');
|
||||
if(common::hasPriv('execution', 'putoff')) $operationMenu[] = array('text' => $lang->execution->putoff, 'url' => inlink('putoff', "id=$execution->id"), 'data-toggle' => 'modal', 'icon' => 'calendar');
|
||||
if(common::hasPriv('execution', 'suspend')) $operationMenu[] = array('text' => $lang->execution->suspend, 'url' => inlink('suspend', "id=$execution->id"), 'data-toggle' => 'modal', 'icon'=> 'pause');
|
||||
if(common::hasPriv('execution', 'close')) $operationMenu[] = array('text' => $lang->execution->close, 'url' => inlink('close', "id=$execution->id"), 'data-toggle' => 'modal', 'icon' => 'off');
|
||||
if(common::hasPriv('execution', 'delete')) $operationMenu[] = array('text' => $lang->delete, 'url' => inlink('delete', "id=$execution->id"), 'className' => 'ajax-submit', 'data-confirm' => $lang->execution->confirmDelete, 'icon' => 'trash');
|
||||
|
||||
$canCreateTask = common::hasPriv('task', 'create');
|
||||
$canBatchCreateTask = common::hasPriv('task', 'batchCreate');
|
||||
$canImportTask = common::hasPriv('execution', 'importTask') && $execution->multiple;
|
||||
|
||||
$canCreateBug = $features['qa'] && $productID && common::hasPriv('bug', 'create');
|
||||
$canBatchCreateBug = $features['qa'] && $productID && common::hasPriv('bug', 'batchCreate') && $execution->multiple;
|
||||
$canImportBug = $features['qa'] && $productID && common::hasPriv('execution', 'importBug') && $execution->multiple;
|
||||
$hasBugButton = $features['qa'] && ($canCreateBug || $canBatchCreateBug);
|
||||
|
||||
$canCreateStory = $features['story'] && $productID && common::hasPriv('story', 'create');
|
||||
$canBatchCreateStory = $features['story'] && $productID && common::hasPriv('story', 'batchCreate');
|
||||
$canLinkStory = $features['story'] && $productID && common::hasPriv('execution', 'linkStory') && !empty($execution->hasProduct);
|
||||
$canLinkStoryByPlan = $features['story'] && $productID && common::hasPriv('execution', 'importplanstories') && !empty($project->hasProduct);
|
||||
$hasStoryButton = $features['story'] && ($canCreateStory || $canBatchCreateStory || $canLinkStory || $canLinkStoryByPlan);
|
||||
|
||||
$hasTaskButton = $canCreateTask || $canBatchCreateTask || $canImportBug;
|
||||
|
||||
$createMenu = array();
|
||||
if($canCreateStory) $createMenu[] = array('text' => $lang->story->create, 'url' => helper::createLink('story', 'create', "productID=$productID&branch=0&moduleID=0&story=0&execution=$execution->id"), 'data-toggle' => 'modal');
|
||||
if($canBatchCreateStory)
|
||||
{
|
||||
if(count($productNames) > 1)
|
||||
{
|
||||
$createMenu[] = array('text' => $lang->story->batchCreate, 'url' => '#batchCreateStory', 'data-toggle' => 'modal');
|
||||
}
|
||||
else
|
||||
{
|
||||
$createMenu[] = array('text' => $lang->story->batchCreate, 'url' => helper::createLink('story', 'batchCreate', "productID=$productID&branch=$branchID&moduleID=0&story=0&execution=$execution->id"), 'data-toggle' => 'modal', 'data-size' => 'lg');
|
||||
}
|
||||
}
|
||||
if($canLinkStory) $createMenu[] = array('text' => $lang->execution->linkStory, 'url' => helper::createLink('execution', 'linkStory', "execution=$execution->id"), 'data-toggle' => 'modal');
|
||||
if($canLinkStoryByPlan) $createMenu[] = array('text' => $lang->execution->importplanstories, 'url' => "#linkStoryByPlan", 'data-toggle' => 'modal');
|
||||
if($hasStoryButton && $hasTaskButton) $createMenu[] = array('type' => 'divider');
|
||||
if($canCreateBug) $createMenu[] = array('text' => $lang->bug->create, 'url' => helper::createLink('bug', 'create', "productID=$productID&branch=0&extra=executionID=$execution->id"), 'data-toggle' => 'modal');
|
||||
if($canBatchCreateBug)
|
||||
{
|
||||
if(count($productNames) > 1)
|
||||
{
|
||||
$createMenu[] = array('text' => $lang->bug->batchCreate, 'url' => '#batchCreateBug', 'data-toggle' => 'modal');
|
||||
}
|
||||
else
|
||||
{
|
||||
$createMenu[] = array('text' => $lang->bug->batchCreate, 'url' => helper::createLink('bug', 'batchCreate', "productID=$productID&branch=$branchID&extra=executionID=$execution->id"), 'data-toggle' => 'modal', 'data-size' => 'lg');
|
||||
}
|
||||
}
|
||||
if(($hasStoryButton or $hasBugButton) and $hasTaskButton) $createMenu[] = array('type' => 'divider');
|
||||
if($canCreateTask) $createMenu[] = array('text' => $lang->task->create, 'url' => helper::createLink('task', 'create', "execution=$execution->id"), 'data-toggle' => 'modal');
|
||||
if($canImportBug) $createMenu[] = array('text' => $lang->execution->importBug, 'url' => helper::createLink('execution', 'importBug', "execution=$execution->id"), 'data-toggle' => 'modal');
|
||||
if($canImportTask) $createMenu[] = array('text' => $lang->execution->importTask, 'url' => helper::createLink('execution', 'importTask', "execution=$execution->id"), 'data-toggle' => 'modal');
|
||||
if($canBatchCreateTask) $createMenu[] = array('text' => $lang->execution->batchCreateTask, 'url' => helper::createLink('task', 'batchCreate', "execution=$execution->id"), 'data-toggle' => 'modal', 'data-size' => 'lg');
|
||||
|
||||
featureBar();
|
||||
toolbar
|
||||
(
|
||||
btnGroup
|
||||
(
|
||||
btn
|
||||
(
|
||||
set
|
||||
(
|
||||
array
|
||||
(
|
||||
'class' => 'btn ghost btn-default',
|
||||
'url' => 'javascript:fullScreen();',
|
||||
'icon' => 'fullscreen'
|
||||
)
|
||||
),
|
||||
$lang->kanban->fullScreen,
|
||||
),
|
||||
common::hasPriv('execution', 'setKanban') ? btn
|
||||
(
|
||||
set
|
||||
(
|
||||
array
|
||||
(
|
||||
'class' => 'btn ghost btn-default',
|
||||
'url' => inlink('setKanban', "id=$execution->id"),
|
||||
'icon' => 'cog-outline',
|
||||
'data-toggle' => 'modal'
|
||||
)
|
||||
),
|
||||
$lang->settings,
|
||||
) : null,
|
||||
common::hasPriv('execution', 'edit') ? btn
|
||||
(
|
||||
set
|
||||
(
|
||||
array
|
||||
(
|
||||
'class' => 'btn ghost btn-default',
|
||||
'url' => inlink('edit', "id=$execution->id"),
|
||||
'icon' => 'edit',
|
||||
'data-toggle' => 'modal',
|
||||
'data-size' => 'lg'
|
||||
)
|
||||
),
|
||||
$lang->edit,
|
||||
) : null,
|
||||
),
|
||||
$operationMenu ? dropdown
|
||||
(
|
||||
btn
|
||||
(
|
||||
setClass('ghost btn square btn-default'),
|
||||
set::icon('ellipsis-v'),
|
||||
),
|
||||
set::caret(false),
|
||||
set::items($operationMenu),
|
||||
) : null,
|
||||
$createMenu ? dropdown
|
||||
(
|
||||
btn
|
||||
(
|
||||
setClass('primary btn square btn-default'),
|
||||
set::icon('plus'),
|
||||
$lang->create,
|
||||
),
|
||||
set::items($createMenu),
|
||||
) : null,
|
||||
);
|
||||
|
||||
div
|
||||
(
|
||||
set::id('kanbanList'),
|
||||
|
||||
Reference in New Issue
Block a user