diff --git a/module/execution/control.php b/module/execution/control.php index 3dda2a2d7f..3630ba4610 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1058,7 +1058,7 @@ public function create(int $projectID = 0, int $executionID = 0, int $copyExecut $isStage = isset($output['type']) && $output['type'] == 'stage'; if(!empty($project) && ($project->model == 'waterfall' || $project->model == 'waterfallplus')) { - $this->view->parentStage = 0; + $this->view->parentStage = isset($output['parentStage']) ? $output['parentStage'] : 0; $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 c43429e11a..870fd16f71 100644 --- a/module/execution/js/create.ui.js +++ b/module/execution/js/create.ui.js @@ -36,8 +36,9 @@ function refreshPage() */ function setType() { - const type = $('input[name=type]').val(); - loadPage($.createLink('execution', 'create', 'projectID=' + projectID + '&executionID=0©ExecutionID=&planID=0&confirm=no&productID=0&extra=type=' + type)); + const type = $('input[name=type]').val(); + const parentStage = $('input[name=parent]').val(); + loadPage($.createLink('execution', 'create', 'projectID=' + projectID + '&executionID=0©ExecutionID=&planID=0&confirm=no&productID=0&extra=type=' + type + ',parentStage=' + parentStage)); } /**