diff --git a/module/bug/control.php b/module/bug/control.php index 2bc1ac2de4..da481a996c 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -445,6 +445,8 @@ class bug extends control if($bug->project and !$this->loadModel('project')->checkPriv($this->project->getByID($bug->project))) { echo(js::alert($this->lang->project->accessDenied)); + $loginLink = $this->config->requestType == 'GET' ? "?{$this->config->moduleVar}=user&{$this->config->methodVar}=login" : "user{$this->config->requestFix}login"; + if(strpos($this->server->http_referer, $loginLink) !== false) die(js::locate(inlink('index'))); die(js::locate('back')); } diff --git a/module/bug/model.php b/module/bug/model.php index 7666ca712c..a56d157b44 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1230,6 +1230,26 @@ class bugModel extends model ->fetchAll('id'); } + /** + * Get case bugs. + * + * @param int $runID + * @param int $caseID + * @param int $version + * @access public + * @return void + */ + public function getCaseBugs($runID, $caseID = 0, $version = 0) + { + return $this->dao->select('*')->from(TABLE_BUG) + ->where('1=1') + ->beginIF($runID)->andWhere('`result`')->eq($runID)->fi() + ->beginIF($runID == 0 and $caseID)->andWhere('`case`')->eq($caseID)->fi() + ->beginIF($version)->andWhere('`caseVersion`')->eq($version)->fi() + ->andWhere('deleted')->eq(0) + ->fetchAll('id'); + } + /** * Get counts of some stories' bugs. * diff --git a/module/common/model.php b/module/common/model.php index e696e88e7c..b5b21ed7a6 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -934,7 +934,6 @@ class commonModel extends model * Get the previous and next object. * * @param string $type story|task|bug|case - * @param string $objectIDs * @param string $objectID * @access public * @return void @@ -949,7 +948,7 @@ class commonModel extends model $existObject = $type . 'PreAndNext'; if(isset($_SESSION[$existObject]) and $_SESSION[$existObject]['objectID'] == $objectID) return $_SESSION[$existObject]['preAndNextObject']; - /* Get objectIDs. */ + /* Get objectIDList. */ $table = $this->config->objectTables[$type]; $queryCondition = $type . 'QueryCondition'; $typeOnlyCondition = $type . 'OnlyCondition'; diff --git a/module/datatable/model.php b/module/datatable/model.php index 9cb2876a58..571da4d9a1 100644 --- a/module/datatable/model.php +++ b/module/datatable/model.php @@ -68,6 +68,7 @@ class datatableModel extends model $set->width = $fieldList[$id]['width']; $set->fixed = $fieldList[$id]['fixed']; $set->title = $fieldList[$id]['title']; + $set->sort = isset($fieldList[$id]['sort']) ? $fieldList[$id]['sort'] : 'yes'; $setting[$key] = $set; } } @@ -81,6 +82,7 @@ class datatableModel extends model continue; } $set->title = $fieldList[$set->id]['title']; + $set->sort = isset($fieldList[$set->id]['sort']) ? $fieldList[$set->id]['sort'] : 'yes'; } } @@ -123,15 +125,9 @@ class datatableModel extends model { echo $this->lang->actions; } - elseif($id == 'progess') + elseif(isset($col->sort) and $col->sort == 'no') { - $this->app->loadLang('task'); - echo $this->lang->task->progess; - } - elseif($id == 'taskCount' or $id == 'bugCount' or $id == 'caseCount') - { - $this->app->loadLang('story'); - echo $this->lang->story->$id; + echo $col->title; } else { diff --git a/module/my/control.php b/module/my/control.php index daef531402..7ae9fa5ddd 100644 --- a/module/my/control.php +++ b/module/my/control.php @@ -188,11 +188,6 @@ class my extends control $sort = $this->loadModel('common')->appendOrder($orderBy); $bugs = $this->loadModel('bug')->getUserBugs($this->app->user->account, $type, $sort, 0, $pager); - /* Save bugIDs session for get the pre and next bug. */ - $bugIDs = ''; - foreach($bugs as $bug) $bugIDs .= ',' . $bug->id; - $this->session->set('bugIDs', $bugIDs . ','); - /* assign. */ $this->view->title = $this->lang->my->common . $this->lang->colon . $this->lang->my->bug; $this->view->position[] = $this->lang->my->bug; diff --git a/module/product/model.php b/module/product/model.php index 44ac2c7d30..6916f224c8 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -28,6 +28,8 @@ class productModel extends model if($products and !isset($products[$productID]) and !$this->checkPriv($this->getById($productID))) { echo(js::alert($this->lang->product->accessDenied)); + $loginLink = $this->config->requestType == 'GET' ? "?{$this->config->moduleVar}=user&{$this->config->methodVar}=login" : "user{$this->config->requestFix}login"; + if(strpos($this->server->http_referer, $loginLink) !== false) die(js::locate(inlink('index'))); die(js::locate('back')); } @@ -95,7 +97,17 @@ class productModel extends model if($productID > 0) $this->session->set('product', (int)$productID); if($productID == 0 and $this->cookie->lastProduct) $this->session->set('product', (int)$this->cookie->lastProduct); if($productID == 0 and $this->session->product == '') $this->session->set('product', key($products)); - if(!isset($products[$this->session->product])) $this->session->set('product', key($products)); + if(!isset($products[$this->session->product])) + { + $this->session->set('product', key($products)); + if($productID > 0) + { + echo(js::alert($this->lang->product->accessDenied)); + $loginLink = $this->config->requestType == 'GET' ? "?{$this->config->moduleVar}=user&{$this->config->methodVar}=login" : "user{$this->config->requestFix}login"; + if(strpos($this->server->http_referer, $loginLink) !== false) die(js::locate(inlink('index'))); + die(js::locate('back')); + } + } if($this->cookie->preProductID != $productID) { $this->cookie->set('preBranch', 0); diff --git a/module/project/control.php b/module/project/control.php index cbfd57a1df..797eff54e3 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -557,11 +557,6 @@ class project extends control $storyTasks = $this->task->getStoryTaskCounts(array_keys($stories), $projectID); $users = $this->user->getPairs('noletter'); - /* Save storyIDs session for get the pre and next story. */ - $storyIDs = ''; - foreach($stories as $story) $storyIDs .= ',' . $story->id; - $this->session->set('storyIDs', $storyIDs . ','); - /* Get project's product. */ $productID = 0; $productPairs = $this->loadModel('product')->getProductsByProject($projectID); diff --git a/module/project/model.php b/module/project/model.php index 5edf5a4fcc..2971146bfa 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -86,6 +86,8 @@ class projectModel extends model if($projects and !isset($projects[$projectID]) and !$this->checkPriv($project)) { echo(js::alert($this->lang->project->accessDenied)); + $loginLink = $this->config->requestType == 'GET' ? "?{$this->config->moduleVar}=user&{$this->config->methodVar}=login" : "user{$this->config->requestFix}login"; + if(strpos($this->server->http_referer, $loginLink) !== false) die(js::locate(inlink('index'))); die(js::locate('back')); } @@ -204,6 +206,8 @@ class projectModel extends model if($projectID > 0) { echo(js::alert($this->lang->project->accessDenied)); + $loginLink = $this->config->requestType == 'GET' ? "?{$this->config->moduleVar}=user&{$this->config->methodVar}=login" : "user{$this->config->requestFix}login"; + if(strpos($this->server->http_referer, $loginLink) !== false) die(js::locate(inlink('index'))); die(js::locate('back')); } } diff --git a/module/story/config.php b/module/story/config.php index 8859b99fa8..200f77e38d 100644 --- a/module/story/config.php +++ b/module/story/config.php @@ -93,16 +93,19 @@ $config->story->datatable->fieldList['taskCount']['title'] = 'taskCount'; $config->story->datatable->fieldList['taskCount']['fixed'] = 'no'; $config->story->datatable->fieldList['taskCount']['width'] = '90'; $config->story->datatable->fieldList['taskCount']['required'] = 'no'; +$config->story->datatable->fieldList['taskCount']['sort'] = 'no'; $config->story->datatable->fieldList['bugCount']['title'] = 'bugCount'; $config->story->datatable->fieldList['bugCount']['fixed'] = 'no'; $config->story->datatable->fieldList['bugCount']['width'] = '90'; $config->story->datatable->fieldList['bugCount']['required'] = 'no'; +$config->story->datatable->fieldList['bugCount']['sort'] = 'no'; $config->story->datatable->fieldList['caseCount']['title'] = 'caseCount'; $config->story->datatable->fieldList['caseCount']['fixed'] = 'no'; $config->story->datatable->fieldList['caseCount']['width'] = '90'; $config->story->datatable->fieldList['caseCount']['required'] = 'no'; +$config->story->datatable->fieldList['caseCount']['sort'] = 'no'; $config->story->datatable->fieldList['openedBy']['title'] = 'openedByAB'; $config->story->datatable->fieldList['openedBy']['fixed'] = 'no'; diff --git a/module/task/config.php b/module/task/config.php index 0740ca1c91..0b88e4d80d 100644 --- a/module/task/config.php +++ b/module/task/config.php @@ -93,6 +93,7 @@ $config->task->datatable->fieldList['progess']['title'] = 'progess'; $config->task->datatable->fieldList['progess']['fixed'] = 'no'; $config->task->datatable->fieldList['progess']['width'] = '40'; $config->task->datatable->fieldList['progess']['required'] = 'no'; +$config->task->datatable->fieldList['progess']['sort'] = 'no'; $config->task->datatable->fieldList['deadline']['title'] = 'deadlineAB'; $config->task->datatable->fieldList['deadline']['fixed'] = 'no'; diff --git a/module/testcase/config.php b/module/testcase/config.php index 13dad92b5c..9ca5cb19d2 100644 --- a/module/testcase/config.php +++ b/module/testcase/config.php @@ -16,7 +16,7 @@ $config->testcase->export = new stdclass(); $config->testcase->export->listFields = array('type', 'stage', 'pri', 'status'); $config->testcase->exportFields = ' - id, product, module, story, + id, product, branch, module, story, title, precondition, stepDesc, stepExpect, keywords, pri, type, stage, status, lastRunResult, openedBy, openedDate, lastEditedBy, lastEditedDate, version,linkCase'; @@ -66,7 +66,7 @@ $config->testcase->search['params']['openedDate'] = array('operator' => '=', $config->testcase->search['params']['lastEditedDate'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date'); $config->testcase->datatable = new stdclass(); -$config->testcase->datatable->defaultField = array('id', 'pri', 'title', 'type', 'openedBy', 'lastRunner', 'lastRunDate', 'lastRunResult', 'status', 'actions'); +$config->testcase->datatable->defaultField = array('id', 'pri', 'title', 'type', 'openedBy', 'lastRunner', 'lastRunDate', 'lastRunResult', 'status', 'bugs', 'results', 'actions'); $config->testcase->datatable->fieldList['id']['title'] = 'idAB'; $config->testcase->datatable->fieldList['id']['fixed'] = 'left'; @@ -132,8 +132,21 @@ $config->testcase->datatable->fieldList['actions']['title'] = 'actions'; $config->testcase->datatable->fieldList['actions']['fixed'] = 'right'; $config->testcase->datatable->fieldList['actions']['width'] = '140'; $config->testcase->datatable->fieldList['actions']['required'] = 'yes'; +$config->testcase->datatable->fieldList['actions']['sort'] = 'no'; $config->testcase->datatable->fieldList['branch']['title'] = 'branch'; $config->testcase->datatable->fieldList['branch']['fixed'] = 'left'; $config->testcase->datatable->fieldList['branch']['width'] = '100'; $config->testcase->datatable->fieldList['branch']['required'] = 'no'; + +$config->testcase->datatable->fieldList['bugs']['title'] = 'bugs'; +$config->testcase->datatable->fieldList['bugs']['fixed'] = 'no'; +$config->testcase->datatable->fieldList['bugs']['width'] = '80'; +$config->testcase->datatable->fieldList['bugs']['required'] = 'no'; +$config->testcase->datatable->fieldList['bugs']['sort'] = 'no'; + +$config->testcase->datatable->fieldList['results']['title'] = 'results'; +$config->testcase->datatable->fieldList['results']['fixed'] = 'no'; +$config->testcase->datatable->fieldList['results']['width'] = '80'; +$config->testcase->datatable->fieldList['results']['required'] = 'no'; +$config->testcase->datatable->fieldList['results']['sort'] = 'no'; diff --git a/module/testcase/control.php b/module/testcase/control.php index f19224f051..89fda33863 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -101,6 +101,7 @@ class testcase extends control /* Process case for check story changed. */ $cases = $this->loadModel('story')->checkNeedConfirm($cases); + $cases = $this->testcase->appendBugAndResults($cases); /* Build the search form. */ $actionURL = $this->createLink('testcase', 'browse', "productID=$productID&branch=$branch&browseType=bySearch&queryID=myQueryID"); @@ -836,17 +837,22 @@ class testcase extends control */ public function export($productID, $orderBy, $taskID = 0) { + $product = $this->loadModel('product')->getById($productID); + if($product->type != 'normal') $this->lang->testcase->branch = $this->lang->product->branchName[$product->type]; if($_POST) { $caseLang = $this->lang->testcase; $caseConfig = $this->config->testcase; /* Create field lists. */ - $fields = $this->post->exportFields ? $this->post->exportFields : explode(',', $caseConfig->exportFields); + $fields = $this->post->exportFields ? $this->post->exportFields : explode(',', $caseConfig->exportFields); foreach($fields as $key => $fieldName) { $fieldName = trim($fieldName); - $fields[$fieldName] = isset($caseLang->$fieldName) ? $caseLang->$fieldName : $fieldName; + if(!($product->type == 'normal' and $fieldName == 'branch')) + { + $fields[$fieldName] = isset($caseLang->$fieldName) ? $caseLang->$fieldName : $fieldName; + } unset($fields[$key]); } @@ -884,6 +890,7 @@ class testcase extends control /* Get users, products and projects. */ $users = $this->loadModel('user')->getPairs('noletter'); $products = $this->loadModel('product')->getPairs('nocode'); + $branches = $this->loadModel('branch')->getPairs($productID); /* Get related objects id lists. */ $relatedModuleIdList = array(); @@ -938,6 +945,7 @@ class testcase extends control /* fill some field with useful value. */ if(isset($products[$case->product])) $case->product = $products[$case->product] . "(#$case->product)"; + if(isset($branches[$case->branch])) $case->branch = $branches[$case->branch] . "(#$case->branch)"; if(isset($relatedModules[$case->module])) $case->module = $relatedModules[$case->module] . "(#$case->module)"; if(isset($relatedStories[$case->story])) $case->story = $relatedStories[$case->story] . "(#$case->story)"; @@ -990,6 +998,9 @@ class testcase extends control { if($_POST) { + $product = $this->loadModel('product')->getById($productID); + + if($product->type != 'normal') $fields['branch'] = $this->lang->product->branchName[$product->type]; $fields['module'] = $this->lang->testcase->module; $fields['title'] = $this->lang->testcase->title; $fields['stepDesc'] = $this->lang->testcase->stepDesc; @@ -1005,6 +1016,10 @@ class testcase extends control $fields['typeValue'] = $this->lang->testcase->lblTypeValue; $fields['stageValue'] = $this->lang->testcase->lblStageValue; $fields['statusValue'] = $this->lang->testcase->lblStatusValue; + if($product->type != 'normal') $fields['branchValue'] = $this->lang->product->branchName[$product->type]; + + $branches = $this->loadModel('branch')->getPairs($productID); + foreach($branches as $branchID => $branchName) $branches[$branchID] = $branchName . "(#$branchID)"; $modules = $this->loadModel('tree')->getOptionMenu($productID, 'case'); $rows = array(); @@ -1020,6 +1035,7 @@ class testcase extends control $row->typeValue = join("\n", $this->lang->testcase->typeList); $row->stageValue = join("\n", $this->lang->testcase->stageList); $row->statusValue = join("\n", $this->lang->testcase->statusList); + if($product->type != 'normal') $row->branchValue = join("\n", $branches); } $rows[] = $row; } @@ -1053,7 +1069,7 @@ class testcase extends control $fileName = $this->file->savePath . $file['pathname']; $rows = $this->file->parseCSV($fileName); - $fields = $this->testcase->getImportFields(); + $fields = $this->testcase->getImportFields($productID); $fields = array_flip($fields); $header = array(); foreach($rows[0] as $i => $rowValue) @@ -1123,7 +1139,7 @@ class testcase extends control $caseConfig = $this->config->testcase; $modules = $this->loadModel('tree')->getOptionMenu($productID, 'case', 0, $branch); $stories = $this->loadModel('story')->getProductStoryPairs($productID, $branch); - $fields = $this->testcase->getImportFields(); + $fields = $this->testcase->getImportFields($productID); $fields = array_flip($fields); $rows = $this->loadModel('file')->parseCSV($file); @@ -1151,16 +1167,7 @@ class testcase extends control { if(!isset($data[$key])) continue; $cellValue = $data[$key]; - if($field == 'story') - { - $case->$field = 0; - if(strrpos($cellValue, '(#') !== false) - { - $id = trim(substr($cellValue, strrpos($cellValue,'(#') + 2), ')'); - $case->$field = $id; - } - } - elseif($field == 'module') + if($field == 'story' or $field == 'module' or $field == 'branch') { $case->$field = 0; if(strrpos($cellValue, '(#') !== false) @@ -1248,8 +1255,26 @@ class testcase extends control $this->view->caseData = $caseData; $this->view->stepData = $stepData; $this->view->productID = $productID; + $this->view->branches = $this->loadModel('branch')->getPairs($productID); $this->view->branch = $branch; $this->view->product = $this->products[$productID]; $this->display(); } + + /** + * Case bugs. + * + * @param int $runID + * @param int $caseID + * @param int $version + * @access public + * @return void + */ + public function bugs($runID, $caseID = 0, $version = 0) + { + $this->view->title = $this->lang->testcase->bugs; + $this->view->bugs = $this->loadModel('bug')->getCaseBugs($runID, $caseID, $version); + $this->view->users = $this->loadModel('user')->getPairs('noletter'); + $this->display(); + } } diff --git a/module/testcase/css/browse.css b/module/testcase/css/browse.css index 5c41413f23..fa47cd9d6f 100644 --- a/module/testcase/css/browse.css +++ b/module/testcase/css/browse.css @@ -12,3 +12,6 @@ .dropdown-list > li > a:focus {color: #1a4f85;text-decoration: none;background-color: #ddd;} .pl-5px{padding-left:5px;} + +tbody > tr > td > .btn-icon {margin-right: 3px;} +tbody > tr > td .icon-bug {margin-left: -8px;} diff --git a/module/testcase/css/bugs.css b/module/testcase/css/bugs.css new file mode 100644 index 0000000000..dfd311f034 --- /dev/null +++ b/module/testcase/css/bugs.css @@ -0,0 +1,3 @@ +body{background:white} +.bugsList {padding:10px;} +.bugsList .table{border: 1px solid #ddd;} diff --git a/module/testcase/lang/en.php b/module/testcase/lang/en.php index eaf73ecaad..38d0351cbd 100644 --- a/module/testcase/lang/en.php +++ b/module/testcase/lang/en.php @@ -134,7 +134,7 @@ $lang->testcase->statusList['normal'] = 'Normal'; $lang->testcase->statusList['blocked'] = 'Blocked'; $lang->testcase->statusList['investigate'] = 'Investigating'; -$lang->testcase->resultList['n/a'] = 'N/A'; +$lang->testcase->resultList['n/a'] = 'Ignore'; $lang->testcase->resultList['pass'] = 'Pass'; $lang->testcase->resultList['fail'] = 'Fail'; $lang->testcase->resultList['blocked'] = 'Blocked'; diff --git a/module/testcase/lang/zh-cn.php b/module/testcase/lang/zh-cn.php index b8c28688fb..0f6179acf7 100644 --- a/module/testcase/lang/zh-cn.php +++ b/module/testcase/lang/zh-cn.php @@ -44,6 +44,9 @@ $lang->testcase->allProduct = "所有{$lang->productCommon}"; $lang->testcase->fromBug = '来源Bug'; $lang->testcase->toBug = '生成Bug'; $lang->testcase->changed = '用例变更'; +$lang->testcase->bugs = '产生Bug数'; +$lang->testcase->bugsAB = 'B'; +$lang->testcase->results = '执行数'; $lang->testcase->createBug = '转Bug'; $lang->case = $lang->testcase; // 用于DAO检查时使用。因为case是系统关键字,所以无法定义该模块为case,只能使用testcase,但表还是使用的case。 @@ -134,7 +137,7 @@ $lang->testcase->statusList['normal'] = '正常'; $lang->testcase->statusList['blocked'] = '被阻塞'; $lang->testcase->statusList['investigate'] = '研究中'; -$lang->testcase->resultList['n/a'] = 'N/A'; +$lang->testcase->resultList['n/a'] = '忽略'; $lang->testcase->resultList['pass'] = '通过'; $lang->testcase->resultList['fail'] = '失败'; $lang->testcase->resultList['blocked'] = '阻塞'; diff --git a/module/testcase/model.php b/module/testcase/model.php index 862855b072..602713195a 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -797,6 +797,7 @@ class testcaseModel extends model $caseData = new stdclass(); $caseData->product = $product; + $caseData->branch = isset($data->branch[$key]) ? $data->branch[$key] : $branch; $caseData->module = $data->module[$key]; $caseData->story = (int)$data->story[$key]; $caseData->title = $data->title[$key]; @@ -901,7 +902,7 @@ class testcaseModel extends model $caseData->version = 1; $caseData->openedBy = $this->app->user->account; $caseData->openedDate = $now; - $caseData->branch = $branch; + $caseData->branch = isset($data->branch[$key]) ? $data->branch[$key] : $branch; $this->dao->insert(TABLE_CASE)->data($caseData)->autoCheck()->exec(); if(!dao::isError()) @@ -933,8 +934,11 @@ class testcaseModel extends model * @access public * @return array */ - public function getImportFields() + public function getImportFields($productID = 0) { + $product = $this->loadModel('product')->getById($productID); + if($product->type != 'normal') $this->lang->testcase->branch = $this->lang->product->branchName[$product->type]; + $caseLang = $this->lang->testcase; $caseConfig = $this->config->testcase; $fields = explode(',', $caseConfig->exportFields); @@ -1048,6 +1052,12 @@ class testcaseModel extends model case 'lastRunResult': if($case->lastRunResult) echo $this->lang->testcase->resultList[$case->lastRunResult]; break; + case 'bugs': + echo (common::hasPriv('testcase', 'bugs') and $case->bugs) ? html::a(helper::createLink('testcase', 'bugs', "runID=0&caseID={$case->id}"), $case->bugs, '', "class='iframe'") : $case->bugs; + break; + case 'results': + echo (common::hasPriv('testtask', 'results') and $case->results) ? html::a(helper::createLink('testtask', 'results', "runID=0&caseID={$case->id}"), $case->results, '', "class='iframe'") : $case->results; + break; case 'actions': common::printIcon('testtask', 'runCase', "runID=0&caseID=$case->id&version=$case->version", '', 'list', 'play', '', 'runCase iframe'); common::printIcon('testtask', 'results', "runID=0&caseID=$case->id", '', 'list', '', '', 'results iframe'); @@ -1066,4 +1076,35 @@ class testcaseModel extends model echo ''; } } + + /** + * Append bugs and results. + * + * @param array $cases + * @access public + * @return array + */ + public function appendBugAndResults($cases, $type = 'case') + { + $caseIdList = array_keys($cases); + if($type == 'case') + { + $caseBugs = $this->dao->select('count(*) as count, `case`')->from(TABLE_BUG)->where('`case`')->in($caseIdList)->andWhere('deleted')->eq(0)->groupBy('`case`')->fetchPairs('case', 'count'); + $results = $this->dao->select('count(*) as count, `case`')->from(TABLE_TESTRESULT)->where('`case`')->in($caseIdList)->groupBy('`case`')->fetchPairs('case', 'count'); + } + else + { + $caseBugs = $this->dao->select('count(*) as count, `case`')->from(TABLE_BUG)->where('`result`')->in($caseIdList)->andWhere('deleted')->eq(0)->groupBy('`case`')->fetchPairs('case', 'count'); + $results = $this->dao->select('count(*) as count, `case`')->from(TABLE_TESTRESULT)->where('`run`')->in($caseIdList)->groupBy('`run`')->fetchPairs('case', 'count'); + } + + foreach($cases as $case) + { + $caseID = $type == 'case' ? $case->id : $case->case; + $case->bugs = isset($caseBugs[$caseID]) ? $caseBugs[$caseID] : 0; + $case->results = isset($results[$caseID]) ? $results[$caseID] : 0; + } + + return $cases; + } } diff --git a/module/testcase/view/browse.html.php b/module/testcase/view/browse.html.php index 3dda295fca..7306711d06 100644 --- a/module/testcase/view/browse.html.php +++ b/module/testcase/view/browse.html.php @@ -47,7 +47,7 @@ js::set('batchDelete', $lang->testcase->confirmBatchDelete); ?>
| idAB);?> | -priAB);?> | -testcase->title);?> | +idAB);?> | +priAB);?> | +testcase->title);?> | -testcase->story);?> | -actions;?> | +testcase->story);?> | +actions;?> | -typeAB);?> | -openedByAB);?> | -testtask->lastRunAccount);?> | -testtask->lastRunTime);?> | -testtask->lastRunResult);?> | -statusAB);?> | +typeAB);?> | +openedByAB);?> | +testtask->lastRunAccount);?> | +testtask->lastRunTime);?> | +testtask->lastRunResult);?> | +statusAB);?> | +testcase->bugsAB;?> | +testcase->results?> | actions;?> | bugs) ? html::a(inlink('bugs', "runID=0&caseID={$case->id}"), $case->bugs, '', "class='iframe'") : $case->bugs?> | +results) ? html::a($this->createLink('testtask', 'results', "runID=0&caseID={$case->id}"), $case->results, '', "class='iframe'") : $case->results?> |
id&version=$case->version", '', 'list', 'play', '', 'runCase iframe');
diff --git a/module/testcase/view/bugs.html.php b/module/testcase/view/bugs.html.php
new file mode 100644
index 0000000000..706ccd7196
--- /dev/null
+++ b/module/testcase/view/bugs.html.php
@@ -0,0 +1,40 @@
+
+
+
+
+ icons['report']);?>
+ testcase->bugs;?>
+
+
+
+
+
diff --git a/module/testcase/view/showimport.html.php b/module/testcase/view/showimport.html.php
index 993eeb1feb..e67d28473b 100644
--- a/module/testcase/view/showimport.html.php
+++ b/module/testcase/view/showimport.html.php
@@ -6,10 +6,13 @@
| |||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|