* finish task #2119.

This commit is contained in:
wangyidong
2014-11-04 07:49:10 +00:00
parent b0b9235673
commit 64d6b19a4c
6 changed files with 52 additions and 34 deletions
+5 -1
View File
@@ -433,14 +433,16 @@ class testcase extends control
* @access public
* @return void
*/
public function view($caseID, $version = 0, $from = 'testcase')
public function view($caseID, $version = 0, $from = 'testcase', $taskID = 0)
{
$case = $this->testcase->getById($caseID, $version);
if(!$case) die(js::error($this->lang->notFound) . js::locate('back'));
if($from == 'testtask') $run = $this->loadModel('testtask')->getRunByCase($taskID, $caseID);
$productID = $case->product;
$this->testcase->setMenu($this->products, $productID);
$this->view->title = "CASE #$case->id $case->title - " . $this->products[$productID];
$this->view->position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID"), $this->products[$productID]);
$this->view->position[] = $this->lang->testcase->common;
@@ -448,12 +450,14 @@ class testcase extends control
$this->view->case = $case;
$this->view->from = $from;
$this->view->taskID = $taskID;
$this->view->version = $version ? $version : $case->version;
$this->view->productName = $this->products[$productID];
$this->view->modulePath = $this->tree->getParents($case->module);
$this->view->users = $this->user->getPairs('noletter');
$this->view->actions = $this->loadModel('action')->getList('case', $caseID);
$this->view->preAndNext = $this->loadModel('common')->getPreAndNextObject('testcase', $caseID);
$this->view->runID = $from == 'testcase' ? 0 : $run->id;
$this->display();
}