From 7a614b4a5a85cbe843a7b22dd9982bce3effbead Mon Sep 17 00:00:00 2001 From: Yagami Date: Wed, 17 May 2023 13:31:09 +0800 Subject: [PATCH] * Fix bug #35218. --- module/programplan/model.php | 6 ++++-- module/programplan/view/gantt.html.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/module/programplan/model.php b/module/programplan/model.php index ee60758cd6..0aa7344f41 100755 --- a/module/programplan/model.php +++ b/module/programplan/model.php @@ -213,7 +213,8 @@ class programplanModel extends model $data->deadline = $end; $data->realBegan = $realBegan ? substr($realBegan, 0, 10) : ''; $data->realEnd = $realEnd ? substr($realEnd, 0, 10) : '';; - $data->parent = $plan->grade == 1 ? 0 :$plan->parent; + $data->parent = $plan->grade == 1 ? 0 : $plan->parent; + $data->isParent = false; $data->open = true; $data->start_date = $realBegan ? $realBegan : $start; $data->endDate = $realEnd ? $realEnd : $end; @@ -238,7 +239,8 @@ class programplanModel extends model if($data->start_date == '' or $data->endDate == '') $data->duration = 1; $datas['data'][$plan->id] = $data; - $stageIndex[$plan->id] = array('planID' => $plan->id, 'parent' => $plan->parent, 'progress' => array('totalEstimate' => 0, 'totalConsumed' => 0, 'totalReal' => 0)); + if(isset($datas['data'][$data->parent])) $datas['data'][$data->parent]->isParent = 1; + $stageIndex[$plan->id] = array('planID' => $plan->id, 'parent' => $plan->parent, 'progress' => array('totalEstimate' => 0, 'totalConsumed' => 0, 'totalReal' => 0)); } $taskPri = "%s "; diff --git a/module/programplan/view/gantt.html.php b/module/programplan/view/gantt.html.php index 3ca5e4a44c..d96361df2e 100755 --- a/module/programplan/view/gantt.html.php +++ b/module/programplan/view/gantt.html.php @@ -775,7 +775,7 @@ $(function() var task = gantt.getTask(id); if(task.type == 'point' && task.rawStatus) location.href = createLink('review', 'view', 'reviewID=' + task.reviewID); - if(task.type == 'plan') window.parent.$.apps.open(createLink('execution', 'task', 'id=' + task.id), 'execution'); + if(task.type == 'plan' && !task.isParent) window.parent.$.apps.open(createLink('execution', 'task', 'id=' + task.id), 'execution'); if($(e.srcElement).hasClass('icon-confirm')) {