* Refactor the browse units view.

This commit is contained in:
daitingting
2023-06-26 11:45:00 +00:00
parent 2d54d0fb7e
commit 40222cf216
9 changed files with 106 additions and 16 deletions
+5
View File
@@ -49,6 +49,11 @@ $config->testtask->actionList['view']['url'] = array('module' => 'testta
$config->testtask->actionList['view']['data-toggle'] = 'modal';
$config->testtask->actionList['view']['data-size'] = 'lg';
$config->testtask->actionList['unitCases']['icon'] = 'list-alt';
$config->testtask->actionList['unitCases']['text'] = $lang->testtask->unitCases;
$config->testtask->actionList['unitCases']['hint'] = $lang->testtask->unitCases;
$config->testtask->actionList['unitCases']['url'] = array('module' => 'testtask', 'method' => 'unitcases', 'params' => 'taskID={id}');
$config->testtask->actionList['edit']['icon'] = 'edit';
$config->testtask->actionList['edit']['text'] = $lang->testtask->edit;
$config->testtask->actionList['edit']['hint'] = $lang->testtask->edit;
+38
View File
@@ -101,3 +101,41 @@ $config->testtask->linkcase->dtable->fieldList['lastRunner'] = $config->testc
$config->testtask->linkcase->dtable->fieldList['lastRunDate'] = $config->testcase->dtable->fieldList['lastRunDate'];
$config->testtask->linkcase->dtable->fieldList['lastRunResult'] = $config->testcase->dtable->fieldList['lastRunResult'];
unset($config->testtask->linkcase->dtable->fieldList['title']['nestedToggle']);
$config->testtask->browseUnits = new stdclass();
$config->testtask->browseUnits->dtable = new stdclass();
$config->testtask->browseUnits->dtable->fieldList['id'] = $config->testtask->dtable->fieldList['id'];
$config->testtask->browseUnits->dtable->fieldList['title'] = $config->testtask->dtable->fieldList['title'];
$config->testtask->browseUnits->dtable->fieldList['title']['title'] = $lang->testtask->unitName;
$config->testtask->browseUnits->dtable->fieldList['execution'] = $config->testtask->dtable->fieldList['execution'];
$config->testtask->browseUnits->dtable->fieldList['build'] = $config->testtask->dtable->fieldList['build'];
$config->testtask->browseUnits->dtable->fieldList['owner'] = $config->testtask->dtable->fieldList['owner'];
$config->testtask->browseUnits->dtable->fieldList['execTime']['name'] = 'execTime';
$config->testtask->browseUnits->dtable->fieldList['execTime']['title'] = $lang->testtask->execTime;
$config->testtask->browseUnits->dtable->fieldList['execTime']['type'] = 'datetime';
$config->testtask->browseUnits->dtable->fieldList['execTime']['group'] = 'user';
$config->testtask->browseUnits->dtable->fieldList['caseCount']['name'] = 'caseCount';
$config->testtask->browseUnits->dtable->fieldList['caseCount']['title'] = $lang->testtask->caseCount;
$config->testtask->browseUnits->dtable->fieldList['caseCount']['type'] = 'number';
$config->testtask->browseUnits->dtable->fieldList['caseCount']['group'] = 'number';
$config->testtask->browseUnits->dtable->fieldList['passCount']['name'] = 'passCount';
$config->testtask->browseUnits->dtable->fieldList['passCount']['title'] = $lang->testtask->passCount;
$config->testtask->browseUnits->dtable->fieldList['passCount']['type'] = 'number';
$config->testtask->browseUnits->dtable->fieldList['passCount']['group'] = 'number';
$config->testtask->browseUnits->dtable->fieldList['failCount']['name'] = 'failCount';
$config->testtask->browseUnits->dtable->fieldList['failCount']['title'] = $lang->testtask->failCount;
$config->testtask->browseUnits->dtable->fieldList['failCount']['type'] = 'number';
$config->testtask->browseUnits->dtable->fieldList['failCount']['group'] = 'number';
$config->testtask->browseUnits->dtable->fieldList['actions']['name'] = 'actions';
$config->testtask->browseUnits->dtable->fieldList['actions']['title'] = $lang->actions;
$config->testtask->browseUnits->dtable->fieldList['actions']['type'] = 'actions';
$config->testtask->browseUnits->dtable->fieldList['actions']['sortType'] = false;
$config->testtask->browseUnits->dtable->fieldList['actions']['list'] = $config->testtask->actionList;
$config->testtask->browseUnits->dtable->fieldList['actions']['menu'] = array('unitCases', 'edit', 'delete');
+2
View File
@@ -201,6 +201,8 @@ class testtask extends control
/* Append id for secend sort. */
$sort = common::appendOrder($orderBy);
$this->lang->testcase->featureBar['browseunits'] = $this->lang->testtask->unitTag;
$this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->common;
$this->view->projectID = $projectID;
$this->view->productID = $productID;
+1
View File
@@ -154,6 +154,7 @@ $lang->testtask->titleOfAuto = "%s automated testing";
$lang->testtask->cannotBeParsed = 'The content of the imported XML file is in the wrong format and cannot be parsed.';
$lang->testtask->finishedDateLess = 'Actual Finished Date cannot be <= Begin Date %s';
$lang->testtask->finishedDateMore = 'Actual Finished Date cannot be > Today';
$lang->testtask->emptyUnitTip = 'No unit test results.';
$lang->testtask->assignedToMe = 'Meine';
$lang->testtask->allCases = 'Alle Fälle';
+1
View File
@@ -154,6 +154,7 @@ $lang->testtask->titleOfAuto = "%s automated testing";
$lang->testtask->cannotBeParsed = 'The content of the imported XML file is in the wrong format and cannot be parsed.';
$lang->testtask->finishedDateLess = 'Actual Finished Date cannot be <= Begin Date %s';
$lang->testtask->finishedDateMore = 'Actual Finished Date cannot be > Today';
$lang->testtask->emptyUnitTip = 'No unit test results.';
$lang->testtask->assignedToMe = 'AssignedToMe';
$lang->testtask->allCases = 'All Cases';
+1
View File
@@ -154,6 +154,7 @@ $lang->testtask->titleOfAuto = "%s tests automatisés";
$lang->testtask->cannotBeParsed = 'The content of the imported XML file is in the wrong format and cannot be parsed.';
$lang->testtask->finishedDateLess = 'Actual Finished Date cannot be <= Begin Date %s';
$lang->testtask->finishedDateMore = 'Actual Finished Date cannot be > Today';
$lang->testtask->emptyUnitTip = 'No unit test results.';
$lang->testtask->assignedToMe = 'Affecté à Moi';
$lang->testtask->allCases = 'Tous les CasTests';
+4 -1
View File
@@ -78,6 +78,7 @@ $lang->testtask->executor = '执行人';
$lang->testtask->execTime = '执行时间';
$lang->testtask->pri = '优先级';
$lang->testtask->name = '测试单名称';
$lang->testtask->unitName = '单侧名称';
$lang->testtask->begin = '开始日期';
$lang->testtask->end = '结束日期';
$lang->testtask->realFinishedDate = '实际完成日期';
@@ -107,6 +108,7 @@ $lang->testtask->passCount = '成功';
$lang->testtask->failCount = '失败';
$lang->testtask->summary = '有%s个用例,失败%s个,耗时%s。';
$lang->testtask->stepSummary = '共有%s个步骤,%s个通过,%s个失败。';
$lang->testtask->unitSummary = '本页共 <strong>%s</strong> 个单元测试结果。';
$lang->testtask->pageSummary = '本页共 <strong>%s</strong> 个测试单。';
$lang->testtask->mySummary = '本页共 <strong>%s</strong> 个测试单,待测试 <strong>%s</strong>,测试中 <strong>%s</strong>,被阻塞 <strong>%s</strong>。';
$lang->testtask->allSummary = '本页共 <strong>%s</strong> 个测试单,待测试 <strong>%s</strong>,测试中 <strong>%s</strong>,被阻塞 <strong>%s</strong>,已测试 <strong>%s</strong>。';
@@ -152,6 +154,7 @@ $lang->testtask->titleOfAuto = "%s 自动化测试";
$lang->testtask->cannotBeParsed = '导入的XML文件内容格式错误,无法解析。';
$lang->testtask->finishedDateLess = '实际完成日期不能小于开始日期%s';
$lang->testtask->finishedDateMore = '实际完成日期不能大于今天';
$lang->testtask->emptyUnitTip = '暂时没有单元测试结果。';
$lang->testtask->assignedToMe = '指派给我';
$lang->testtask->allCases = '全部用例';
@@ -214,7 +217,7 @@ $lang->testtask->featureBar['linkcase']['bysuite'] = $lang->testtask->linkBySuit
$lang->testtask->featureBar['linkcase']['bybuild'] = $lang->testtask->linkByBuild;
$lang->testtask->featureBar['linkcase']['bybug'] = $lang->testtask->linkByBug;
$lang->testtask->unitTag['all'] = '所有';
$lang->testtask->unitTag['all'] = '全部';
$lang->testtask->unitTag['newest'] = '最近';
$lang->testtask->unitTag['thisWeek'] = '本周';
$lang->testtask->unitTag['lastWeek'] = '上周';
+37
View File
@@ -0,0 +1,37 @@
<?php
declare(strict_types=1);
/**
* The browse units view file of testtask module of ZenTaoPMS.
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
* @author Tingting Dai <daitingting@easycorp.ltd>
* @package testtask
* @link https://www.zentao.net
*/
namespace zin;
include '../../testcase/ui/header.html.php';
$cols = $this->config->testtask->browseUnits->dtable->fieldList;
$tasks = initTableData($tasks, $cols, $this->testtask);
$summary = sprintf($lang->testtask->unitSummary, $pager->recTotal);
dtable
(
set::cols($cols),
set::data(array_values($tasks)),
set::emptyTip($lang->testtask->emptyUnitTip),
set::userMap($users),
set::footer(array(array('html' => $summary), 'flex', 'pager')),
set::footPager
(
usePager(),
set::page($pager->pageID),
set::recPerPage($pager->recPerPage),
set::recTotal($pager->recTotal),
set::linkCreator(helper::createLink('testtask', 'browseunits', "productID={$product->id}&browseType={$browseType}&orderBy=$orderBy&recTotal={$pager->recTotal}&recPerPage={recPerPage}&page={page}"))
),
);
render();