* [bug#69226,done,1h] query template data when the project is template.
This commit is contained in:
@@ -1162,7 +1162,8 @@ class executionModel extends model
|
||||
$projectModel = '';
|
||||
if($projectID)
|
||||
{
|
||||
$projectModel = $this->dao->select('model')->from(TABLE_EXECUTION)->where('id')->eq($projectID)->andWhere('deleted')->eq(0)->fetch('model');
|
||||
$projectInfo = $this->dao->select('model,isTpl')->from(TABLE_EXECUTION)->where('id')->eq($projectID)->andWhere('deleted')->eq(0)->fetch();
|
||||
$projectModel = isset($projectInfo->model) ? $projectInfo->model : '';
|
||||
$orderBy = in_array($projectModel, array('waterfall', 'waterfallplus')) ? 'sortStatus_asc,begin_asc,id_asc' : 'id_desc';
|
||||
|
||||
/* Waterfall execution, when all phases are closed, in reverse order of date. */
|
||||
@@ -1171,6 +1172,8 @@ class executionModel extends model
|
||||
$statistic = $this->dao->select("count(id) as executions, sum(IF(INSTR('closed', status) < 1, 0, 1)) as closedExecutions")->from(TABLE_EXECUTION)->where('project')->eq($projectID)->andWhere('deleted')->eq('0')->fetch();
|
||||
if($statistic->executions == $statistic->closedExecutions) $orderBy = 'sortStatus_asc,begin_desc,id_asc';
|
||||
}
|
||||
|
||||
if(!empty($projectInfo->isTpl)) $this->dao->filterTpl('never');
|
||||
}
|
||||
|
||||
/* Order by status's content whether or not done. */
|
||||
|
||||
Reference in New Issue
Block a user