* [bug#67262] Fix the bug of create programplan.

This commit is contained in:
xieqiyu
2025-11-14 06:54:40 +00:00
parent db3e56f4a3
commit 7aec54fcc3
4 changed files with 5 additions and 5 deletions
+1
View File
@@ -188,6 +188,7 @@ class programplan extends control
if(empty($plan->realBegan)) $plan->realBegan = null;
if(empty($plan->realEnd)) $plan->realEnd = null;
if(empty($plan->percent)) $plan->percent = 0;
$plan = $this->programplanZen->prepareEditPlan($planID, $projectID, $plan, isset($parentStage) ? $parentStage : null);
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
+2 -2
View File
@@ -208,7 +208,7 @@ $fnGenerateDefaultData = function() use ($config, $plans, $planID, $stages, $exe
$item = new stdClass();
$item->name = $stage->name;
$item->code = isset($stage->code) ? $stage->code : '';
$item->percent = $stage->percent;
$item->percent = $stage->percent ?: 0;
$item->attribute = $stage->type;
$item->acl = 'open';
$item->milestone = 0;
@@ -235,7 +235,7 @@ $fnGenerateDefaultData = function() use ($config, $plans, $planID, $stages, $exe
$item->code = $plan->code;
$item->PM = $plan->PM;
$item->status = $plan->status;
$item->percent = $plan->percent;
$item->percent = $plan->percent ?: 0;
$item->attribute = $plan->attribute;
$item->acl = $plan->acl;
$item->milestone = $plan->milestone;
+1 -1
View File
@@ -75,7 +75,7 @@ formPanel
set::value($plan->PM),
)
),
isset($config->setPercent) && $config->setPercent == 1 && $project->model != 'research' ? formGroup
isset($config->setPercent) && $config->setPercent == 1 && !in_array($project->model, array('research', 'ipd')) ? formGroup
(
set::label($lang->programplan->percent),
set::width('2/3'),
+1 -2
View File
@@ -81,7 +81,6 @@ class programplanZen extends programplan
$prevLevel = 0;
foreach($plans as $rowID => $plan)
{
if(empty($parentID) and empty($oldPlans)) $plan->id = '';
$plan->days = isset($plan->enabled) && $plan->enabled == 'on' ? $this->programplan->calcDaysForStage($plan->begin, $plan->end) : 0;
$plan->project = $projectID;
@@ -90,7 +89,7 @@ class programplanZen extends programplan
$plan->parent = $parentID ? $parentID : $projectID;
$plan->isTpl = $project->isTpl;
if($plan->id && isset($oldPlans[$plan->id])) $plan->parent = $oldPlans[$plan->id]->parent;
if(!empty($plan->percent) && $plan->type != 'stage') $plan->percent = 0; // 非阶段类型,工作量占比为0
if($plan->type != 'stage' || empty($plan->percent)) $plan->percent = 0; // 非阶段类型,工作量占比为0
if(empty($plan->days)) $plan->days = helper::diffDate($plan->end, $plan->begin) + 1;
if(!empty($parentID) && !empty($parentStage) && $parentStage->attribute != 'mix') $plan->attribute = $parentStage->attribute;;