From 868a29332474298d0008200bf99f8955d950a718 Mon Sep 17 00:00:00 2001 From: zhangzilong Date: Tue, 1 Mar 2022 10:05:30 +0800 Subject: [PATCH 01/12] * --- module/execution/control.php | 11 +++++++++-- module/execution/js/kanban.js | 8 ++++++-- module/execution/view/kanban.html.php | 24 ++++++++++++++++++++++- module/execution/view/taskkanban.html.php | 2 +- 4 files changed, 39 insertions(+), 6 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index 4475f458d8..4570005ccd 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -2048,12 +2048,15 @@ class execution extends control $productID = 0; $branchID = 0; $products = $this->loadModel('product')->getProducts($executionID); + $productNames = array(); if($products) { $productID = key($products); $branches = $this->loadModel('branch')->getPairs($productID, '', $executionID); if($branches) $branchID = key($branches); } + foreach($products as $product) $productNames[$product->id] = $product->name; + $plans = $this->execution->getPlans($products, 'skipParent', $executionID); $allPlans = array('' => ''); @@ -2066,11 +2069,14 @@ class execution extends control $this->view->users = $users; $this->view->regions = $kanbanData; $this->view->execution = $execution; + $this->view->executionID = $executionID; $this->view->userList = $userList; $this->view->browseType = $browseType; $this->view->orderBy = $orderBy; $this->view->groupBy = $groupBy; $this->view->productID = $productID; + $this->view->productNames = $productNames; + $this->view->productNum = count($products); $this->view->branchID = $branchID; $this->view->projectID = $this->loadModel('task')->getProjectID($execution->id); $this->view->allPlans = $allPlans; @@ -2123,8 +2129,9 @@ class execution extends control $canBeChanged = common::canModify('execution', $execution); /* Get execution's product. */ - $productID = 0; - $products = $this->loadModel('product')->getProducts($executionID); + $productID = 0; + $products = $this->loadModel('product')->getProducts($executionID); + $productNames = array(); foreach($products as $product) $productNames[$product->id] = $product->name; if($products) $productID = key($products); diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index 25ec3382c3..20653bc2e7 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -270,7 +270,11 @@ function createColumnCreateMenu(options) else if(col.type == 'unconfirmed') { if(priv.canCreateBug) items.push({label: bugLang.create, url: $.createLink('bug', 'create', 'productID=0&moduleID=0&extra=laneID=' + laneID + ',columnID=' + col.id + ',executionID=' + executionID, '', true), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}}); - if(priv.canBatchCreateBug) items.push({label: bugLang.batchCreate, url: $.createLink('bug', 'batchcreate', 'productID=' + productID + '&branch=&executionID=' + executionID + '&module=0&extra=laneID=' + laneID + ',columnID=' + col.id, '', true), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '90%'}}); + if(priv.canBatchCreateBug) + { + if(productNum == 1) items.push({label: bugLang.batchCreate, url: $.createLink('bug', 'batchcreate', 'productID=' + productID + '&branch=&executionID=' + executionID + '&module=0&extra=laneID=' + laneID + ',columnID=' + col.id, '', true), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '90%'}}); + if(productNum > 1) items.push({label: bugLang.batchCreate, url: '#batchCreateBug', 'attrs' : {'data-toggle': 'modal'}}); + } } else if(col.type == 'wait') { @@ -1049,7 +1053,7 @@ function createStoryMenu(options) var items = []; var showAction = story.$col.type == 'backlog' || story.$col.type == 'ready' || story.$col.type == 'developing' || story.$col.type == 'developed' || story.$col.type == 'testing' || story.$col.type == 'tested' || story.$col.type == 'verified' || story.$col.type == 'released'; - + if(priv.canEditStory) items.push({label: storyLang.edit, icon: 'edit', url: createLink('story', 'edit', 'storyID=' + story.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}}); if(priv.canChangeStory && showAction) items.push({label: storyLang.change, icon: 'change', url: createLink('story', 'change', 'storyID=' + story.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}}); if(priv.canCreateTask && showAction) items.push({label: executionLang.wbs, icon: 'plus', url: createLink('task', 'create', 'executionID=' + execution.id + '&storyID=' + story.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}}); diff --git a/module/execution/view/kanban.html.php b/module/execution/view/kanban.html.php index 99873cc289..2025a94ea1 100644 --- a/module/execution/view/kanban.html.php +++ b/module/execution/view/kanban.html.php @@ -168,7 +168,13 @@ js::set('hasTaskButton', $hasTaskButton); ' . html::a('#linkStoryByPlan', $lang->execution->linkStoryByPlan, '', 'data-toggle="modal"') . '';?> ';?> ' . html::a(helper::createLink('bug', 'create', "productID=$productID&branch=0&extra=executionID=$execution->id", '', true), $lang->bug->create, '', "class='iframe'") . '';?> - ' . html::a(helper::createLink('bug', 'batchCreate', "productID=$productID&branch=$branchID&executionID=$execution->id", '', true), $lang->bug->batchCreate, '', "class='iframe'") . '';?> + ' . html::a(helper::createLink('bug', 'batchCreate', "productID=$productID&branch=$branchID&executionID=$execution->id", '', true), $lang->bug->batchCreate, '', "class='iframe'") . ''; + if($productNum > 1) $batchCreateBugLink = '
  • ' . html::a('#batchCreateBug', $lang->bug->batchCreate, '', "data-toggle='modal'") . '
  • '; + echo $batchCreateBugLink; + }?> ';?> ' . html::a(helper::createLink('task', 'create', "execution=$execution->id", '', true), $lang->task->create, '', "class='iframe'") . '';?> ' . html::a(helper::createLink('execution', 'importBug', "executionID=$execution->id", '', true), $lang->execution->importBug, '', "class='ifram'") . '';?> @@ -227,4 +233,20 @@ js::set('hasTaskButton', $hasTaskButton); + diff --git a/module/execution/view/taskkanban.html.php b/module/execution/view/taskkanban.html.php index c3384d74c5..95895e118f 100644 --- a/module/execution/view/taskkanban.html.php +++ b/module/execution/view/taskkanban.html.php @@ -148,7 +148,7 @@ From 83bf7d564ac87bd4b580b67b9b52e4cc785b7c9e Mon Sep 17 00:00:00 2001 From: zhangzilong Date: Tue, 1 Mar 2022 10:13:43 +0800 Subject: [PATCH 02/12] * Finish task #49297. --- 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 20653bc2e7..548f12f4cf 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -272,8 +272,8 @@ function createColumnCreateMenu(options) if(priv.canCreateBug) items.push({label: bugLang.create, url: $.createLink('bug', 'create', 'productID=0&moduleID=0&extra=laneID=' + laneID + ',columnID=' + col.id + ',executionID=' + executionID, '', true), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}}); if(priv.canBatchCreateBug) { - if(productNum == 1) items.push({label: bugLang.batchCreate, url: $.createLink('bug', 'batchcreate', 'productID=' + productID + '&branch=&executionID=' + executionID + '&module=0&extra=laneID=' + laneID + ',columnID=' + col.id, '', true), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '90%'}}); if(productNum > 1) items.push({label: bugLang.batchCreate, url: '#batchCreateBug', 'attrs' : {'data-toggle': 'modal'}}); + else items.push({label: bugLang.batchCreate, url: $.createLink('bug', 'batchcreate', 'productID=' + productID + '&branch=&executionID=' + executionID + '&module=0&extra=laneID=' + laneID + ',columnID=' + col.id, '', true), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '90%'}}); } } else if(col.type == 'wait') diff --git a/module/execution/js/taskkanban.js b/module/execution/js/taskkanban.js index a506c790ea..d10800f92b 100644 --- a/module/execution/js/taskkanban.js +++ b/module/execution/js/taskkanban.js @@ -805,8 +805,8 @@ function createColumnCreateMenu(options) if(priv.canCreateBug) items.push({label: bugLang.create, url: $.createLink('bug', 'create', 'productID=0&moduleID=0&extra=executionID=' + executionID, '', true), className: 'iframe', attrs: {'data-width': '80%'}}); if(priv.canBatchCreateBug) { - if(productNum == 1) items.push({label: bugLang.batchCreate, url: $.createLink('bug', 'batchcreate', 'productID=' + productID + '&moduleID=0&executionID=' + executionID, '', true), className: 'iframe', attrs: {'data-width': '90%'}}); if(productNum > 1) items.push({label: bugLang.batchCreate, url: '#batchCreateBug', 'attrs' : {'data-toggle': 'modal'}}); + else items.push({label: bugLang.batchCreate, url: $.createLink('bug', 'batchcreate', 'productID=' + productID + '&moduleID=0&executionID=' + executionID, '', true), className: 'iframe', attrs: {'data-width': '90%'}}); } } else From 1777586537bd65b102979666c2381162a2fb5eae Mon Sep 17 00:00:00 2001 From: zhangzilong Date: Tue, 1 Mar 2022 10:59:25 +0800 Subject: [PATCH 03/12] * Finish task #49297. --- module/execution/js/kanban.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index 548f12f4cf..565f1df632 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -1240,6 +1240,16 @@ $(function() } }); + $('#product').change(function() + { + var product = $('#product').val(); + if(product) + { + var link = createLink('bug', 'batchCreate', 'productID=' + product + '&branch=' + branchID + '&executionID=' + executionID); + $('#batchCreateBugButton').attr('href', link); + } + }); + $(document).on('click', '#splitTable .btn-plus', function() { var tr = $(this).closest('tr'); From 9150e9903b8c6ac8e320a73c1a1b071aeaf3293c Mon Sep 17 00:00:00 2001 From: zhangzilong Date: Tue, 1 Mar 2022 11:00:08 +0800 Subject: [PATCH 04/12] * Finish task #49297. --- module/execution/view/kanban.html.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/execution/view/kanban.html.php b/module/execution/view/kanban.html.php index 2025a94ea1..a5b9e4f1b8 100644 --- a/module/execution/view/kanban.html.php +++ b/module/execution/view/kanban.html.php @@ -48,6 +48,7 @@ js::set('colorListLang', $lang->kanbancard->colorList); js::set('colorList', $this->config->kanban->cardColorList); js::set('projectID', $projectID); js::set('vision', $this->config->vision); +js::set('branchID', $branchID); $canSortRegion = commonModel::hasPriv('kanban', 'sortRegion') && count($regions) > 1; $canEditRegion = commonModel::hasPriv('kanban', 'editRegion'); From aff8bf40efd1463e50c6c536c7fa5101bd599241 Mon Sep 17 00:00:00 2001 From: zhangzilong Date: Tue, 1 Mar 2022 11:19:01 +0800 Subject: [PATCH 05/12] * Finish task #49297. --- module/execution/js/kanban.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index 565f1df632..a0f6ec0fc3 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -273,7 +273,7 @@ function createColumnCreateMenu(options) if(priv.canBatchCreateBug) { if(productNum > 1) items.push({label: bugLang.batchCreate, url: '#batchCreateBug', 'attrs' : {'data-toggle': 'modal'}}); - else items.push({label: bugLang.batchCreate, url: $.createLink('bug', 'batchcreate', 'productID=' + productID + '&branch=&executionID=' + executionID + '&module=0&extra=laneID=' + laneID + ',columnID=' + col.id, '', true), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '90%'}}); + else items.push({label: bugLang.batchCreate, url: $.createLink('bug', 'batchcreate', 'productID=' + productID + '&branch=&executionID=' + executionID + '&module=0&extra=laneID=' + laneID + ',columnID=' + col.id, '', true), className: 'iframe', attrs: {'data-width': '90%'}}); } } else if(col.type == 'wait') @@ -1245,7 +1245,7 @@ $(function() var product = $('#product').val(); if(product) { - var link = createLink('bug', 'batchCreate', 'productID=' + product + '&branch=' + branchID + '&executionID=' + executionID); + var link = createLink('bug', 'batchCreate', 'productID=' + product + '&branch=&executionID=' + executionID, '', true); $('#batchCreateBugButton').attr('href', link); } }); From d8178d01eb56b3d82f70ca7e1eded28fc67ca47b Mon Sep 17 00:00:00 2001 From: zhangzilong Date: Tue, 1 Mar 2022 14:27:16 +0800 Subject: [PATCH 06/12] * Finish task #49297. --- module/execution/view/kanban.html.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/execution/view/kanban.html.php b/module/execution/view/kanban.html.php index a5b9e4f1b8..9aaa1519b1 100644 --- a/module/execution/view/kanban.html.php +++ b/module/execution/view/kanban.html.php @@ -43,6 +43,7 @@ js::set('noAssigned', $lang->kanbancard->noAssigned); js::set('users', $users); js::set('entertime', time()); js::set('displayCards', $execution->displayCards); +js::set('productNum', $productNum); js::set('fluidBoard', $execution->fluidBoard); js::set('colorListLang', $lang->kanbancard->colorList); js::set('colorList', $this->config->kanban->cardColorList); From 3b5ebbda16310bf6e3f9d3a95de59f83cac9a733 Mon Sep 17 00:00:00 2001 From: zhangzilong Date: Tue, 1 Mar 2022 14:57:23 +0800 Subject: [PATCH 07/12] * Finish task #49297. --- module/bug/control.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/bug/control.php b/module/bug/control.php index 8d555f63c6..72690257bf 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -676,6 +676,7 @@ class bug extends control { $kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, $this->session->execLaneType ? $this->session->execLaneType : 'all'); $kanbanData = json_encode($kanbanData); + return print(js::reload('parent.parent')); return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); } else From 2f38d907ee0140814a4ed4d06761769a6eb58bdf Mon Sep 17 00:00:00 2001 From: zhangzilong Date: Wed, 2 Mar 2022 09:07:15 +0800 Subject: [PATCH 08/12] * Code for task #49297. --- module/execution/js/kanban.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index a0f6ec0fc3..f9ebc24b0c 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -273,7 +273,7 @@ function createColumnCreateMenu(options) if(priv.canBatchCreateBug) { if(productNum > 1) items.push({label: bugLang.batchCreate, url: '#batchCreateBug', 'attrs' : {'data-toggle': 'modal'}}); - else items.push({label: bugLang.batchCreate, url: $.createLink('bug', 'batchcreate', 'productID=' + productID + '&branch=&executionID=' + executionID + '&module=0&extra=laneID=' + laneID + ',columnID=' + col.id, '', true), className: 'iframe', attrs: {'data-width': '90%'}}); + else items.push({label: bugLang.batchCreate, url: $.createLink('bug', 'batchcreate', 'productID=' + productID + '&branch=&executionID=' + executionID + '&module=0&extra=&laneID=' + laneID + '&columnID=' + col.id, '', true), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '90%'}}); } } else if(col.type == 'wait') From e3b101a807ad0baa9228d087df7de900fc2caacd Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Wed, 2 Mar 2022 09:36:32 +0800 Subject: [PATCH 09/12] * Fix bug of foreach. --- module/execution/control.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index 4570005ccd..adf6db53ca 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -2130,10 +2130,10 @@ class execution extends control /* Get execution's product. */ $productID = 0; - $products = $this->loadModel('product')->getProducts($executionID); $productNames = array(); - foreach($products as $product) $productNames[$product->id] = $product->name; + $products = $this->loadModel('product')->getProducts($executionID); if($products) $productID = key($products); + foreach($products as $product) $productNames[$product->id] = $product->name; $plans = $this->execution->getPlans($products); $allPlans = array('' => ''); From 996992936e8059b75034bf827d4a99d1caae4af1 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Wed, 2 Mar 2022 10:00:08 +0800 Subject: [PATCH 10/12] * Change branches for batch create bug in execution. --- module/bug/control.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/module/bug/control.php b/module/bug/control.php index 72690257bf..cabfb089c9 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -744,6 +744,18 @@ class bug extends control $projectID = $this->lang->navGroup->bug == 'project' ? $this->session->project : (isset($execution) ? $execution->project : 0); + /* Get branches. */ + if($executionID) + { + $productBranches = $product->type != 'normal' ? $this->execution->getBranchByProduct($productID, $executionID) : array(); + $branches = isset($productBranches[$productID]) ? $productBranches[$productID] : array(); + $branch = key($branches); + } + else + { + $branches = $product->type != 'normal' ? $this->loadModel('branch')->getPairs($productID, 'active') : array(); + } + $this->view->customFields = $customFields; $this->view->showFields = $showFields; @@ -762,7 +774,7 @@ class bug extends control $this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0, $branch === 'all' ? 0 : $branch); $this->view->moduleID = $moduleID; $this->view->branch = $branch; - $this->view->branches = $this->loadModel('branch')->getPairs($productID, 'active'); + $this->view->branches = $branches; $this->display(); } From ccc4ce9298742f77e4e5ae2c75c4f4b2897ee9d2 Mon Sep 17 00:00:00 2001 From: zhangzilong Date: Wed, 2 Mar 2022 10:10:47 +0800 Subject: [PATCH 11/12] * Code for bug #49297. --- module/bug/control.php | 1 - 1 file changed, 1 deletion(-) diff --git a/module/bug/control.php b/module/bug/control.php index cabfb089c9..78f76cf432 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -677,7 +677,6 @@ class bug extends control $kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, $this->session->execLaneType ? $this->session->execLaneType : 'all'); $kanbanData = json_encode($kanbanData); return print(js::reload('parent.parent')); - return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); } else { From 92f4d32a682303ff982ec8a8f4b4b204675da064 Mon Sep 17 00:00:00 2001 From: zhangzilong Date: Wed, 2 Mar 2022 10:57:48 +0800 Subject: [PATCH 12/12] * Finish task #49297. --- module/bug/control.php | 2 +- module/execution/view/kanban.html.php | 2 +- module/execution/view/taskkanban.html.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index 78f76cf432..142fd93027 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -676,7 +676,7 @@ class bug extends control { $kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, $this->session->execLaneType ? $this->session->execLaneType : 'all'); $kanbanData = json_encode($kanbanData); - return print(js::reload('parent.parent')); + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); } else { diff --git a/module/execution/view/kanban.html.php b/module/execution/view/kanban.html.php index 9aaa1519b1..0bb56f3009 100644 --- a/module/execution/view/kanban.html.php +++ b/module/execution/view/kanban.html.php @@ -245,7 +245,7 @@ js::set('hasTaskButton', $hasTaskButton); diff --git a/module/execution/view/taskkanban.html.php b/module/execution/view/taskkanban.html.php index 95895e118f..da27ef926f 100644 --- a/module/execution/view/taskkanban.html.php +++ b/module/execution/view/taskkanban.html.php @@ -148,7 +148,7 @@