From 0f645a096e25e0db72ccaef57da2e92eee91f7f6 Mon Sep 17 00:00:00 2001 From: zhouxudong Date: Tue, 7 Jun 2022 05:39:44 +0000 Subject: [PATCH 1/4] * Finish task #56396. --- module/execution/js/kanban.js | 16 ++++++++++++++-- module/execution/js/taskkanban.js | 16 ++++++++++++++-- module/execution/lang/en.php | 1 + module/execution/lang/zh-cn.php | 1 + module/execution/view/kanban.html.php | 1 + module/execution/view/taskkanban.html.php | 1 + 6 files changed, 32 insertions(+), 4 deletions(-) diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index 5cb61c1fca..1a92bad764 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -691,6 +691,17 @@ function renderCount($count, count, column) } } +/** + * Alert to link product. + * + * @access public + * @return void + */ +function tips() +{ + bootbox.alert(linkProducts); +} + /** * Render header of a column. */ @@ -725,10 +736,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' && hasTaskButton) || 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 4873fc94f7..43ad3a17df 100644 --- a/module/execution/js/taskkanban.js +++ b/module/execution/js/taskkanban.js @@ -297,6 +297,17 @@ function renderColumnCount($count, count, col) } } +/** + * Alert to link product. + * + * @access public + * @return void + */ +function tips() +{ + bootbox.alert(linkProducts); +} + /** * Render header column * @param {JQuery} $col Header column element @@ -315,10 +326,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' && printTaskButton) || 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 e7f31a3056..0db05c8802 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->linkProducts = '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 7722eb13d6..04c4783953 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->linkProducts = '该执行还未关联任何产品,相关功能无法使用,请先关联产品后再试。'; $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..cb0ae5d8ff 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('linkProducts', $lang->execution->linkProducts); $canSortRegion = commonModel::hasPriv('kanban', 'sortRegion') && count($regions) > 1; $canEditRegion = commonModel::hasPriv('kanban', 'editRegion'); diff --git a/module/execution/view/taskkanban.html.php b/module/execution/view/taskkanban.html.php index 7ec69b0041..4f22ed3eb5 100644 --- a/module/execution/view/taskkanban.html.php +++ b/module/execution/view/taskkanban.html.php @@ -213,4 +213,5 @@ js::set('priv', fluidBoard);?> displayCards);?> +execution->linkProducts);?> From 1a952376fed687c065bba6c30c7674a8b9dc0b50 Mon Sep 17 00:00:00 2001 From: zhouxudong Date: Tue, 7 Jun 2022 05:44:06 +0000 Subject: [PATCH 2/4] * Finish task #56396. --- module/execution/js/kanban.js | 2 +- module/execution/js/taskkanban.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index 1a92bad764..c5d2d2eaf9 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -736,7 +736,7 @@ function renderHeaderCol($column, column, $header, kanbanData) var printMoreBtn = (columnPrivs.includes('setColumn') || columnPrivs.includes('setWIP')); /* Render more menu. */ - if(column.type == 'backlog' || (column.type == 'wait' && hasTaskButton) || column.type == 'unconfirmed' && $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([ diff --git a/module/execution/js/taskkanban.js b/module/execution/js/taskkanban.js index 43ad3a17df..f7d70bcb9d 100644 --- a/module/execution/js/taskkanban.js +++ b/module/execution/js/taskkanban.js @@ -326,7 +326,7 @@ function renderHeaderCol($col, col, $header, kanban) if(priv.canCreateTask || priv.canBatchCreateTask) printTaskButton = true; if(priv.canCreateBug || priv.canBatchCreateBug) printBugButton = true; - if(col.type === 'backlog' || (col.type === 'wait' && printTaskButton) || col.type == 'unconfirmed') + if(col.type === 'backlog' || col.type === 'wait' || col.type == 'unconfirmed') { var tips = (productID) ? '' : 'onclick="tips()"'; $actions.append([ From 607a871ddfd660e583587aa6c97b7d0606e18e1f Mon Sep 17 00:00:00 2001 From: zhouxudong Date: Tue, 7 Jun 2022 06:09:44 +0000 Subject: [PATCH 3/4] * Finish task #56396. --- module/execution/js/kanban.js | 2 +- module/execution/js/taskkanban.js | 2 +- module/execution/view/kanban.html.php | 3 --- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index c5d2d2eaf9..5d7394485d 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -738,7 +738,7 @@ function renderHeaderCol($column, column, $header, kanbanData) /* Render more menu. */ if(column.type == 'backlog' || column.type == 'wait' || column.type == 'unconfirmed' && $actions.children('.text-primary').length == 0) { - var tips = (productID) ? '' : 'onclick="tips()"'; + var tips = productID ? '' : 'onclick="tips()"'; $actions.append([ '', '', diff --git a/module/execution/js/taskkanban.js b/module/execution/js/taskkanban.js index f7d70bcb9d..8997ce129e 100644 --- a/module/execution/js/taskkanban.js +++ b/module/execution/js/taskkanban.js @@ -328,7 +328,7 @@ function renderHeaderCol($col, col, $header, kanban) if(col.type === 'backlog' || col.type === 'wait' || col.type == 'unconfirmed') { - var tips = (productID) ? '' : 'onclick="tips()"'; + var tips = productID ? '' : 'onclick="tips()"'; $actions.append([ '', '', diff --git a/module/execution/view/kanban.html.php b/module/execution/view/kanban.html.php index cb0ae5d8ff..c1a6d06bce 100644 --- a/module/execution/view/kanban.html.php +++ b/module/execution/view/kanban.html.php @@ -110,9 +110,6 @@ js::set('priv', 'canUnlinkStory' => common::hasPriv('execution', 'unlinkStory'), ) ); -js::set('hasStoryButton', $hasStoryButton); -js::set('hasBugButton', $hasBugButton); -js::set('hasTaskButton', $hasTaskButton); ?>