+ {$lang->execution->all}", '', "class='btn btn-link btn-active-text'");?>
id", '', '', '', true), " " . $lang->testcase->create, '', "class='btn btn-primary'");?>
@@ -19,27 +20,56 @@
diff --git a/module/testcase/model.php b/module/testcase/model.php
index 46a4607193..9fe91a4b91 100644
--- a/module/testcase/model.php
+++ b/module/testcase/model.php
@@ -120,7 +120,7 @@ class testcaseModel extends model
}
/* If the story is linked project, make the case link the project. */
- $this->syncCase2Project($case);
+ $this->syncCase2Project($case, $caseID);
return array('status' => 'created', 'id' => $caseID);
}
@@ -230,7 +230,7 @@ class testcaseModel extends model
$caseID = $this->dao->lastInsertID();
/* If the story is linked project, make the case link the project. */
- $this->syncCase2Project($case);
+ $this->syncCase2Project($case, $caseID);
$this->executeHooks($caseID);
$this->loadModel('score')->create('testcase', 'create', $caseID);
@@ -297,6 +297,28 @@ class testcaseModel extends model
->fetchAll('id');
}
+ /**
+ * Get execution cases.
+ *
+ * @param int $executionID
+ * @param string $orderBy
+ * @param object $pager
+ * @param string $browseType
+ * @access public
+ * @return array
+ */
+ public function getExecutionCases($executionID, $orderBy = 'id_desc', $pager = null, $browseType = '')
+ {
+ return $this->dao->select('distinct t1.*, t2.*')->from(TABLE_PROJECTCASE)->alias('t1')
+ ->leftJoin(TABLE_CASE)->alias('t2')->on('t1.case=t2.id')
+ ->where('t1.project')->eq((int)$executionID)
+ ->beginIF($browseType != 'all')->andWhere('t2.status')->eq($browseType)->fi()
+ ->andWhere('t2.deleted')->eq('0')
+ ->orderBy($orderBy)
+ ->page($pager)
+ ->fetchAll('id');
+ }
+
/**
* Get by suite.
*
@@ -1688,7 +1710,7 @@ class testcaseModel extends model
* @access public
* @return void
*/
- public function syncCase2Project($case)
+ public function syncCase2Project($case, $caseID)
{
if(!empty($case->story))
{