From 4463151d96126e120dfa43d49cde2cb6f9cc6c42 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 3 May 2017 11:21:11 +0800 Subject: [PATCH] =?UTF-8?q?Finish=20task#2992=20=E7=87=83=E5=B0=BD?= =?UTF-8?q?=E5=9B=BE=E4=BF=AE=E6=94=B9=E9=A6=96=E5=A4=A9=E5=B7=A5=E6=97=B6?= =?UTF-8?q?=E6=97=B6=E5=B0=86=E9=82=A3=E4=B8=80=E5=A4=A9=E7=9A=84=E5=89=A9?= =?UTF-8?q?=E4=BD=99=E5=B7=A5=E6=97=B6=E4=B9=9F=E4=BF=AE=E6=94=B9=E4=BA=86?= =?UTF-8?q?,cost:1=20left:0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/project/control.php | 4 ++-- module/project/lang/en.php | 1 + module/project/lang/zh-cn.php | 1 + module/project/model.php | 4 ++-- module/project/view/fixfirst.html.php | 12 ++++++++++++ 5 files changed, 18 insertions(+), 4 deletions(-) diff --git a/module/project/control.php b/module/project/control.php index ea77051622..e44053fa34 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -810,11 +810,11 @@ class project extends control * @access public * @return void */ - public function fixFirst($projectID) + public function fixFirst($projectID, $withLeft = false) { if($_POST) { - $this->project->fixFirst($projectID); + $this->project->fixFirst($projectID, $withLeft); die(js::reload('parent.parent')); } diff --git a/module/project/lang/en.php b/module/project/lang/en.php index 9df8d39a8c..2fc63a3887 100644 --- a/module/project/lang/en.php +++ b/module/project/lang/en.php @@ -207,6 +207,7 @@ $lang->project->goback = "Go Back"; $lang->project->noweekend = 'Without Weekend'; $lang->project->withweekend = 'With Weekend'; $lang->project->interval = 'Intervals'; +$lang->project->fixFirstWithLeft = 'Do you want to set the left of the day to this value?'; /* 统计。*/ $lang->project->charts = new stdclass(); diff --git a/module/project/lang/zh-cn.php b/module/project/lang/zh-cn.php index 68502ff6f6..686d59382c 100644 --- a/module/project/lang/zh-cn.php +++ b/module/project/lang/zh-cn.php @@ -207,6 +207,7 @@ $lang->project->goback = "返回任务列表"; $lang->project->noweekend = '去除周末'; $lang->project->withweekend = '显示周末'; $lang->project->interval = '间隔'; +$lang->project->fixFirstWithLeft = '是否将该天剩余工时也设置为该值?'; /* 统计。*/ $lang->project->charts = new stdclass(); diff --git a/module/project/model.php b/module/project/model.php index 32d7a71b4c..d6948b0c87 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1553,7 +1553,7 @@ class projectModel extends model * @access public * @return void */ - public function fixFirst($projectID) + public function fixFirst($projectID, $withLeft = false) { $project = $this->getById($projectID); $burn = $this->dao->select('*')->from(TABLE_BURN)->where('project')->eq($projectID)->andWhere('date')->eq($project->begin)->fetch(); @@ -1561,7 +1561,7 @@ class projectModel extends model $data = fixer::input('post') ->add('project', $projectID) ->add('date', $project->begin) - ->add('left', empty($burn) ? $this->post->estimate : $burn->left) + ->add('left', (empty($burn) or $withLeft) ? $this->post->estimate : $burn->left) ->add('consumed', empty($burn) ? 0 : $burn->consumed) ->get(); if(!is_numeric($data->estimate)) return false; diff --git a/module/project/view/fixfirst.html.php b/module/project/view/fixfirst.html.php index 5761599a62..e9404b196f 100644 --- a/module/project/view/fixfirst.html.php +++ b/module/project/view/fixfirst.html.php @@ -25,4 +25,16 @@ +