From 3a8b2ceafa75b694d2f6665be7f421a73288f8ef Mon Sep 17 00:00:00 2001 From: sunguangming Date: Mon, 12 May 2025 04:19:44 +0000 Subject: [PATCH] * [bug#62348,done,0.5h] fix bug. --- module/execution/control.php | 14 +++++++++++++- module/execution/js/create.ui.js | 7 +++++++ module/execution/ui/create.field.php | 1 + module/execution/ui/create.html.php | 1 + 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/module/execution/control.php b/module/execution/control.php index 2081fcd549..c5c9e55c51 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1106,7 +1106,19 @@ class execution extends control if(!empty($project) && in_array($project->model, $this->config->project->waterfallList)) { if($project->model == 'waterfall') $isStage = true; - $this->view->parentStage = isset($output['parentStage']) ? $output['parentStage'] : 0; + $parentStage = isset($output['parentStage']) ? $output['parentStage'] : 0; + if($parentStage) + { + $parent = $this->execution->fetchById((int)$parentStage); + if($parent->attribute != 'mix') + { + foreach($this->lang->stage->typeList as $type => $label) + { + if($type != $parent->attribute) unset($this->lang->stage->typeList[$type]); + } + } + } + $this->view->parentStage = $parentStage; $this->view->parentStages = $this->loadModel('programplan')->getParentStageList($projectID, 0, 0, 'withparent|noclosed|' . ($isStage ? 'stage' : 'notstage')); } diff --git a/module/execution/js/create.ui.js b/module/execution/js/create.ui.js index 870fd16f71..3b31ea89b0 100644 --- a/module/execution/js/create.ui.js +++ b/module/execution/js/create.ui.js @@ -121,3 +121,10 @@ function toggleOpsTip() $(this).closest('.form-group').append('
' + typeDesc + '
'); } } + +function setParentStage() +{ + const parentStage = $('input[name=parent]').val(); + const type = $('input[name=type]').val(); + loadPage($.createLink('execution', 'create', 'projectID=' + projectID + '&executionID=0©ExecutionID=&planID=0&confirm=no&productID=0&extra=type=' + type + ',parentStage=' + parentStage)); +} \ No newline at end of file diff --git a/module/execution/ui/create.field.php b/module/execution/ui/create.field.php index 748ed9b788..81881441a0 100644 --- a/module/execution/ui/create.field.php +++ b/module/execution/ui/create.field.php @@ -57,6 +57,7 @@ $fields->field('code') $fields->field('type') ->required() + ->labelHint($isStage ? $lang->execution->typeTip : '') ->control($isStage ? 'picker' : 'checkBtnGroup') ->label($showExecutionExec ? $lang->execution->execType : $lang->execution->type) ->name($isStage ? 'attribute' : 'lifetime') diff --git a/module/execution/ui/create.html.php b/module/execution/ui/create.html.php index 28383812be..5572e6e7c2 100644 --- a/module/execution/ui/create.html.php +++ b/module/execution/ui/create.html.php @@ -68,6 +68,7 @@ formGridPanel on::change('[name=type]', 'setType'), on::change('[name=begin],[name=end]', 'computeWorkDays'), on::change('[name=teams]', 'loadMembers'), + on::change('[name=parent]', 'setParentStage'), on::change('#copyTeam', 'toggleCopyTeam'), on::click('[name=lifetime]', 'toggleOpsTip'), set::fields($fields)