From 311b80803c4ec8793ebacbcf294ef2bd68fc7921 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Fri, 23 Jan 2026 13:16:22 +0800 Subject: [PATCH] * [bug#69226,done,1h] query template data when the project is template. --- module/execution/model.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/module/execution/model.php b/module/execution/model.php index 031ff5a1d8..d9c3343585 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -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. */