From d2b82bc30d2d9cf62f440055b92107337a448ef9 Mon Sep 17 00:00:00 2001 From: pengjiangxiu Date: Wed, 1 Mar 2017 15:19:04 +0800 Subject: [PATCH] * finish task #2940. --- module/bug/config.php | 2 +- module/bug/control.php | 4 ++++ module/bug/lang/zh-cn.php | 1 + module/story/config.php | 2 +- module/story/control.php | 9 ++++++--- module/story/lang/zh-cn.php | 1 + 6 files changed, 14 insertions(+), 5 deletions(-) diff --git a/module/bug/config.php b/module/bug/config.php index 16974deeba..69a1f721d9 100644 --- a/module/bug/config.php +++ b/module/bug/config.php @@ -24,7 +24,7 @@ $config->bug->list->allFields = 'id, module, project, story, task, lastEditedDate'; $config->bug->list->defaultFields = 'id,severity,pri,title,openedBy,assignedTo,resolvedBy,resolution'; -$config->bug->list->exportFields = 'id, product, module, project, story, task, +$config->bug->list->exportFields = 'id, product, branch, module, project, story, task, title, keywords, severity, pri, type, os, browser, steps, status, activatedCount, confirmed, mailto, openedBy, openedDate, openedBuild, diff --git a/module/bug/control.php b/module/bug/control.php index 4f1cf69253..4648e5d613 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -1310,6 +1310,7 @@ class bug extends control $relatedBugIdList = array(); $relatedCaseIdList = array(); $relatedBuildIdList = array(); + $relatedBranchIdList = array(); foreach($bugs as $bug) { @@ -1318,6 +1319,7 @@ class bug extends control $relatedTaskIdList[$bug->task] = $bug->task; $relatedCaseIdList[$bug->case] = $bug->case; $relatedBugIdList[$bug->duplicateBug] = $bug->duplicateBug; + $relatedBranchIdList[$bug->branch] = $bug->branch; /* Process link bugs. */ $linkBugs = explode(',', $bug->linkBug); @@ -1341,6 +1343,7 @@ class bug extends control $relatedTasks = $this->dao->select('id, name')->from(TABLE_TASK)->where('id')->in($relatedTaskIdList)->fetchPairs(); $relatedBugs = $this->dao->select('id, title')->from(TABLE_BUG)->where('id')->in($relatedBugIdList)->fetchPairs(); $relatedCases = $this->dao->select('id, title')->from(TABLE_CASE)->where('id')->in($relatedCaseIdList)->fetchPairs(); + $relatedBranch = $this->dao->select('id, name')->from(TABLE_BRANCH)->where('id')->in($relatedBranchIdList)->fetchPairs(); $relatedBuilds = array('trunk' => $this->lang->trunk) + $this->dao->select('id, name')->from(TABLE_BUILD)->where('id')->in($relatedBuildIdList)->fetchPairs(); $relatedFiles = $this->dao->select('id, objectID, pathname, title')->from(TABLE_FILE)->where('objectType')->eq('bug')->andWhere('objectID')->in(@array_keys($bugs))->fetchGroup('objectID'); @@ -1364,6 +1367,7 @@ class bug extends control if(isset($relatedBugs[$bug->duplicateBug])) $bug->duplicateBug = $relatedBugs[$bug->duplicateBug] . "($bug->duplicateBug)"; if(isset($relatedCases[$bug->case])) $bug->case = $relatedCases[$bug->case] . "($bug->case)"; if(isset($relatedBuilds[$bug->resolvedBuild])) $bug->resolvedBuild = $relatedBuilds[$bug->resolvedBuild] . "(#$bug->resolvedBuild)"; + if(isset($relatedBranch[$bug->branch])) $bug->branch = $relatedBranch[$bug->branch] . "(#$bug->branch)"; if(isset($bugLang->priList[$bug->pri])) $bug->pri = $bugLang->priList[$bug->pri]; if(isset($bugLang->typeList[$bug->type])) $bug->type = $bugLang->typeList[$bug->type]; diff --git a/module/bug/lang/zh-cn.php b/module/bug/lang/zh-cn.php index 7c979512fe..48f09bf924 100644 --- a/module/bug/lang/zh-cn.php +++ b/module/bug/lang/zh-cn.php @@ -13,6 +13,7 @@ $lang->bug->common = 'Bug'; $lang->bug->id = 'Bug编号'; $lang->bug->product = '所属' . $lang->productCommon; +$lang->bug->branch = '分支/平台'; $lang->bug->productplan = '所属计划'; $lang->bug->module = '所属模块'; $lang->bug->moduleAB = '模块'; diff --git a/module/story/config.php b/module/story/config.php index 200f77e38d..dd720b164e 100644 --- a/module/story/config.php +++ b/module/story/config.php @@ -29,7 +29,7 @@ $config->story->editor->activate = array('id' => 'comment', 'tools' => 'simpleTo $config->story->list = new stdclass(); $config->story->list->exportFields = ' - id, product, module, plan, source, title, spec, verify, keywords, + id, product, branch, module, plan, source, title, spec, verify, keywords, pri, estimate, status, stage, openedBy, openedDate, assignedTo, assignedDate, mailto, reviewedBy, reviewedDate, diff --git a/module/story/control.php b/module/story/control.php index 506dff7892..a9ced8268a 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -1331,11 +1331,13 @@ class story extends control $relatedModuleIdList = array(); $relatedStoryIdList = array(); $relatedPlanIdList = array(); + $relatedBranchIdList = array(); foreach($stories as $story) { $relatedModuleIdList[$story->module] = $story->module; $relatedPlanIdList[$story->plan] = $story->plan; + $relatedBranchIdList[$story->branch] = $story->branch; /* Process related stories. */ $relatedStories = $story->childStories . ',' . $story->linkStories . ',' . $story->duplicateStory; @@ -1352,6 +1354,7 @@ class story extends control $relatedStories = $this->dao->select('id,title')->from(TABLE_STORY) ->where('id')->in($relatedStoryIdList)->fetchPairs(); $relatedFiles = $this->dao->select('id, objectID, pathname, title')->from(TABLE_FILE)->where('objectType')->eq('story')->andWhere('objectID')->in(@array_keys($stories))->fetchGroup('objectID'); $relatedSpecs = $this->dao->select('*')->from(TABLE_STORYSPEC)->where('`story`')->in(@array_keys($stories))->orderBy('version desc')->fetchGroup('story'); + $relatedBranch = $this->dao->select('id, name')->from(TABLE_BRANCH)->where('id')->in($relatedBranchIdList)->fetchPairs(); foreach($stories as $story) { @@ -1378,8 +1381,9 @@ class story extends control $story->verify = str_replace(' ', ' ', $story->verify); } /* fill some field with useful value. */ - if(isset($products[$story->product])) $story->product = $products[$story->product] . "(#$story->product)"; - if(isset($relatedModules[$story->module])) $story->module = $relatedModules[$story->module] . "(#$story->module)"; + if(isset($products[$story->product])) $story->product = $products[$story->product] . "(#$story->product)"; + if(isset($relatedModules[$story->module])) $story->module = $relatedModules[$story->module] . "(#$story->module)"; + if(isset($relatedBranch[$story->branch])) $story->branch = $relatedBranch[$story->branch] . "(#$story->branch)"; if(isset($story->plan)) { $plans = ''; @@ -1408,7 +1412,6 @@ class story extends control $story->lastEditedDate = substr($story->lastEditedDate, 0, 10); $story->closedDate = substr($story->closedDate, 0, 10); - if($story->linkStories) { $tmpLinkStories = array(); diff --git a/module/story/lang/zh-cn.php b/module/story/lang/zh-cn.php index 9439b74747..bd179a3825 100644 --- a/module/story/lang/zh-cn.php +++ b/module/story/lang/zh-cn.php @@ -47,6 +47,7 @@ $lang->story->batchChangeModule = "批量修改模块"; $lang->story->common = '需求'; $lang->story->id = '编号'; $lang->story->product = "所属{$lang->productCommon}"; +$lang->story->branch = "分支/平台"; $lang->story->module = '所属模块'; $lang->story->moduleAB = '模块'; $lang->story->source = '需求来源';