* Finish task 44490
This commit is contained in:
+2
-26
@@ -280,24 +280,10 @@ class buildModel extends model
|
||||
->leftJoin(TABLE_RELEASE)->alias('t3')->on('t1.id = t3.build')
|
||||
->leftJoin(TABLE_BRANCH)->alias('t4')->on('t1.branch = t4.id')
|
||||
->where('t1.product')->in($products)
|
||||
->beginIF($branch)->andWhere('t1.branch')->in("$branch")->fi()
|
||||
->andWhere('t1.branch')->eq($branch)->fi()
|
||||
->andWhere('t1.deleted')->eq(0)
|
||||
->orderBy('t1.date desc, t1.id desc')->fetchAll('id');
|
||||
|
||||
if($branch != 0)
|
||||
{
|
||||
$mainProductBuilds = array();
|
||||
$mainProductBuilds = $this->dao->select('t1.id, t1.name, t1.execution, t2.status as executionStatus, t3.id as releaseID, t3.status as releaseStatus, t4.name as branchName')->from(TABLE_BUILD)->alias('t1')
|
||||
->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.execution = t2.id')
|
||||
->leftJoin(TABLE_RELEASE)->alias('t3')->on('t1.id = t3.build')
|
||||
->leftJoin(TABLE_BRANCH)->alias('t4')->on('t1.branch = t4.id')
|
||||
->where('t1.product')->in($products)
|
||||
->beginIF($branch)->andWhere('t1.branch')->in("0")->fi()
|
||||
->andWhere('t1.deleted')->eq(0)
|
||||
->orderBy('t1.date desc, t1.id desc')->fetchAll('id');
|
||||
}
|
||||
|
||||
|
||||
/* Set builds and filter done executions and terminate releases. */
|
||||
$builds = array();
|
||||
foreach($productBuilds as $key => $build)
|
||||
@@ -306,16 +292,6 @@ class buildModel extends model
|
||||
if((strpos($params, 'noterminate') !== false) and ($build->releaseStatus === 'terminate')) continue;
|
||||
$builds[$key] = ((strpos($params, 'withbranch') !== false and $build->branchName) ? $build->branchName . '/' : '') . $build->name;
|
||||
}
|
||||
if($branch != 0)
|
||||
{
|
||||
$builds = $builds + $sysBuilds;
|
||||
foreach($mainProductBuilds as $key => $build)
|
||||
{
|
||||
if(empty($build->releaseID) and (strpos($params, 'nodone') !== false) and ($build->executionStatus === 'done')) continue;
|
||||
if((strpos($params, 'noterminate') !== false) and ($build->releaseStatus === 'terminate')) continue;
|
||||
$builds[$key] = ((strpos($params, 'withbranch') !== false and $build->branchName) ? $build->branchName . '/' : '') . $build->name;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(!$builds) return $sysBuilds;
|
||||
@@ -332,7 +308,7 @@ class buildModel extends model
|
||||
foreach($releases as $buildID => $releaseName) $builds[$buildID] = ((strpos($params, 'withbranch') !== false and $productBuilds[$buildID]->branchName) ? $productBuilds[$buildID]->branchName . '/' : '') . $releaseName;
|
||||
}
|
||||
|
||||
return $branch ? $builds : $sysBuilds + $builds;
|
||||
return $sysBuilds + $builds;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user