From 2c85628991800045ef1feace200036aa392acab5 Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Mon, 18 Mar 2024 13:17:31 +0800 Subject: [PATCH] * Merge: Finish task #113420. --- module/datatable/control.php | 2 ++ module/product/config/search.php | 1 + module/product/model.php | 2 ++ module/product/ui/browse.html.php | 3 ++- module/product/zen.php | 3 +++ module/story/config/dtable.php | 10 +++++++++- module/story/lang/de.php | 1 + module/story/lang/en.php | 1 + module/story/lang/fr.php | 1 + module/story/lang/zh-cn.php | 1 + module/story/model.php | 1 + 11 files changed, 24 insertions(+), 2 deletions(-) diff --git a/module/datatable/control.php b/module/datatable/control.php index 1fd8f35611..a1155c32bc 100644 --- a/module/datatable/control.php +++ b/module/datatable/control.php @@ -188,6 +188,8 @@ class datatable extends control if($extra == 'unsetStory' && isset($cols['story'])) unset($cols['story']); + if($this->config->edition != 'ipd' || ($this->config->edition == 'ipd' && $module == 'product' && $method == 'browse' && $extra != 'requirement')) unset($cols['roadmap']); + $this->view->module = $module; $this->view->method = $method; $this->view->cols = $cols; diff --git a/module/product/config/search.php b/module/product/config/search.php index ba7073da78..81146c315f 100644 --- a/module/product/config/search.php +++ b/module/product/config/search.php @@ -8,6 +8,7 @@ $config->product->search['fields']['keywords'] = $lang->story->keywords; $config->product->search['fields']['status'] = $lang->story->status; $config->product->search['fields']['pri'] = $lang->story->pri; $config->product->search['fields']['module'] = $lang->story->module; +$config->product->search['fields']['roadmap'] = $lang->story->roadmap; $config->product->search['fields']['stage'] = $lang->story->stage; $config->product->search['fields']['product'] = $lang->story->product; diff --git a/module/product/model.php b/module/product/model.php index 569fe34a20..fd3c4713d8 100755 --- a/module/product/model.php +++ b/module/product/model.php @@ -734,6 +734,8 @@ class productModel extends model unset($searchConfig['params']['plan']); unset($searchConfig['fields']['stage']); unset($searchConfig['params']['stage']); + + if($this->config->edition == 'ipd') $searchConfig['params']['roadmap']['values'] = $this->loadModel('roadmap')->getPairs($productID); } else { diff --git a/module/product/ui/browse.html.php b/module/product/ui/browse.html.php index 549465c23f..0408c07ebe 100644 --- a/module/product/ui/browse.html.php +++ b/module/product/ui/browse.html.php @@ -183,13 +183,14 @@ if($app->rawModule == 'projectstory') $config->story->dtable->fieldList['title'] $setting = $this->loadModel('datatable')->getSetting('product', 'browse', false, $storyType); if($storyType == 'requirement') unset($setting['plan'], $setting['stage'], $setting['taskCount'], $setting['bugCount'], $setting['caseCount']); +if($storyType == 'story' || ($config->edition != 'ipd' && $storyType == 'requirement')) unset($setting['roadmap']); $cols = array_values($setting); /* DataTable data. */ $this->loadModel('story'); $data = array(); -$options = array('storyTasks' => $storyTasks, 'storyBugs' => $storyBugs, 'storyCases' => $storyCases, 'modules' => $modules, 'plans' => (isset($plans) ? $plans : array()), 'users' => $users, 'execution' => $project); +$options = array('storyTasks' => $storyTasks, 'storyBugs' => $storyBugs, 'storyCases' => $storyCases, 'modules' => $modules, 'plans' => (isset($plans) ? $plans : array()), 'users' => $users, 'execution' => $project, 'roadmaps' => $roadmaps); foreach($stories as $story) { $story->rawModule = $story->module; diff --git a/module/product/zen.php b/module/product/zen.php index aa08dc946a..6a16ea7199 100644 --- a/module/product/zen.php +++ b/module/product/zen.php @@ -1177,6 +1177,8 @@ class productZen extends product { if($isProjectStory && !$productID && !empty($this->products)) $productID = (int)key($this->products); // If toggle a project by the #swapper component on the story page of the projectstory module, the $productID may be empty. Make sure it has value. + if($this->config->edition != 'ipd' || ($this->config->edition == 'ipd' && $storyType == 'story')) unset($this->config->product->search['fields']['roadmap']); + if(isset($project->hasProduct) && empty($project->hasProduct)) { /* The none-product project don't need display the product in the search form. */ @@ -1442,6 +1444,7 @@ 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') ? $this->loadModel('roadmap')->getPairs($product->id) : array(); $this->display(); } diff --git a/module/story/config/dtable.php b/module/story/config/dtable.php index 02217036c2..7f25271ba2 100644 --- a/module/story/config/dtable.php +++ b/module/story/config/dtable.php @@ -2,7 +2,7 @@ global $lang, $app; $config->story->dtable = new stdclass(); -$config->story->dtable->defaultField = array('id', 'title', 'pri', 'plan', 'status', 'openedBy', 'estimate', 'reviewedBy', 'stage', 'assignedTo', 'taskCount', 'actions'); +$config->story->dtable->defaultField = array('id', 'title', 'pri', 'plan', 'roadmap', 'status', 'openedBy', 'estimate', 'reviewedBy', 'stage', 'assignedTo', 'taskCount', 'actions'); $config->story->dtable->fieldList['id']['name'] = 'id'; $config->story->dtable->fieldList['id']['title'] = $lang->idAB; @@ -61,6 +61,14 @@ $config->story->dtable->fieldList['plan']['show'] = true; $config->story->dtable->fieldList['plan']['group'] = 4; $config->story->dtable->fieldList['plan']['dataSource'] = array('module' => 'productplan', 'method' => 'getPairs', 'params' => '$productID'); +$config->story->dtable->fieldList['roadmap']['name'] = 'roadmap'; +$config->story->dtable->fieldList['roadmap']['title'] = $lang->story->roadmap; +$config->story->dtable->fieldList['roadmap']['fixed'] = 'left'; +$config->story->dtable->fieldList['roadmap']['required'] = false; +$config->story->dtable->fieldList['roadmap']['type'] = 'html'; +$config->story->dtable->fieldList['roadmap']['show'] = true; +$config->story->dtable->fieldList['roadmap']['sortType'] = true; + $config->story->dtable->fieldList['category']['name'] = 'category'; $config->story->dtable->fieldList['category']['title'] = $lang->story->category; $config->story->dtable->fieldList['category']['sortType'] = true; diff --git a/module/story/lang/de.php b/module/story/lang/de.php index c43474e0f4..8c8eb2b442 100644 --- a/module/story/lang/de.php +++ b/module/story/lang/de.php @@ -120,6 +120,7 @@ $lang->story->project = $lang->projectCommon; $lang->story->branch = "Branch/Platform"; $lang->story->module = 'Module'; $lang->story->moduleAB = 'Module'; +$lang->story->roadmap = 'Roadmap'; $lang->story->source = 'Von'; $lang->story->sourceNote = 'Hinweis'; $lang->story->fromBug = 'Von Bug'; diff --git a/module/story/lang/en.php b/module/story/lang/en.php index 132fb01190..12e250eee7 100644 --- a/module/story/lang/en.php +++ b/module/story/lang/en.php @@ -120,6 +120,7 @@ $lang->story->project = $lang->projectCommon; $lang->story->branch = "Branch/Platform"; $lang->story->module = 'Module'; $lang->story->moduleAB = 'Module'; +$lang->story->roadmap = 'Roadmap'; $lang->story->source = 'From'; $lang->story->sourceNote = 'Note'; $lang->story->fromBug = 'From Bug'; diff --git a/module/story/lang/fr.php b/module/story/lang/fr.php index 70fe62abe9..4a3efc7fb4 100644 --- a/module/story/lang/fr.php +++ b/module/story/lang/fr.php @@ -120,6 +120,7 @@ $lang->story->project = $lang->projectCommon; $lang->story->branch = "Branche/Plateforme"; $lang->story->module = 'Module'; $lang->story->moduleAB = 'Module'; +$lang->story->roadmap = 'Roadmap'; $lang->story->source = 'De'; $lang->story->sourceNote = 'Note'; $lang->story->fromBug = 'Depuis Bug'; diff --git a/module/story/lang/zh-cn.php b/module/story/lang/zh-cn.php index 32b799120f..353be320e7 100644 --- a/module/story/lang/zh-cn.php +++ b/module/story/lang/zh-cn.php @@ -120,6 +120,7 @@ $lang->story->project = "所属{$lang->projectCommon}"; $lang->story->branch = "平台/分支"; $lang->story->module = '所属模块'; $lang->story->moduleAB = '模块'; +$lang->story->roadmap = '所属路标'; $lang->story->source = "来源"; $lang->story->sourceNote = '来源备注'; $lang->story->fromBug = '来源Bug'; diff --git a/module/story/model.php b/module/story/model.php index be937901d3..f96e2c1a1c 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -4411,6 +4411,7 @@ class storyModel extends model $story->module = zget(zget($options, 'modules', array()), $story->module, ''); $story->branch = zget(zget($options, 'branches', array()), $story->branch, ''); $story->plan = isset($story->planTitle) ? $story->planTitle : zget(zget($options, 'plans', array()), $story->plan, ''); + $story->roadmap = zget(zget($options, 'roadmaps', array()), $story->roadmap, 0); $story->source = zget($this->lang->story->sourceList, $story->source, ''); $story->category = zget($this->lang->story->categoryList, $story->category);