From ee0ace3c750dafed07765060e447fcbcd7c8ff41 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 5 Apr 2016 14:29:21 +0800 Subject: [PATCH] * finish task #2559. --- module/bug/control.php | 42 +++++----- module/bug/model.php | 7 +- module/bug/view/browsedata.html.php | 1 + module/bug/view/datatabledata.html.php | 2 +- module/common/view/datatable.fix.html.php | 38 ++++++++- module/common/view/datatable.html.php | 14 ++-- module/datatable/lang/en.php | 5 ++ module/datatable/lang/zh-cn.php | 5 ++ module/product/control.php | 4 + module/product/view/browsedata.html.php | 1 + module/product/view/datatabledata.html.php | 2 +- module/project/control.php | 46 ++++++----- module/project/view/datatabledata.html.php | 2 +- module/project/view/taskdata.html.php | 1 + module/story/model.php | 4 +- module/task/model.php | 4 +- module/testcase/control.php | 38 +++++---- module/testcase/model.php | 4 +- module/testcase/view/browsedata.html.php | 1 + module/testcase/view/datatabledata.html.php | 2 +- module/testtask/control.php | 27 +++--- module/testtask/model.php | 1 + module/tree/model.php | 92 +++++++++++++-------- 23 files changed, 217 insertions(+), 126 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index 43e86fef99..dc88c884b7 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -108,26 +108,30 @@ class bug extends control $actionURL = $this->createLink('bug', 'browse', "productID=$productID&branch=$branch&browseType=bySearch&queryID=myQueryID"); $this->bug->buildSearchForm($productID, $this->products, $queryID, $actionURL); + $showModule = !empty($this->config->datatable->bugbrowse->showModule) ? $this->config->datatable->bugbrowse->showModule : ''; + $this->view->modulePairs = $showModule ? $this->tree->getModulePairs($productID, 'bug', $showModule) : array(); + /* Set view. */ - $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->bug->common; - $this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]); - $this->view->position[] = $this->lang->bug->common; - $this->view->productID = $productID; - $this->view->productName = $this->products[$productID]; - $this->view->builds = $this->loadModel('build')->getProductBuildPairs($productID); - $this->view->modules = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0, $branch); - $this->view->moduleTree = $this->tree->getTreeMenu($productID, $viewType = 'bug', $startModuleID = 0, array('treeModel', 'createBugLink'), '', $branch); - $this->view->moduleName = $moduleID ? $this->tree->getById($moduleID)->name : $this->lang->tree->all; - $this->view->browseType = $browseType; - $this->view->bugs = $bugs; - $this->view->users = $this->user->getPairs('noletter'); - $this->view->pager = $pager; - $this->view->param = $param; - $this->view->orderBy = $orderBy; - $this->view->moduleID = $moduleID; - $this->view->memberPairs = $this->user->getPairs('noletter|nodeleted'); - $this->view->branch = $branch; - $this->view->branches = $this->loadModel('branch')->getPairs($productID); + $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->bug->common; + $this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]); + $this->view->position[] = $this->lang->bug->common; + $this->view->productID = $productID; + $this->view->productName = $this->products[$productID]; + $this->view->builds = $this->loadModel('build')->getProductBuildPairs($productID); + $this->view->modules = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0, $branch); + $this->view->moduleTree = $this->tree->getTreeMenu($productID, $viewType = 'bug', $startModuleID = 0, array('treeModel', 'createBugLink'), '', $branch); + $this->view->moduleName = $moduleID ? $this->tree->getById($moduleID)->name : $this->lang->tree->all; + $this->view->browseType = $browseType; + $this->view->bugs = $bugs; + $this->view->users = $this->user->getPairs('noletter'); + $this->view->pager = $pager; + $this->view->param = $param; + $this->view->orderBy = $orderBy; + $this->view->moduleID = $moduleID; + $this->view->memberPairs = $this->user->getPairs('noletter|nodeleted'); + $this->view->branch = $branch; + $this->view->branches = $this->loadModel('branch')->getPairs($productID); + $this->view->setShowModule = true; $this->display(); } diff --git a/module/bug/model.php b/module/bug/model.php index da1fd52d12..0221a7c9be 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1990,7 +1990,7 @@ class bugModel extends model * @access public * @return void */ - public function printCell($col, $bug, $users, $builds, $branches) + public function printCell($col, $bug, $users, $builds, $branches, $modulePairs) { $bugLink = inlink('view', "bugID=$bug->id"); $account = $this->app->user->account; @@ -2020,7 +2020,10 @@ class bugModel extends model break; case 'title': $class = 'confirm' . $bug->confirmed; - echo "[{$this->lang->bug->confirmedList[$bug->confirmed]}] " . html::a($bugLink, $bug->title); + echo "[{$lang->bug->confirmedList[$bug->confirmed]}] "; + if($bug->branch)echo "{$branches[$bug->branch]}"; + if($modulePairs and $bug->module)echo "{$modulePairs[$bug->module]}"; + echo html::a($bugLink, $bug->title); break; case 'branch': echo $branches[$bug->branch]; diff --git a/module/bug/view/browsedata.html.php b/module/bug/view/browsedata.html.php index 7780f0740f..323350bfd1 100644 --- a/module/bug/view/browsedata.html.php +++ b/module/bug/view/browsedata.html.php @@ -57,6 +57,7 @@ [{$lang->bug->confirmedList[$bug->confirmed]}] "; if($bug->branch)echo "{$branches[$bug->branch]}"; + if($modulePairs and $bug->module)echo "{$modulePairs[$bug->module]}"; echo html::a($bugLink, $bug->title); ?> diff --git a/module/bug/view/datatabledata.html.php b/module/bug/view/datatabledata.html.php index dffd748940..ebe823e1ca 100644 --- a/module/bug/view/datatabledata.html.php +++ b/module/bug/view/datatabledata.html.php @@ -23,7 +23,7 @@ extract($widths); - $value) $this->bug->printCell($value, $bug, $users, $builds, $branches);?> + $value) $this->bug->printCell($value, $bug, $users, $builds, $branches, $modulePairs);?> diff --git a/module/common/view/datatable.fix.html.php b/module/common/view/datatable.fix.html.php index b8451ca875..e0f64b24c9 100644 --- a/module/common/view/datatable.fix.html.php +++ b/module/common/view/datatable.fix.html.php @@ -1,7 +1,8 @@ moduleName . $this->methodName;?> + diff --git a/module/common/view/datatable.html.php b/module/common/view/datatable.html.php index f9433308b2..41c677aff3 100644 --- a/module/common/view/datatable.html.php +++ b/module/common/view/datatable.html.php @@ -19,11 +19,6 @@ if($config->debug) .datatable .table>tbody>tr>td.col-hover, .datatable .table>tbody>tr.hover>td {background-color: #ebf2f9 !important;} .datatable-span.flexarea .scroll-slide {bottom: -30px} -.datatable-menu-wrapper {position: relative;} -.datatable-menu {position: absolute; right: 0; top: 0; border: 1px solid #ddd; background: #fff; z-index: 999;} -.datatable-menu > .btn {padding: 5px 6px 6px; outline: none; color: #4d90fe!important} -.datatable-menu > .btn:hover {color: #002563!important} - .panel > .datatable, .panel-body > .datatable {margin-bottom: 0;}