* Finish task #44354.

This commit is contained in:
liumengyi
2021-11-17 09:16:28 +08:00
parent d778a69a90
commit 3bdd6fe22a
+1 -13
View File
@@ -1027,31 +1027,19 @@ class reportModel extends model
*/
public function getProjectExecutions()
{
$mode = $this->cookie->executionMode;
$executions = $this->dao->select('t1.id, t1.name, t2.name as projectname, t1.status')
->from(TABLE_EXECUTION)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project=t2.id')
->where('t1.deleted')->eq(0)
->andWhere('t1.type')->in('stage,sprint')
->fetchAll();
$pairs = array();
foreach($executions as $execution)
{
if(strpos($mode, 'noclosed') !== false and ($execution->status == 'done' or $execution->status == 'closed')) continue;
if(strpos($mode, 'stagefilter') !== false and isset($executionModel) and $executionModel == 'waterfall' and in_array($execution->attribute, array('request', 'design', 'review'))) continue; // Some stages of waterfall not need.
$pairs[$execution->id] = $this->config->systemMode == 'new' ? $execution->projectname . '/' .$execution->name : $execution->name;
}
if(strpos($mode, 'empty') !== false) $pairs[0] = '';
/* If the pairs is empty, to make sure there's an execution in the pairs. */
if(empty($pairs) and isset($executions[0]))
{
$firstExecution = $executions[0];
$pairs[$firstExecution->id] = $firstExecution->name;
}
return $pairs;
}
}