diff --git a/module/programplan/js/create.ui.js b/module/programplan/js/create.ui.js index 2ad6dbc053..971ac15ae1 100644 --- a/module/programplan/js/create.ui.js +++ b/module/programplan/js/create.ui.js @@ -251,12 +251,12 @@ window.handleRenderRow = function($row, index, data) if(typeof data != 'undefined' && typeof data.attribute != 'undefined' && !disabled) { - const attribute = data.attribute; - for(let point in ipdStagePoint[attribute]) + const stageID = data.stageID; + for(let point in ipdStagePoint[stageID]) { let disabled = false - let value = ipdStagePoint[attribute][point]; - let hint = value; + let text = ipdStagePoint[stageID][point]; + let hint = text; /* 如果已经评审过,则置灰不能选。*/ if(reviewedPoints[value] !== undefined && reviewedPoints[value].disabled) @@ -265,7 +265,7 @@ window.handleRenderRow = function($row, index, data) hint = reviewedPointTip; } - items.push({text: value, value: value, disabled: disabled, hint: hint}); + items.push({text: text, value: point, disabled: disabled, hint: hint}); } } diff --git a/module/programplan/tao.php b/module/programplan/tao.php index 7dd8509b33..812cf0a160 100644 --- a/module/programplan/tao.php +++ b/module/programplan/tao.php @@ -557,7 +557,7 @@ class programplanTao extends programplanModel $this->insertProjectSpec($stageID, $plan); /* Ipd project create default review points. */ - if($project && $project->model == 'ipd' && $this->config->edition == 'ipd' && !$parentID) $this->loadModel('review')->createDefaultPoint($project->id, $productID, $plan->attribute); + if($project && $project->model == 'ipd' && $this->config->edition == 'ipd' && !$parentID) $this->loadModel('review')->createDefaultPoint($project->id); if($plan->type == 'kanban') { diff --git a/module/programplan/ui/create.html.php b/module/programplan/ui/create.html.php index 432d47ec5f..d7b41d6a34 100644 --- a/module/programplan/ui/create.html.php +++ b/module/programplan/ui/create.html.php @@ -201,7 +201,9 @@ $fnGenerateDefaultData = function() use ($config, $plans, $planID, $stages, $exe { foreach($stages as $stage) { - $points = !empty($enabledPoints->{$stage->type}) ? $enabledPoints->{$stage->type} : array(); + $TRpoints = isset($stage->pointList['TR']) ? array_keys($stage->pointList['TR']) : array(); + $DCPpoints = isset($stage->pointList['DCP']) ? array_keys($stage->pointList['DCP']) : array(); + $points = array_merge($TRpoints, $DCPpoints); $item = new stdClass(); $item->name = $stage->name; @@ -212,6 +214,7 @@ $fnGenerateDefaultData = function() use ($config, $plans, $planID, $stages, $exe $item->milestone = 0; $item->point = implode(',', $points); $item->parallel = 0; + $item->stageID = $stage->id; $items[] = $item; } @@ -273,7 +276,7 @@ jsVar('childEnabledTip', $lang->programplan->childEnabledTip); jsVar('typeList', $lang->execution->typeList); jsVar('confirmCreateTip', $lang->project->confirmCreateStage); jsVar('errorLang', $lang->programplan->error); -jsVar('ipdStagePoint', $project->model == 'ipd' ? $config->review->ipdReviewPoint : array()); +jsVar('ipdStagePoint', $project->model == 'ipd' ? $ipdStagePoint : array()); jsVar('attributeList', $project->model == 'ipd' ? $lang->stage->ipdTypeList : $lang->stage->typeList); jsVar('reviewedPoints', $project->model == 'ipd' ? $reviewedPoints : array()); jsVar('reviewedPointTip', $project->model == 'ipd' ? $lang->programplan->reviewedPointTip : ''); diff --git a/module/stage/model.php b/module/stage/model.php index 2f22e79840..267ef471be 100644 --- a/module/stage/model.php +++ b/module/stage/model.php @@ -183,8 +183,9 @@ class stageModel extends model } foreach($stages as $stage) { - $stage->TRpoint = isset($pointList[$stage->id]['TR']) ? implode(', ', $pointList[$stage->id]['TR']) : ''; - $stage->DCPpoint = isset($pointList[$stage->id]['DCP']) ? implode(', ', $pointList[$stage->id]['DCP']) : ''; + $stage->TRpoint = isset($pointList[$stage->id]['TR']) ? implode(', ', $pointList[$stage->id]['TR']) : ''; + $stage->DCPpoint = isset($pointList[$stage->id]['DCP']) ? implode(', ', $pointList[$stage->id]['DCP']) : ''; + $stage->pointList = $pointList[$stage->id]; } return $stages; }