This commit is contained in:
wangyidong
2015-09-10 14:27:10 +08:00
parent 1db6ebc5b1
commit 8cf7c265c2
+13 -25
View File
@@ -103,42 +103,30 @@ class testtask extends control
/* Create testtask from build of project.*/
if($projectID != 0 and $build != 0)
{
$products = $this->dao->select('t2.id, t2.name')
->from(TABLE_PROJECTPRODUCT)->alias('t1')
->leftJoin(TABLE_PRODUCT)->alias('t2')
->on('t1.product = t2.id')
$products = $this->dao->select('t2.id, t2.name')->from(TABLE_PROJECTPRODUCT)->alias('t1')
->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id')
->where('t1.project')->eq($projectID)
->andWhere('t2.deleted')->eq(0)
->fetchPairs('id');
foreach($products as $key => $value)
{
$productID = $key;
break;
}
$projects = $this->dao->select('id, name')->from(TABLE_PROJECT)->where('id')->eq($projectID)->fetchPairs('id');
$builds = $this->dao->select('id, name')->from(TABLE_BUILD)->where('id')->eq($build)->fetchPairs('id');
$productID = key($products);
$projects = $this->dao->select('id, name')->from(TABLE_PROJECT)->where('id')->eq($projectID)->andWhere('deleted')->eq(0)->fetchPairs('id');
$builds = $this->dao->select('id, name')->from(TABLE_BUILD)->where('id')->eq($build)->andWhere('deleted')->eq(0)->fetchPairs('id');
}
/* Create testtask from testtask of project.*/
if($projectID != 0 and $build == 0)
{
$products = $this->dao->select('t2.id, t2.name')
->from(TABLE_PROJECTPRODUCT)->alias('t1')
->leftJoin(TABLE_PRODUCT)->alias('t2')
->on('t1.product = t2.id')
$products = $this->dao->select('t2.id, t2.name')->from(TABLE_PROJECTPRODUCT)->alias('t1')
->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id')
->where('t1.project')->eq($projectID)
->andWhere('t2.deleted')->eq(0)
->fetchPairs('id');
foreach($products as $key => $value)
{
$productID = $key;
break;
}
$projects = $this->dao->select('id, name')->from(TABLE_PROJECT)->where('id')->eq($projectID)->fetchPairs('id');
$builds = $this->dao->select('id, name')->from(TABLE_BUILD)->where('project')->eq($projectID)->fetchPairs('id');
$builds = array('trunk' => 'Trunk') + $builds;
$productID = key($products);
$projects = $this->dao->select('id, name')->from(TABLE_PROJECT)->where('id')->eq($projectID)->andWhere('deleted')->eq(0)->fetchPairs('id');
$builds = $this->dao->select('id, name')->from(TABLE_BUILD)->where('project')->eq($projectID)->andWhere('deleted')->eq(0)->fetchPairs('id');
$builds = array('trunk' => 'Trunk') + $builds;
}
/* Create testtask from testtask of test.*/