diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index 0ae0cece62..5c8a072197 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -692,6 +692,17 @@ function renderCount($count, count, column) } } +/** + * Alert to link product. + * + * @access public + * @return void + */ +function tips() +{ + bootbox.alert(needLinkProducts); +} + /** * Render header of a column. */ @@ -726,10 +737,11 @@ function renderHeaderCol($column, column, $header, kanbanData) var printMoreBtn = (columnPrivs.includes('setColumn') || columnPrivs.includes('setWIP')); /* Render more menu. */ - if(((column.type == 'backlog' && hasStoryButton) || (column.type == 'wait' && hasTaskButton) || (column.type == 'unconfirmed' && hasBugButton)) && $actions.children('.text-primary').length == 0) + if(column.type == 'backlog' || column.type == 'wait' || column.type == 'unconfirmed' && $actions.children('.text-primary').length == 0) { + var tips = productID ? '' : 'onclick="tips()"'; $actions.append([ - '', + '', '', '' ].join('')); diff --git a/module/execution/js/taskkanban.js b/module/execution/js/taskkanban.js index f59eac1f7b..27da8b0eea 100644 --- a/module/execution/js/taskkanban.js +++ b/module/execution/js/taskkanban.js @@ -300,6 +300,17 @@ function renderColumnCount($count, count, col) } } +/** + * Alert to link product. + * + * @access public + * @return void + */ +function tips() +{ + bootbox.alert(needLinkProducts); +} + /** * Render header column * @param {JQuery} $col Header column element @@ -318,10 +329,11 @@ function renderHeaderCol($col, col, $header, kanban) if(priv.canCreateTask || priv.canBatchCreateTask) printTaskButton = true; if(priv.canCreateBug || priv.canBatchCreateBug) printBugButton = true; - if((col.type === 'backlog' && printStoryButton) || (col.type === 'wait' && printTaskButton) || (col.type == 'unconfirmed' && printBugButton)) + if(col.type === 'backlog' || col.type === 'wait' || col.type == 'unconfirmed') { + var tips = productID ? '' : 'onclick="tips()"'; $actions.append([ - '', + '', '', '' ].join('')); diff --git a/module/execution/lang/en.php b/module/execution/lang/en.php index e212fcdba8..320931e280 100644 --- a/module/execution/lang/en.php +++ b/module/execution/lang/en.php @@ -271,6 +271,7 @@ $lang->execution->treeOnlyStory = 'Show Story Only'; $lang->execution->storyKanban = 'Story Kanban'; $lang->execution->storySort = 'Rank Story'; $lang->execution->importPlanStory = $lang->executionCommon . ' is created!\nDo you want to import stories that have been linked to the plan?'; +$lang->execution->needLinkProducts = 'The execution has not been linked with any product, and the related functions cannot be used. Please link the product first and try again.'; $lang->execution->iteration = 'Iterations'; $lang->execution->iterationInfo = '%s Iterations'; $lang->execution->viewAll = 'View All'; diff --git a/module/execution/lang/zh-cn.php b/module/execution/lang/zh-cn.php index 6311fa255c..b9244ac46b 100644 --- a/module/execution/lang/zh-cn.php +++ b/module/execution/lang/zh-cn.php @@ -271,6 +271,7 @@ $lang->execution->treeOnlyStory = "树状图只看{$lang->SRCommon}"; $lang->execution->storyKanban = "{$lang->SRCommon}看板"; $lang->execution->storySort = "{$lang->SRCommon}排序"; $lang->execution->importPlanStory = '创建' . $lang->executionCommon . '成功!\n是否导入计划关联的相关' . $lang->SRCommon . '?'; +$lang->execution->needLinkProducts = '该执行还未关联任何产品,相关功能无法使用,请先关联产品后再试。'; $lang->execution->iteration = '版本迭代'; $lang->execution->iterationInfo = '迭代%s次'; $lang->execution->viewAll = '查看所有'; diff --git a/module/execution/view/kanban.html.php b/module/execution/view/kanban.html.php index 81d1ddb848..989f89af83 100644 --- a/module/execution/view/kanban.html.php +++ b/module/execution/view/kanban.html.php @@ -52,6 +52,7 @@ js::set('vision', $this->config->vision); js::set('productCount', count($productNames)); js::set('executionID', $execution->id); js::set('reviewStoryParis', $reviewStoryParis); +js::set('needLinkProducts', $lang->execution->needLinkProducts); $canSortRegion = commonModel::hasPriv('kanban', 'sortRegion') && count($regions) > 1; $canEditRegion = commonModel::hasPriv('kanban', 'editRegion'); @@ -109,9 +110,6 @@ js::set('priv', 'canUnlinkStory' => common::hasPriv('execution', 'unlinkStory'), ) ); -js::set('hasStoryButton', $hasStoryButton); -js::set('hasBugButton', $hasBugButton); -js::set('hasTaskButton', $hasTaskButton); ?>