From 6eda64c0896dbf7e182cf0c3673e3b2a2ae6f5a7 Mon Sep 17 00:00:00 2001 From: "chencongzhi520@gmail.com" Date: Thu, 17 May 2012 05:43:57 +0000 Subject: [PATCH] * finish task#863. --- module/testcase/control.php | 15 ++++++++++++--- module/testtask/view/cases.html.php | 1 + 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/module/testcase/control.php b/module/testcase/control.php index 3ca845632b..4457c5303a 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -439,12 +439,13 @@ class testcase extends control /** * export * - * @param string $productID + * @param int $productID * @param string $orderBy + * @param int $taskID * @access public * @return void */ - public function export($productID, $orderBy) + public function export($productID, $orderBy, $taskID = 0) { if($_POST) { @@ -461,7 +462,15 @@ class testcase extends control } /* Get cases. */ - $cases = $this->dao->select('*')->from(TABLE_CASE)->alias('t1')->where($this->session->testcaseReport)->orderBy($orderBy)->fetchAll('id'); + if($taskID) + { + $caseIDList = $this->dao->select('`case`')->from(TABLE_TESTRUN)->where('task')->eq($taskID)->fetchPairs(); + $cases = $this->dao->select('*')->from(TABLE_CASE)->alias('t1')->where($this->session->testcaseReport)->andWhere('id')->in($caseIDList)->orderBy($orderBy)->fetchAll('id'); + } + else + { + $cases = $this->dao->select('*')->from(TABLE_CASE)->alias('t1')->where($this->session->testcaseReport)->orderBy($orderBy)->fetchAll('id'); + } /* Get users, products and projects. */ $users = $this->loadModel('user')->getPairs('noletter'); diff --git a/module/testtask/view/cases.html.php b/module/testtask/view/cases.html.php index 7cf382cae7..6b55bdbd7b 100644 --- a/module/testtask/view/cases.html.php +++ b/module/testtask/view/cases.html.php @@ -28,6 +28,7 @@ var moduleID = '';
id", $lang->export, '', 'class="export"'); common::printLink('testtask', 'linkcase', "taskID=$task->id", $lang->testtask->linkCase); echo html::a($this->session->testtaskList, $lang->goback); ?>