* finish task#863.

This commit is contained in:
chencongzhi520@gmail.com
2012-05-17 05:43:57 +00:00
parent 2bec605ffc
commit 6eda64c089
2 changed files with 13 additions and 3 deletions
+12 -3
View File
@@ -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');
+1
View File
@@ -28,6 +28,7 @@ var moduleID = '<?php echo $moduleID;?>';
</div>
<div class='f-right'>
<?php
common::printLink('testcase', 'export', "productID=$productID&orderBy=id_asc&taskID=$task->id", $lang->export, '', 'class="export"');
common::printLink('testtask', 'linkcase', "taskID=$task->id", $lang->testtask->linkCase);
echo html::a($this->session->testtaskList, $lang->goback);
?>