diff --git a/module/execution/control.php b/module/execution/control.php index 32fd0de06d..234fa75fab 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1053,10 +1053,11 @@ class execution extends control list($this->view->pmUsers, $this->view->poUsers, $this->view->qdUsers, $this->view->rdUsers) = $this->executionZen->setUserMoreLink(); $this->executionZen->setCopyProjects($project); + $isStage = isset($output['type']) && $output['type'] == 'stage'; if($project->model == 'waterfall' || $project->model == 'waterfallplus') { $this->view->parentStage = 0; - $this->view->parentStages = $this->loadModel('programplan')->getParentStageList($projectID, 0, 0, 'withparent|noclosed'); + $this->view->parentStages = $this->loadModel('programplan')->getParentStageList($projectID, 0, 0, 'withparent|noclosed|' . ($isStage ? 'stage' : 'notstage')); } $this->view->title = $this->app->tab == 'execution' ? $this->lang->execution->createExec : $this->lang->execution->create; @@ -1071,7 +1072,7 @@ class execution extends control $this->view->productID = $productID; $this->view->projectID = $projectID; $this->view->from = $this->app->tab; - $this->view->isStage = isset($output['type']) && $output['type'] == 'stage'; + $this->view->isStage = $isStage; $this->view->isKanban = isset($output['type']) && $output['type'] == 'kanban'; $this->view->project = $project; $this->view->planID = $planID; diff --git a/module/execution/ui/create.field.php b/module/execution/ui/create.field.php index 501b115bb6..08637f7daa 100644 --- a/module/execution/ui/create.field.php +++ b/module/execution/ui/create.field.php @@ -20,7 +20,7 @@ $fields->field('project') ->items(data('allProjects')) ->value(data('projectID')); -if($project->model == 'waterfall') +if($project->model == 'waterfall' || $project->model == 'waterfallplus') { $fields->field('parent') ->wrapBefore(true) diff --git a/module/programplan/model.php b/module/programplan/model.php index 45c20fd1b0..017e454389 100755 --- a/module/programplan/model.php +++ b/module/programplan/model.php @@ -530,6 +530,7 @@ class programplanModel extends model $plan = $this->getByID($planID); $parents = array(); $withParent = strpos($param, 'withparent') !== false; + $isStage = strpos("|$param|", '|stage|') !== false || strpos($param, 'stage') === false; $allExecutions = $withParent ? $this->dao->select('id,name,parent,grade,path,type')->from(TABLE_EXECUTION) ->where('type')->notin(array('program', 'project')) ->andWhere('deleted')->eq('0') @@ -551,6 +552,8 @@ class programplanModel extends model else { if(!$isCreate) unset($parentStage[$key]); // 隐藏有数据的阶段 + if($isStage && (isset($parentTypes['sprint']) || isset($parentTypes['kanban']))) unset($parentStage[$key]); // 如果是阶段,隐藏叶子节点是迭代和看板的数据 + if(!$isStage && (isset($parentTypes['stage']) || isset($parentTypes['stage']))) unset($parentStage[$key]); // 如果不是阶段,隐藏叶子节点是阶段的数据 } /* Set stage name. */ @@ -567,7 +570,7 @@ class programplanModel extends model } } $project = $this->fetchByID($executionID); - if((!empty($plan) && $plan->type == 'stage') || $project->model == 'waterfall') $parentStage[0] = $this->lang->programplan->emptyParent; + if((!empty($plan) && $plan->type == 'stage') || $project->model == 'waterfall' || $isStage) $parentStage[0] = $this->lang->programplan->emptyParent; ksort($parentStage); return $parentStage;