diff --git a/module/execution/model.php b/module/execution/model.php index 031ff5a1d8..59b07b9b0b 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -1162,9 +1162,12 @@ 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'; + if(!empty($projectInfo->isTpl)) $this->dao->filterTpl('never'); + /* Waterfall execution, when all phases are closed, in reverse order of date. */ if(in_array($projectModel, array('waterfall', 'waterfallplus'))) { diff --git a/module/execution/test/model/getpairs.php b/module/execution/test/model/getpairs.php index 1190727ade..3710f6a452 100755 --- a/module/execution/test/model/getpairs.php +++ b/module/execution/test/model/getpairs.php @@ -57,7 +57,6 @@ $count = array(0, 1); $modeList = array('', 'all', 'noclosed', 'stagefilter', 'withdelete', 'multiple', 'leaf', 'order_asc', 'noprefix', 'withobject', 'hideMultiple'); $executionTester = new executionModelTest(); -$executionTester->executionModel->app->user->admin = true; r($executionTester->getPairsTest($projectIDList[0], $count[0], $modeList[0])) && p('105') && e('敏捷项目1(不启用迭代的项目)'); // 敏捷项目执行查看 r($executionTester->getPairsTest($projectIDList[1], $count[0], $modeList[0])) && p('109') && e('/阶段13'); // 瀑布项目执行查看 r($executionTester->getPairsTest($projectIDList[2], $count[0], $modeList[0])) && p('126') && e('/看板30'); // 看板项目执行查看