From afeaa9de37cde240640cbf67c1c6d4cedb56104d Mon Sep 17 00:00:00 2001 From: Catouse Date: Thu, 31 Jul 2014 14:27:43 +0800 Subject: [PATCH] * ajusted ui of testtask/view. --- module/common/view/tablesorter.html.php | 12 +-- module/testtask/control.php | 13 +++ module/testtask/css/view.css | 1 + module/testtask/js/view.js | 16 ++++ module/testtask/lang/en.php | 4 + module/testtask/lang/zh-cn.php | 4 + module/testtask/view/view.html.php | 112 ++++++++++++++++++++++-- 7 files changed, 150 insertions(+), 12 deletions(-) create mode 100644 module/testtask/js/view.js diff --git a/module/common/view/tablesorter.html.php b/module/common/view/tablesorter.html.php index ebcd2cfaa1..b68339a904 100755 --- a/module/common/view/tablesorter.html.php +++ b/module/common/view/tablesorter.html.php @@ -11,12 +11,12 @@ $(function() { sortTable(); } ); function sortTable() { $('.tablesorter').tablesorter( - { - saveSort: true, - widgets: ['zebra', 'saveSort'], - widgetZebra: {css: ['odd', 'even'] } - } - ); + { + saveSort: true, + widgets: ['zebra', 'saveSort'], + widgetZebra: {css: ['odd', 'even'] } + }); + $('.tablesorter tbody tr').hover( function(){$(this).addClass('hoover')}, function(){$(this).removeClass('hoover')} diff --git a/module/testtask/control.php b/module/testtask/control.php index 561da67246..f207e6cf60 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -180,6 +180,16 @@ class testtask extends control $task = $this->testtask->getById($taskID, true); if(!$task) die(js::error($this->lang->notFound) . js::locate('back')); $productID = $task->product; + $buildID = $task->build; + + $build = $this->loadModel('build')->getByID($buildID); + + $stories = $this->dao->select('*')->from(TABLE_STORY)->where('id')->in($build->stories)->fetchAll(); + $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'story'); + + $bugs = $this->dao->select('*')->from(TABLE_BUG)->where('id')->in($build->bugs)->fetchAll(); + $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'bug'); + $this->testtask->setMenu($this->products, $productID); $this->view->title = "TASK #$task->id $task->name/" . $this->products[$productID]; @@ -191,6 +201,9 @@ class testtask extends control $this->view->task = $task; $this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter'); $this->view->actions = $this->loadModel('action')->getList('testtask', $taskID); + $this->view->build = $build; + $this->view->stories = $stories; + $this->view->bugs = $bugs; $this->display(); } diff --git a/module/testtask/css/view.css b/module/testtask/css/view.css index e69de29bb2..2c383f55c2 100644 --- a/module/testtask/css/view.css +++ b/module/testtask/css/view.css @@ -0,0 +1 @@ +#caseList tbody tr > td:first-child {padding-left: 10px;} diff --git a/module/testtask/js/view.js b/module/testtask/js/view.js new file mode 100644 index 0000000000..58f8c49c97 --- /dev/null +++ b/module/testtask/js/view.js @@ -0,0 +1,16 @@ +$(function() +{ + $('.loadAjax').each(function() + { + var $this = $(this); + $this.load($this.data('url'), function() + { + $('#caseList').tablesorter( + { + saveSort: true, + widgets: ['zebra', 'saveSort'], + widgetZebra: {css: ['odd', 'even'] } + }).find('a.iframe').modalTrigger(); + }); + }); +}); diff --git a/module/testtask/lang/en.php b/module/testtask/lang/en.php index 6af36aa2df..5d195b08a8 100644 --- a/module/testtask/lang/en.php +++ b/module/testtask/lang/en.php @@ -51,6 +51,8 @@ $lang->testtask->lastRunAccount = "Run"; $lang->testtask->lastRunTime = 'Time'; $lang->testtask->lastRunResult = 'Result'; $lang->testtask->report = 'Report'; +$lang->testtask->stories = 'Stories'; +$lang->testtask->bugs = 'Bugs'; $lang->testtask->legendDesc = 'Desc'; $lang->testtask->legendReport = 'Report'; @@ -96,3 +98,5 @@ $lang->testtask->mail->create = new stdclass(); $lang->testtask->mail->edit = new stdclass(); $lang->testtask->mail->create->title = "%s created testtask #%s:%s"; $lang->testtask->mail->edit->title = "%s finished testtask #%s:%s"; + +$lang->testtask->testScope = 'Test scope'; diff --git a/module/testtask/lang/zh-cn.php b/module/testtask/lang/zh-cn.php index 78d0bab1f5..463d48a99c 100644 --- a/module/testtask/lang/zh-cn.php +++ b/module/testtask/lang/zh-cn.php @@ -51,6 +51,8 @@ $lang->testtask->lastRunAccount = '执行人'; $lang->testtask->lastRunTime = '执行时间'; $lang->testtask->lastRunResult = '结果'; $lang->testtask->report = '测试总结'; +$lang->testtask->stories = '相关需求'; +$lang->testtask->bugs = '相关Bug'; $lang->testtask->legendDesc = '任务描述'; $lang->testtask->legendReport = '测试总结'; @@ -96,3 +98,5 @@ $lang->testtask->mail->create = new stdclass(); $lang->testtask->mail->edit = new stdclass(); $lang->testtask->mail->create->title = "%s创建了测试任务 #%s:%s"; $lang->testtask->mail->edit->title = "%s编辑了测试任务 #%s:%s"; + +$lang->testtask->testScope = '测试范畴'; diff --git a/module/testtask/view/view.html.php b/module/testtask/view/view.html.php index 5505a1f1d7..28eec4e0ac 100644 --- a/module/testtask/view/view.html.php +++ b/module/testtask/view/view.html.php @@ -12,6 +12,7 @@ ?> +
icons['testtask']);?> id;?> @@ -54,10 +55,101 @@
-
- testtask->legendDesc;?> -
desc;?>
-
+
+ +
+
+
desc;?>
+
+
+ + + + 0):?> + + + + + + + + + + + + $story):?> + createLink('story', 'view', "storyID=$story->id", '', true);?> + + + + + + + + + + + +
testtask->stories;?> build->finishStories, $countStories);?>
idAB;?>priAB;?>story->title;?>openedByAB;?>story->estimateAB;?>statusAB;?>story->stageAB;?>
id);?>story->priList, $story->pri, $story->pri);?>'>story->priList, $story->pri, $story->pri);?>title, '', "class='preview'");?>openedBy];?>estimate;?>story->statusList[$story->status];?>story->stageList[$story->stage];?>
+ + + + + + + + + + + + + + + createLink('bug', 'view', "bugID=$bug->id", '', true);?> + + + + + + + + + + +
testtask->bugs;?> build->resolvedBugs, $countBugs)?>
idAB;?>bug->title;?>bug->status;?>openedByAB;?>bug->openedDateAB;?>bug->resolvedByAB;?>bug->resolvedDateAB;?>
id);?>title, '', "class='preview'");?>bug->statusList[$bug->status];?>openedBy];?>openedDate, 5, 11)?>resolvedBy];?>resolvedDate, 5, 11)?>
+
+
+ + + + + + + + + + + + + + + + id&browseType=all¶m=0&orderBy=id_desc&recTotal=0&recPerPage=1000&pageID=1");?> #caseList tbody tr'> + + +
idAB;?> priAB;?> testcase->title;?> testcase->type;?> testtask->assignedTo;?> testtask->lastRunAccount;?> testtask->lastRunTime;?> testtask->lastRunResult;?> statusAB;?>actions;?>
+
+
+
+
+
+
+
testtask->legendReport;?>
report;?>
@@ -72,13 +164,21 @@ testtask->legendBasicInfo;?> - + - + + + + + + + + +
testtask->project;?>testtask->project;?> createLink('project', 'story', "projectID=$task->project"), $task->projectName);?>
testtask->build;?> build == 'trunk' ? print('Trunk') : print(html::a($this->createLink('build', 'view', "buildID=$task->build"), $task->buildName));?>
build->scmPath;?>scmPath, 'http') === 0 ? printf(html::a($build->scmPath)) : printf($build->scmPath);?>
build->filePath;?>filePath, 'http') === 0 ? printf(html::a($build->filePath)) : printf($build->filePath);?>
testtask->owner;?> owner];?>