From 907dfc23d787299ad78d4a54d5fe06da53fcec1a Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Fri, 15 Jan 2021 14:17:46 +0800 Subject: [PATCH] * Finish task #8988. --- module/programplan/lang/de.php | 1 + module/programplan/lang/en.php | 1 + module/programplan/lang/fr.php | 1 + module/programplan/lang/vi.php | 1 + module/programplan/lang/zh-cn.php | 1 + module/programplan/lang/zh-tw.php | 1 + module/programplan/model.php | 14 -------------- module/programplan/view/create.html.php | 9 ++++++++- 8 files changed, 14 insertions(+), 15 deletions(-) diff --git a/module/programplan/lang/de.php b/module/programplan/lang/de.php index 0674b139fe..959f9c085d 100644 --- a/module/programplan/lang/de.php +++ b/module/programplan/lang/de.php @@ -54,6 +54,7 @@ $lang->programplan->noData = 'No Data'; $lang->programplan->children = 'Sub Plan'; $lang->programplan->childrenAB = 'Child'; $lang->programplan->confirmDelete = 'Do you want to delete the current plan?'; +$lang->programplan->workloadTips = 'The subphase workload ratio is split at a percentage of 100 percent'; $lang->programplan->stageCustom = new stdClass(); $lang->programplan->stageCustom->date = 'Show Date'; diff --git a/module/programplan/lang/en.php b/module/programplan/lang/en.php index 0674b139fe..959f9c085d 100644 --- a/module/programplan/lang/en.php +++ b/module/programplan/lang/en.php @@ -54,6 +54,7 @@ $lang->programplan->noData = 'No Data'; $lang->programplan->children = 'Sub Plan'; $lang->programplan->childrenAB = 'Child'; $lang->programplan->confirmDelete = 'Do you want to delete the current plan?'; +$lang->programplan->workloadTips = 'The subphase workload ratio is split at a percentage of 100 percent'; $lang->programplan->stageCustom = new stdClass(); $lang->programplan->stageCustom->date = 'Show Date'; diff --git a/module/programplan/lang/fr.php b/module/programplan/lang/fr.php index 0674b139fe..959f9c085d 100644 --- a/module/programplan/lang/fr.php +++ b/module/programplan/lang/fr.php @@ -54,6 +54,7 @@ $lang->programplan->noData = 'No Data'; $lang->programplan->children = 'Sub Plan'; $lang->programplan->childrenAB = 'Child'; $lang->programplan->confirmDelete = 'Do you want to delete the current plan?'; +$lang->programplan->workloadTips = 'The subphase workload ratio is split at a percentage of 100 percent'; $lang->programplan->stageCustom = new stdClass(); $lang->programplan->stageCustom->date = 'Show Date'; diff --git a/module/programplan/lang/vi.php b/module/programplan/lang/vi.php index 0674b139fe..959f9c085d 100644 --- a/module/programplan/lang/vi.php +++ b/module/programplan/lang/vi.php @@ -54,6 +54,7 @@ $lang->programplan->noData = 'No Data'; $lang->programplan->children = 'Sub Plan'; $lang->programplan->childrenAB = 'Child'; $lang->programplan->confirmDelete = 'Do you want to delete the current plan?'; +$lang->programplan->workloadTips = 'The subphase workload ratio is split at a percentage of 100 percent'; $lang->programplan->stageCustom = new stdClass(); $lang->programplan->stageCustom->date = 'Show Date'; diff --git a/module/programplan/lang/zh-cn.php b/module/programplan/lang/zh-cn.php index ce0fc17233..cb2f541958 100644 --- a/module/programplan/lang/zh-cn.php +++ b/module/programplan/lang/zh-cn.php @@ -54,6 +54,7 @@ $lang->programplan->noData = '暂无数据。'; $lang->programplan->children = '二级计划'; $lang->programplan->childrenAB = '子'; $lang->programplan->confirmDelete = '确定要删除当前计划吗?'; +$lang->programplan->workloadTips = '子阶段工作量占比按百分百的比例进行拆分'; $lang->programplan->stageCustom = new stdClass(); $lang->programplan->stageCustom->date = '显示日期'; diff --git a/module/programplan/lang/zh-tw.php b/module/programplan/lang/zh-tw.php index c587b1f6fa..b3c7be5cbf 100644 --- a/module/programplan/lang/zh-tw.php +++ b/module/programplan/lang/zh-tw.php @@ -54,6 +54,7 @@ $lang->programplan->noData = '暫無數據。'; $lang->programplan->children = '二級計劃'; $lang->programplan->childrenAB = '子'; $lang->programplan->confirmDelete = '確定要刪除當前計劃嗎?'; +$lang->programplan->workloadTips = '子階段工作量佔比按百分百的比例進行拆分'; $lang->programplan->stageCustom = new stdClass(); $lang->programplan->stageCustom->date = '顯示日期'; diff --git a/module/programplan/model.php b/module/programplan/model.php index 22fb2cb0e2..823f71c1ac 100644 --- a/module/programplan/model.php +++ b/module/programplan/model.php @@ -461,13 +461,6 @@ class programplanModel extends model if($plan->milestone) $milestone = 1; } - /* The sum of the workload of the child phases cannot be greater than that of the parent phase. */ - if($parentID && $totalPercent > $parentPercent) - { - dao::$errors['message'][] = sprintf($this->lang->programplan->error->parentWorkload, $parentPercent . '%'); - return false; - } - if($totalPercent > 100) return dao::$errors['message'][] = $this->lang->programplan->error->percentOver; $this->loadModel('action'); @@ -652,13 +645,6 @@ class programplanModel extends model $childrenTotalPercent = $this->getTotalPercent($parentStage, true); $childrenTotalPercent = $plan->parent == $oldPlan->parent ? ($childrenTotalPercent - $oldPlan->percent + $plan->percent) : ($childrenTotalPercent + $plan->percent); - /* The sum of the workload of the child phases cannot be greater than that of the parent phase. */ - if($childrenTotalPercent > $parentPercent) - { - dao::$errors['message'][] = sprintf($this->lang->programplan->error->parentWorkload, $parentPercent . '%'); - return false; - } - /* If child plan has milestone, update parent plan set milestone eq 0 . */ if($plan->milestone and $parentStage->milestone) $this->dao->update(TABLE_PROJECT)->set('milestone')->eq(0)->where('id')->eq($oldPlan->parent)->exec(); } diff --git a/module/programplan/view/create.html.php b/module/programplan/view/create.html.php index 5e86440a0a..800a615567 100644 --- a/module/programplan/view/create.html.php +++ b/module/programplan/view/create.html.php @@ -12,6 +12,7 @@ ?> +