From c673bc92deef412c8a4d2b83f73284aa4b76cfd9 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 11 May 2017 14:30:28 +0800 Subject: [PATCH] * adjust for fix first day. --- module/project/control.php | 4 ++-- module/project/lang/en.php | 2 +- module/project/lang/zh-cn.php | 2 +- module/project/model.php | 8 +++++--- module/project/view/fixfirst.html.php | 15 ++------------- 5 files changed, 11 insertions(+), 20 deletions(-) diff --git a/module/project/control.php b/module/project/control.php index 5db2709531..5f968ac98e 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -812,11 +812,11 @@ class project extends control * @access public * @return void */ - public function fixFirst($projectID, $withLeft = false) + public function fixFirst($projectID) { if($_POST) { - $this->project->fixFirst($projectID, $withLeft); + $this->project->fixFirst($projectID); die(js::reload('parent.parent')); } diff --git a/module/project/lang/en.php b/module/project/lang/en.php index 63f23eafce..0aec04f2e9 100644 --- a/module/project/lang/en.php +++ b/module/project/lang/en.php @@ -207,7 +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->fixFirstWithLeft = 'Modify the left time'; /* 统计。*/ $lang->project->charts = new stdclass(); diff --git a/module/project/lang/zh-cn.php b/module/project/lang/zh-cn.php index 07b2bed9aa..0c529ba719 100644 --- a/module/project/lang/zh-cn.php +++ b/module/project/lang/zh-cn.php @@ -207,7 +207,7 @@ $lang->project->goback = "返回任务列表"; $lang->project->noweekend = '去除周末'; $lang->project->withweekend = '显示周末'; $lang->project->interval = '间隔'; -$lang->project->fixFirstWithLeft = '是否将首天剩余工时也设置为该值?'; +$lang->project->fixFirstWithLeft = '修改剩余工时'; /* 统计。*/ $lang->project->charts = new stdclass(); diff --git a/module/project/model.php b/module/project/model.php index db3b1b83f9..dd3f7af422 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1557,16 +1557,18 @@ class projectModel extends model * @access public * @return void */ - public function fixFirst($projectID, $withLeft = false) + public function fixFirst($projectID) { - $project = $this->getById($projectID); - $burn = $this->dao->select('*')->from(TABLE_BURN)->where('project')->eq($projectID)->andWhere('date')->eq($project->begin)->fetch(); + $project = $this->getById($projectID); + $burn = $this->dao->select('*')->from(TABLE_BURN)->where('project')->eq($projectID)->andWhere('date')->eq($project->begin)->fetch(); + $withLeft = $this->post->withLeft ? $this->post->withLeft : 0; $data = fixer::input('post') ->add('project', $projectID) ->add('date', $project->begin) ->add('left', $withLeft ? $this->post->estimate : $burn->left) ->add('consumed', empty($burn) ? 0 : $burn->consumed) + ->remove('withLeft') ->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 e9404b196f..d31f4c4cde 100644 --- a/module/project/view/fixfirst.html.php +++ b/module/project/view/fixfirst.html.php @@ -18,23 +18,12 @@
begin?> estimate) ? $firstBurn->estimate : (!empty($firstBurn->left) ? $firstBurn->left : ''), "class='form-control' placeholder='{$lang->project->placeholder->totalLeft}' autocomplete='off'")?> - project->totalEstimate . $project->totalEstimate . $lang->project->workHour. ')'?> +
+
project->totalEstimate . $project->totalEstimate . $lang->project->workHour;?>
-