From 235b04f76e5b263c4ed2aaa6ef824e5a444c1881 Mon Sep 17 00:00:00 2001 From: zhouxin Date: Thu, 19 May 2022 02:02:22 +0000 Subject: [PATCH 1/3] * Finis task #54352. --- module/datatable/config.php | 1 + module/execution/control.php | 69 +++++++++++--- module/execution/js/bug.js | 4 + module/execution/view/bug.html.php | 148 ++++++++++++----------------- 4 files changed, 120 insertions(+), 102 deletions(-) diff --git a/module/datatable/config.php b/module/datatable/config.php index 99efa085bf..1a3b19c9f4 100644 --- a/module/datatable/config.php +++ b/module/datatable/config.php @@ -3,3 +3,4 @@ $config->datatable->moduleAlias['product-browse'] = 'story'; $config->datatable->moduleAlias['execution-task'] = 'task'; $config->datatable->moduleAlias['testtask-cases'] = 'testcase'; $config->datatable->moduleAlias['program-project'] = 'project'; +$config->datatable->moduleAlias['execution-bug'] = 'bug'; diff --git a/module/execution/control.php b/module/execution/control.php index 62467b9a6c..79f17e3e4a 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -880,6 +880,7 @@ class execution extends control $this->loadModel('bug'); $this->loadModel('user'); $this->loadModel('product'); + $this->loadModel('datatable'); /* Save session. */ $this->session->set('bugList', $this->app->getURI(true), 'execution'); @@ -921,22 +922,60 @@ class execution extends control $actionURL = $this->createLink('execution', 'bug', "executionID=$executionID&productID=$productID&orderBy=$orderBy&build=$build&type=bysearch&queryID=myQueryID"); $this->execution->buildBugSearchForm($products, $queryID, $actionURL); + $showBranch = false; + $branchOption = array(); + $branchTagOption = array(); + if($product and $product->type != 'normal') + { + /* Display of branch label. */ + $showBranch = $this->loadModel('branch')->showBranch($productID); + + /* Display status of branch. */ + $branches = $this->loadModel('branch')->getList($productID, 0, 'all'); + foreach($branches as $branchInfo) + { + $branchOption[$branchInfo->id] = $branchInfo->name; + $branchTagOption[$branchInfo->id] = $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : ''); + } + } + + /* Get story and task id list. */ + $storyIdList = $taskIdList = array(); + foreach($bugs as $bug) + { + if($bug->story) $storyIdList[$bug->story] = $bug->story; + if($bug->task) $taskIdList[$bug->task] = $bug->task; + if($bug->toTask) $taskIdList[$bug->toTask] = $bug->toTask; + } + $storyList = $storyIdList ? $this->loadModel('story')->getByList($storyIdList) : array(); + $taskList = $taskIdList ? $this->loadModel('task')->getByList($taskIdList) : array(); + + $showModule = !empty($this->config->datatable->bugBrowse->showModule) ? $this->config->datatable->bugBrowse->showModule : ''; + /* Assign. */ - $this->view->title = $title; - $this->view->position = $position; - $this->view->bugs = $bugs; - $this->view->tabID = 'bug'; - $this->view->build = $this->loadModel('build')->getById($build); - $this->view->buildID = $this->view->build ? $this->view->build->id : 0; - $this->view->pager = $pager; - $this->view->orderBy = $orderBy; - $this->view->users = $users; - $this->view->productID = $productID; - $this->view->branchID = empty($this->view->build->branch) ? $branchID : $this->view->build->branch; - $this->view->memberPairs = $memberPairs; - $this->view->type = $type; - $this->view->param = $param; - $this->view->defaultProduct = (empty($productID) and !empty($products)) ? current(array_keys($products)) : $productID; + $this->view->title = $title; + $this->view->position = $position; + $this->view->bugs = $bugs; + $this->view->tabID = 'bug'; + $this->view->build = $this->loadModel('build')->getById($build); + $this->view->buildID = $this->view->build ? $this->view->build->id : 0; + $this->view->pager = $pager; + $this->view->orderBy = $orderBy; + $this->view->users = $users; + $this->view->productID = $productID; + $this->view->branchID = empty($this->view->build->branch) ? $branchID : $this->view->build->branch; + $this->view->memberPairs = $memberPairs; + $this->view->type = $type; + $this->view->param = $param; + $this->view->defaultProduct = (empty($productID) and !empty($products)) ? current(array_keys($products)) : $productID; + $this->view->builds = $this->loadModel('build')->getBuildPairs($productID); + $this->view->branchOption = $branchOption; + $this->view->branchTagOption = $branchTagOption; + $this->view->modulePairs = $showModule ? $this->loadModel('tree')->getModulePairs($productID, 'bug', $showModule) : array(); + $this->view->plans = $this->loadModel('productplan')->getPairs($productID); + $this->view->stories = $storyList; + $this->view->tasks = $taskList; + $this->view->projectPairs = $this->loadModel('project')->getPairsByProgram(); $this->display(); } diff --git a/module/execution/js/bug.js b/module/execution/js/bug.js index e69de29bb2..76bf55c9d3 100644 --- a/module/execution/js/bug.js +++ b/module/execution/js/bug.js @@ -0,0 +1,4 @@ +$(function() +{ + if($('#bugList thead th.c-title').width() < 150) $('#bugList thead th.c-title').width(150); +}); diff --git a/module/execution/view/bug.html.php b/module/execution/view/bug.html.php index 471d0160ae..b65a563738 100644 --- a/module/execution/view/bug.html.php +++ b/module/execution/view/bug.html.php @@ -11,6 +11,7 @@ */ ?> +