From bbd45d46dc79f47cb566c206775b986df7b2f15d Mon Sep 17 00:00:00 2001 From: leiyong <1549684884@qq.com> Date: Mon, 30 Nov 2020 11:13:53 +0800 Subject: [PATCH] * Repair plan workload. --- module/programplan/control.php | 1 - module/programplan/model.php | 17 ++------------- module/programplan/view/edit.html.php | 31 ++++++--------------------- 3 files changed, 8 insertions(+), 41 deletions(-) diff --git a/module/programplan/control.php b/module/programplan/control.php index 88edaf56eb..d3398a4553 100644 --- a/module/programplan/control.php +++ b/module/programplan/control.php @@ -167,7 +167,6 @@ class programplan extends control $this->view->title = $this->lang->programplan->edit; $this->view->position[] = $this->lang->programplan->edit; $this->view->parentStage = $this->programplan->getParentStageList($this->session->PRJ, $planID, $plan->product); - $this->view->isParent = $this->programplan->isParent($planID); $this->view->isCreateTask = $this->programplan->isCreateTask($planID); $this->view->plan = $plan; diff --git a/module/programplan/model.php b/module/programplan/model.php index b6a7be09e9..49658b005c 100644 --- a/module/programplan/model.php +++ b/module/programplan/model.php @@ -323,9 +323,10 @@ class programplanModel extends model $plans = $this->getStage($projectID, $stage->product, 'parent'); $totalPercent = 0; + $stageID = $stage->id; foreach($plans as $id => $stage) { - if($id == $stage->id) continue; + if($id == $stageID) continue; $totalPercent += $stage->percent; } @@ -695,7 +696,6 @@ class programplanModel extends model if($totalPercent > 100) return dao::$errors['percent'][] = $this->lang->programplan->error->percentOver; } - /* Set planDuration and realDuration. */ $plan->planDuration = $this->getDuration($plan->begin, $plan->end); $plan->realDuration = $this->getDuration($plan->realBegan, $plan->realEnd); @@ -909,19 +909,6 @@ class programplanModel extends model ->fetchPairs(); } - /** - * Is parent. - * - * @param int $planID - * @access public - * @return bool - */ - public function isParent($planID) - { - $childrenStage = $this->dao->select('grade')->from(TABLE_PROJECT)->where('parent')->eq($planID)->andWhere('deleted')->eq('0')->fetch(); - return empty($childrenStage) ? false : true; - } - /** * Get parent stage list. * diff --git a/module/programplan/view/edit.html.php b/module/programplan/view/edit.html.php index 357a495691..e5a7c9a744 100644 --- a/module/programplan/view/edit.html.php +++ b/module/programplan/view/edit.html.php @@ -12,7 +12,6 @@ ?> -parent);?>