* Finish task #4063, #4064, #4065.

This commit is contained in:
chenfeiCF
2018-05-16 14:00:00 +08:00
parent ba9be5b486
commit 743488862e
6 changed files with 24 additions and 4 deletions
+1 -1
View File
@@ -153,7 +153,7 @@ $config->testcase->datatable->fieldList['lastRunDate']['required'] = 'no';
$config->testcase->datatable->fieldList['lastRunResult']['title'] = 'lastRunResult';
$config->testcase->datatable->fieldList['lastRunResult']['fixed'] = 'no';
$config->testcase->datatable->fieldList['lastRunResult']['width'] = '80';
$config->testcase->datatable->fieldList['lastRunResult']['width'] = '100';
$config->testcase->datatable->fieldList['lastRunResult']['required'] = 'no';
$config->testcase->datatable->fieldList['status']['title'] = 'statusAB';
+1
View File
@@ -124,6 +124,7 @@ class testcase extends control
$this->view->moduleTree = $this->tree->getTreeMenu($productID, $viewType = 'case', $startModuleID = 0, array('treeModel', 'createCaseLink'), '', $branch);
$this->view->moduleName = $moduleID ? $this->tree->getById($moduleID)->name : $this->lang->tree->all;
$this->view->moduleID = $moduleID;
$this->view->summary = $this->testcase->summary($cases);
$this->view->pager = $pager;
$this->view->users = $this->user->getPairs('noletter');
$this->view->orderBy = $orderBy;
+2
View File
@@ -118,6 +118,7 @@ $lang->testcase->allCases = 'All';
$lang->testcase->allTestcases = 'All Cases';
$lang->testcase->needConfirm = 'StoryChanged';
$lang->testcase->bySearch = 'Search';
$lang->testcase->unexecuted = 'Unexecuted';
$lang->testcase->lblStory = 'Story';
$lang->testcase->lblLastEdited = 'Last Edit';
@@ -131,6 +132,7 @@ $lang->testcase->legendLinkBugs = 'Bug';
$lang->testcase->legendOpenAndEdit = 'Create/Edit';
$lang->testcase->legendComment = 'Remark';
$lang->testcase->summary = "Cases on this page : <strong>%s</strong> Total, <strong>%s</strong> runed.";
$lang->testcase->confirmDelete = 'Do you want to delete this Test Case?';
$lang->testcase->confirmBatchDelete = 'Do you want to batch delete thess Test Cases?';
$lang->testcase->ditto = 'Ditto';
+2
View File
@@ -118,6 +118,7 @@ $lang->testcase->allCases = '所有';
$lang->testcase->allTestcases = '所有用例';
$lang->testcase->needConfirm = '需求变动';
$lang->testcase->bySearch = '搜索';
$lang->testcase->unexecuted = '未执行';
$lang->testcase->lblStory = '相关需求';
$lang->testcase->lblLastEdited = '最后编辑';
@@ -131,6 +132,7 @@ $lang->testcase->legendLinkBugs = '相关Bug';
$lang->testcase->legendOpenAndEdit = '创建编辑';
$lang->testcase->legendComment = '备注';
$lang->testcase->summary = "本页共 <strong>%s</strong> 个用例,已执行<strong>%s</strong>个。";
$lang->testcase->confirmDelete = '您确认要删除该测试用例吗?';
$lang->testcase->confirmBatchDelete = '您确认要批量删除这些测试用例吗?';
$lang->testcase->ditto = '同上';
+14 -3
View File
@@ -1384,7 +1384,8 @@ class testcaseModel extends model
if(!helper::isZeroDate($case->lastRunDate)) echo date(DT_MONTHTIME1, strtotime($case->lastRunDate));
break;
case 'lastRunResult':
if($case->lastRunResult) echo $this->lang->testcase->resultList[$case->lastRunResult];
$lastRunResultText = $case->lastRunResult ? zget($this->lang->testcase->resultList, $case->lastRunResult, $case->lastRunResult) : $this->lang->testcase->unexecuted;
echo html::a(helper::createLink('testtask', 'results', "runID=0&caseID=$case->id", '', true), "<i class='icon icon-list-alt'></i> <span>{$lastRunResultText}</span>", '', "class='iframe btn btn-icon-left'");
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;
@@ -1398,7 +1399,6 @@ class testcaseModel extends model
case 'actions':
echo "<div class='more'>";
if($this->config->testcase->needReview or !empty($this->config->testcase->forceReview)) common::printIcon('testcase', 'review', "caseID=$case->id", $case, 'list', 'glasses', '', 'iframe');
common::printIcon('testcase', 'create', "productID=$case->product&branch=$case->branch&moduleID=$case->module&from=testcase&param=$case->id", $case, 'list', 'copy');
if(common::hasPriv('testcase', 'delete', $case))
{
@@ -1407,9 +1407,9 @@ class testcaseModel extends model
}
echo '</div>';
common::printIcon('testtask', 'runCase', "runID=0&caseID=$case->id&version=$case->version", $case, 'list', 'play', '', 'runCase iframe', false, "data-width='95%'");
common::printIcon('testtask', 'results', "runID=0&caseID=$case->id", $case, 'list', '', '', 'results iframe', '', "data-width='90%'");
common::printIcon('testcase', 'edit', "caseID=$case->id", $case, 'list');
common::printIcon('testcase', 'createBug', "product=$case->product&branch=$case->branch&extra=caseID=$case->id,version=$case->version,runID=", $case, 'list', 'bug', '', 'iframe', '', "data-width='90%'");
common::printIcon('testcase', 'create', "productID=$case->product&branch=$case->branch&moduleID=$case->module&from=testcase&param=$case->id", $case, 'list', 'copy');
break;
}
@@ -1496,4 +1496,15 @@ class testcaseModel extends model
return false;
}
public function summary($cases)
{
$executed = 0;
foreach($cases as $case)
{
if($case->lastRunResult != '') $executed ++;
}
return sprintf($this->lang->testcase->summary, count($cases), $executed);
}
}
+4
View File
@@ -41,6 +41,10 @@ js::set('branch', $branch);
<div class='main-col'>
<div id='queryBox' class='cell <?php if($browseType =='bysearch') echo 'show';?>'></div>
<form class='main-table table-case' data-ride='table' id='batchForm' method='post'>
<div class="table-header">
<div class="table-statistic"><?php echo $summary;?></div>
<nav class="btn-toolbar pull-right"></nav>
</div>
<?php
$datatableId = $this->moduleName . ucfirst($this->methodName);
$useDatatable = (isset($this->config->datatable->$datatableId->mode) and $this->config->datatable->$datatableId->mode == 'datatable');