diff --git a/module/bug/model.php b/module/bug/model.php index 49eab4ed78..ed1b76ea8c 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1776,16 +1776,18 @@ class bugModel extends model } else { - $bugs = $this->dao->select('*')->from(TABLE_BUG) - ->where('deleted')->eq(0) - ->beginIF(empty($build))->andWhere('project')->eq($projectID)->fi() - ->beginIF(!empty($productID))->andWhere('product')->eq($productID)->fi() - ->beginIF($type == 'unresolved')->andWhere('status')->eq('active')->fi() - ->beginIF($type == 'noclosed')->andWhere('status')->ne('closed')->fi() - ->beginIF($type == 'assignedtome')->andWhere('assignedTo')->eq($this->app->user->account)->fi() - ->beginIF($type == 'openedbyme')->andWhere('openedBy')->eq($this->app->user->account)->fi() - ->beginIF($build)->andWhere("CONCAT(',', openedBuild, ',') like '%,$build,%'")->fi() - ->beginIF($excludeBugs)->andWhere('id')->notIN($excludeBugs)->fi() + $bugs = $this->dao->select('t1.*')->from(TABLE_BUG)->alias('t1') + ->leftJoin(TABLE_MODULE)->alias('t2')->on('t1.module=t2.id') + ->where('t1.deleted')->eq(0) + ->beginIF(empty($build))->andWhere('t1.project')->eq($projectID)->fi() + ->beginIF(!empty($productID))->andWhere('t1.product')->eq($productID)->fi() + ->beginIF($type == 'unresolved')->andWhere('t1.status')->eq('active')->fi() + ->beginIF($type == 'noclosed')->andWhere('t1.status')->ne('closed')->fi() + ->beginIF($type == 'assignedtome')->andWhere('t1.assignedTo')->eq($this->app->user->account)->fi() + ->beginIF($type == 'openedbyme')->andWhere('t1.openedBy')->eq($this->app->user->account)->fi() + ->beginIF(!empty($param))->andWhere('t2.path')->like("%,$param,%")->andWhere('t2.deleted')->eq(0)->fi() + ->beginIF($build)->andWhere("CONCAT(',', t1.openedBuild, ',') like '%,$build,%'")->fi() + ->beginIF($excludeBugs)->andWhere('t1.id')->notIN($excludeBugs)->fi() ->orderBy($orderBy)->page($pager)->fetchAll(); } @@ -1838,14 +1840,16 @@ class bugModel extends model } else { - $bugs = $this->dao->select('*')->from(TABLE_BUG) - ->where('deleted')->eq(0) - ->beginIF(empty($build))->andWhere('execution')->eq($executionID)->fi() - ->beginIF(!empty($productID))->andWhere('product')->eq($productID)->fi() - ->beginIF($type == 'unresolved')->andWhere('status')->eq('active')->fi() - ->beginIF($type == 'noclosed')->andWhere('status')->ne('closed')->fi() - ->beginIF($build)->andWhere("CONCAT(',', openedBuild, ',') like '%,$build,%'")->fi() - ->beginIF($excludeBugs)->andWhere('id')->notIN($excludeBugs)->fi() + $bugs = $this->dao->select('t1.*')->from(TABLE_BUG)->alias('t1') + ->leftJoin(TABLE_MODULE)->alias('t2')->on('t1.module=t2.id') + ->where('t1.deleted')->eq(0) + ->beginIF(empty($build))->andWhere('t1.execution')->eq($executionID)->fi() + ->beginIF(!empty($productID))->andWhere('t1.product')->eq($productID)->fi() + ->beginIF($type == 'unresolved')->andWhere('t1.status')->eq('active')->fi() + ->beginIF($type == 'noclosed')->andWhere('t1.status')->ne('closed')->fi() + ->beginIF($build)->andWhere("CONCAT(',', t1.openedBuild, ',') like '%,$build,%'")->fi() + ->beginIF(!empty($param))->andWhere('t2.path')->like("%,$param,%")->andWhere('t2.deleted')->eq(0)->fi() + ->beginIF($excludeBugs)->andWhere('t1.id')->notIN($excludeBugs)->fi() ->orderBy($orderBy) ->page($pager) ->fetchAll('id'); diff --git a/module/execution/control.php b/module/execution/control.php index 69b1d06567..3f2952931c 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -933,6 +933,7 @@ class execution extends control $this->loadModel('user'); $this->loadModel('product'); $this->loadModel('datatable'); + $this->loadModel('tree'); /* Save session. */ $this->session->set('bugList', $this->app->getURI(true), 'execution'); @@ -946,7 +947,7 @@ class execution extends control $productPairs = array('0' => $this->lang->product->all); foreach($products as $productData) $productPairs[$productData->id] = $productData->name; - $this->lang->modulePageNav = $this->product->select($productPairs, $productID, 'execution', 'bug', $executionID, $branchID, 0, '', false); + $this->lang->modulePageNav = $this->product->select($productPairs, $productID, 'execution', 'bug', $executionID, 0, 0, '', false); /* Header and position. */ $title = $execution->name . $this->lang->colon . $this->lang->execution->bug; @@ -1009,6 +1010,24 @@ class execution extends control /* Process the openedBuild and resolvedBuild fields. */ $bugs = $this->bug->processBuildForBugs($bugs); + $moduleID = $type != 'bysearch' ? $param : 0; + $modules = $this->tree->getAllModulePairs('bug'); + + /* Get module tree.*/ + $extra = array('executionID' => $executionID, 'orderBy' => $orderBy, 'type' => $type, 'build' => $build); + if($executionID and empty($productID) and count($products) > 1) + { + $moduleTree = $this->tree->getBugTreeMenu($executionID, $productID, 0, array('treeModel', 'createBugLink'), $extra); + } + else + { + $productID = empty($productID) ? key($products) : $productID; + $moduleTree = $this->tree->getTreeMenu($productID, 'bug', 0, array('treeModel', 'createBugLink'), $extra + array('productID' => $productID), 'all'); + } + $tree = $moduleID ? $this->tree->getByID($moduleID) : ''; + + $showModule = !empty($this->config->datatable->projectBug->showModule) ? $this->config->datatable->executionBug->showModule : ''; + /* Assign. */ $this->view->title = $title; $this->view->position = $position; @@ -1029,11 +1048,17 @@ class execution extends control $this->view->builds = $this->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->view->moduleTree = $moduleTree; + $this->view->modules = $modules; + $this->view->moduleID = $moduleID; + $this->view->moduleName = $moduleID ? $tree->name : $this->lang->tree->all; + $this->view->modulePairs = $showModule ? $this->tree->getModulePairs($productID, 'bug', $showModule) : array(); + $this->view->setModule = true; + $this->view->showBranch = false; $this->display(); } diff --git a/module/execution/js/bug.js b/module/execution/js/bug.js index 76bf55c9d3..ce07804c40 100644 --- a/module/execution/js/bug.js +++ b/module/execution/js/bug.js @@ -1,4 +1,5 @@ $(function() { + if(browseType != 'bysearch') $('#module' + param).closest('li').addClass('active'); 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 cac23c7da0..34819006c8 100644 --- a/module/execution/view/bug.html.php +++ b/module/execution/view/bug.html.php @@ -16,7 +16,19 @@ #subHeader #dropMenu .col-left .list-group {margin-bottom: 0px; padding-top: 10px;} #subHeader #dropMenu .col-left {padding-bottom: 0px;} - -
-
- -
-

- bug->noBug;?> - - createLink('bug', 'create', "productID=$defaultProduct&branch=$branchID&extra=executionID=$execution->id"), " " . $lang->bug->create, '', "class='btn btn-info' data-app='execution'");?> +

+ +
+
+ +
+

+ bug->noBug;?> + + createLink('bug', 'create', "productID=$defaultProduct&branch=0&extra=executionID=$execution->id"), " " . $lang->bug->create, '', "class='btn btn-info' data-app='execution'");?> + +

+
+ id}&productID={$productID}&orderBy=%s&build=$buildID&type=$type¶m=$param&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; - - $useDatatable ? include '../../common/view/datatable.html.php' : include '../../common/view/tablesorter.html.php'; - - $setting = $this->datatable->getSetting('execution'); - $widths = $this->datatable->setFixedFieldWidth($setting); - $columns = 0; - - $canBatchAssignTo = common::hasPriv('bug', 'batchAssignTo'); + $datatableId = $this->moduleName . ucfirst($this->methodName); + $useDatatable = (isset($config->datatable->$datatableId->mode) and $config->datatable->$datatableId->mode == 'datatable'); ?> - ';?> - ' id='bugList' data-fixed-left-width='' data-fixed-right-width=''> - - + app->getViewType() == 'xhtml'):?> + + + > + +
+ +
+ id}&productID={$productID}&orderBy=%s&build=$buildID&type=$type¶m=$param&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; + + $useDatatable ? include '../../common/view/datatable.html.php' : include '../../common/view/tablesorter.html.php'; + + $setting = $this->datatable->getSetting('execution'); + $widths = $this->datatable->setFixedFieldWidth($setting); + $columns = 0; + + $canBatchAssignTo = common::hasPriv('bug', 'batchAssignTo'); + ?> + ';?> +
' id='bugList' data-fixed-left-width='' data-fixed-right-width=''> + + + app->getViewType() == 'xhtml'):?> + id == 'title' || $value->id == 'id' || $value->id == 'pri' || $value->id == 'status') + { + $this->datatable->printHead($value, $orderBy, $vars, $canBatchAssignTo); + $columns ++; + } + } + ?> + + show) + { + if(common::checkNotCN() and $value->id == 'severity') $value->name = $lang->bug->severity; + if(common::checkNotCN() and $value->id == 'pri') $value->name = $lang->bug->pri; + if(common::checkNotCN() and $value->id == 'confirmed') $value->name = $lang->bug->confirmed; + $this->datatable->printHead($value, $orderBy, $vars, $canBatchAssignTo); + $columns ++; + } + } + ?> + + + + + + app->getViewType() == 'xhtml'):?> id == 'title' || $value->id == 'id' || $value->id == 'pri' || $value->id == 'status') - { - $this->datatable->printHead($value, $orderBy, $vars, $canBatchAssignTo); - $columns ++; - } - } - ?> + foreach($setting as $value) + { + if($value->id == 'title' || $value->id == 'id' || $value->id == 'pri' || $value->id == 'status') + { + $this->bug->printCell($value, $bug, $users, $builds, $branchOption, $modulePairs, array($execution), $plans, $stories, $tasks, $useDatatable ? 'datatable' : 'table'); + } + }?> - show) - { - if(common::checkNotCN() and $value->id == 'severity') $value->name = $lang->bug->severity; - if(common::checkNotCN() and $value->id == 'pri') $value->name = $lang->bug->pri; - if(common::checkNotCN() and $value->id == 'confirmed') $value->name = $lang->bug->confirmed; - $this->datatable->printHead($value, $orderBy, $vars, $canBatchAssignTo); - $columns ++; - } - } - ?> + bug->printCell($value, $bug, $users, $builds, $branchOption, $modulePairs, $executions, $plans, $stories, $tasks, $useDatatable ? 'datatable' : 'table', $projectPairs);?> - - - - - app->getViewType() == 'xhtml'):?> - id == 'title' || $value->id == 'id' || $value->id == 'pri' || $value->id == 'status') - { - $this->bug->printCell($value, $bug, $users, $builds, $branchOption, $modulePairs, array($execution), $plans, $stories, $tasks, $useDatatable ? 'datatable' : 'table'); - } - }?> - - bug->printCell($value, $bug, $users, $builds, $branchOption, $modulePairs, $executions, $plans, $stories, $tasks, $useDatatable ? 'datatable' : 'table', $projectPairs);?> - - - - -
- ';?> -