From aaab4f691aeadd08f9e3f40206c306ca2b667ef8 Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Mon, 7 Sep 2020 14:23:36 +0800 Subject: [PATCH] * Finish task #7832. --- module/durationestimation/config.php | 2 ++ module/durationestimation/control.php | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/module/durationestimation/config.php b/module/durationestimation/config.php index 14492e4944..8a42d3deee 100644 --- a/module/durationestimation/config.php +++ b/module/durationestimation/config.php @@ -2,3 +2,5 @@ $config->durationestimation = new stdclass(); $config->durationestimation->index = new stdclass(); $config->durationestimation->index->requiredFields = 'scale,productivity,scale,duration,unitLaborCost,totalLaborCost'; + +$config->durationestimation->workloadTotal = 100; diff --git a/module/durationestimation/control.php b/module/durationestimation/control.php index e9d8998aeb..2cbb6f2a0f 100644 --- a/module/durationestimation/control.php +++ b/module/durationestimation/control.php @@ -50,7 +50,9 @@ class durationestimation extends control { $total = 0; foreach($this->post->workload as $value) $total += $value; - if($total != 100) $this->send(array('result' => 'fail', 'message' => $this->lang->durationestimation->workloadError)); + + $workloadTotal = $this->config->durationestimation->workloadTotal; + if($total != $workloadTotal) $this->send(array('result' => 'fail', 'message' => $this->lang->durationestimation->workloadError)); $this->durationestimation->save($programID);