From 31d52453d190f4871c00a31e364cc2999b5dcbc0 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Fri, 21 Jun 2024 13:40:44 +0800 Subject: [PATCH] * [bug#51165] Remove closed roadmap when batch change roadmap. --- module/product/ui/browse.html.php | 7 ++++--- module/product/zen.php | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/module/product/ui/browse.html.php b/module/product/ui/browse.html.php index 93efbd7f95..2d7718d8eb 100644 --- a/module/product/ui/browse.html.php +++ b/module/product/ui/browse.html.php @@ -212,7 +212,7 @@ foreach($stories as $story) } /* Generate toolbar of DataTable footer. */ -$fnGenerateFootToolbar = function() use ($lang, $product, $productID, $project, $storyType, $browseType, $isProjectStory, $projectHasProduct, $storyProductID, $projectID, $branch, $users, $branchTagOption, $modules, $plans, $branchID, $roadmaps, $config) +$fnGenerateFootToolbar = function() use ($lang, $product, $productID, $project, $storyType, $browseType, $isProjectStory, $projectHasProduct, $storyProductID, $projectID, $branch, $users, $branchTagOption, $modules, $plans, $branchID, $config, $noclosedRoadmaps) { /* Flag variables of permissions. */ $canBeChanged = common::canModify('product', $product); @@ -241,7 +241,8 @@ $fnGenerateFootToolbar = function() use ($lang, $product, $productID, $project, foreach($branchTagOption as $branchID => $branchName) $branchItems[] = array('text' => $branchName, 'class' => 'batch-btn', 'data-formaction' => $this->createLink('story', 'batchChangeBranch', "branchID=$branchID")); foreach($modules as $moduleID => $moduleName) $moduleItems[] = array('text' => $moduleName, 'class' => 'batch-btn', 'data-formaction' => $this->createLink('story', 'batchChangeModule', "moduleID=$moduleID")); foreach($plans as $planID => $planName) $planItems[] = array('text' => $planName, 'class' => 'batch-btn', 'data-formaction' => $this->createLink('story', 'batchChangePlan', "planID=$planID")); - foreach($roadmaps as $roadmapID => $roadmapName) $roadmapItems[] = array('text' => empty($roadmapName) ? $lang->null : $roadmapName, 'class' => 'batch-btn', 'data-formaction' => $this->createLink('story', 'batchChangeRoadmap', "roadmapID=$roadmapID")); + foreach($noclosedRoadmaps as $roadmapID => $roadmapName) $roadmapItems[] = array('text' => empty($roadmapName) ? $lang->null : $roadmapName, 'class' => 'batch-btn', 'data-formaction' => $this->createLink('story', 'batchChangeRoadmap', "roadmapID=$roadmapID")); + foreach($lang->story->stageList as $key => $stageName) { if(!str_contains('|tested|verified|released|closed|', "|$key|")) continue; @@ -289,7 +290,7 @@ $fnGenerateFootToolbar = function() use ($lang, $product, $productID, $project, array('caret' => 'up', 'text' => $lang->story->moduleAB, 'className' => $canBatchChangeModule ? 'secondary batchChangeModuleBtn' : 'hidden', 'items' => $moduleItems, 'type' => 'dropdown', 'data-placement' => 'top-start', 'data-menu' => array('searchBox' => true)), /* Plan button. */ array('caret' => 'up', 'text' => $lang->story->planAB, 'className' => $canBatchChangePlan ? 'secondary batchCnangePlanBtn' : 'hidden', 'items' => $planItems, 'type' => 'dropdown', 'data-placement' => 'top-start', 'data-menu' => array('searchBox' => true)), - $canBatchChangeRoadmap ? array('caret' => 'up', 'text' => $lang->roadmap->common, 'className' => 'secondary batchCnangePlanBtn', 'items' => $roadmapItems, 'type' => 'dropdown', 'data-placement' => 'top-start', 'data-menu' => array('searchBox' => true)) : null, + $canBatchChangeRoadmap ? array('caret' => 'up', 'text' => $lang->roadmap->common, 'className' => 'secondary', 'items' => $roadmapItems, 'type' => 'dropdown', 'data-placement' => 'top-start', 'data-menu' => array('searchBox' => true)) : null, /* Change branch button. */ ($canBatchChangeBranch && $product->type != 'normal') ? array('caret' => 'up', 'text' => $lang->product->branchName[$product->type], 'className' => 'batchChangeBranchBtn', 'items' => $branchItems, 'type' => 'dropdown', 'data-placement' => 'top-start', 'data-menu' => array('searchBox' => true)) : null, /* AssignedTo button. */ diff --git a/module/product/zen.php b/module/product/zen.php index efecb3b33b..920aea9ba1 100644 --- a/module/product/zen.php +++ b/module/product/zen.php @@ -1377,9 +1377,11 @@ class productZen extends product $this->view->storyTasks = $this->loadModel('task')->getStoryTaskCounts($storyIdList); $this->view->storyBugs = $this->loadModel('bug')->getStoryBugCounts($storyIdList); $this->view->storyCases = $this->loadModel('testcase')->getStoryCaseCounts($storyIdList); - $this->view->roadmaps = ($this->config->edition == 'ipd' && $storyType == 'requirement') ? array(0 => '') + $this->loadModel('roadmap')->getPairs($product->id) : array(); $this->view->reports = in_array($this->config->edition, array('max', 'ipd')) ? $this->loadModel('researchreport')->getPairs() : array(); + $this->view->roadmaps = ($this->config->edition == 'ipd' && $storyType == 'requirement') ? array(0 => '') + $this->loadModel('roadmap')->getPairs($product->id) : array(); + $this->view->noclosedRoadmaps = ($this->config->edition == 'ipd' && $storyType == 'requirement') ? array(0 => '') + $this->loadModel('roadmap')->getPairs($product->id, '', 'noclosed') : array(); + $this->display(); }