diff --git a/module/execution/lang/en.php b/module/execution/lang/en.php index 957daa8586..34e75a84cf 100644 --- a/module/execution/lang/en.php +++ b/module/execution/lang/en.php @@ -31,10 +31,10 @@ $lang->execution->canceledDate = 'CanceledDate'; $lang->execution->begin = 'Begin'; $lang->execution->end = 'End'; $lang->execution->dateRange = 'Duration'; +$lang->execution->realBeganAB = 'Actual Begin'; +$lang->execution->realEndAB = 'Actual End'; $lang->execution->realBegan = 'Actual Begin'; -$lang->execution->realBeganDate = 'Actual Begin'; $lang->execution->realEnd = 'Actual End'; -$lang->execution->realEndDate = 'Actual End'; $lang->execution->to = 'To'; $lang->execution->days = ' Days'; $lang->execution->day = ' Days'; @@ -353,10 +353,10 @@ $lang->execution->unfinishedExecution = "This {$lang->executionCommon} h $lang->execution->unfinishedTask = "[%s] unfinished tasks. "; $lang->execution->unresolvedBug = "[%s] unresolved bugs. "; $lang->execution->projectNotEmpty = 'Project cannot be empty.'; -$lang->execution->realBeganNotEmpty = 'Actual begin should not be empty.'; -$lang->execution->realBeganNotFuture = 'Actual begin should not be a future date.'; -$lang->execution->realEndNotEmpty = 'Actual end should not be empty.'; -$lang->execution->realEndNotFuture = 'Actual end should not be a future date.'; +$lang->execution->realBeganNotEmpty = 'Actual Begin should not be empty.'; +$lang->execution->realBeganNotFuture = 'Actual Begin should be < = today.'; +$lang->execution->realEndNotEmpty = 'Actual End should not be empty.'; +$lang->execution->realEndNotFuture = 'Actual End should be < = today.'; /* Statistics. */ $lang->execution->charts = new stdclass(); diff --git a/module/execution/lang/zh-cn.php b/module/execution/lang/zh-cn.php index 7bb3f39c8d..2e1a39d7ef 100644 --- a/module/execution/lang/zh-cn.php +++ b/module/execution/lang/zh-cn.php @@ -31,10 +31,10 @@ $lang->execution->canceledDate = '取消日期'; $lang->execution->begin = '计划开始'; $lang->execution->end = '计划完成'; $lang->execution->dateRange = '起始日期'; -$lang->execution->realBegan = '实际开始'; -$lang->execution->realEnd = '实际完成'; -$lang->execution->realBeganDate = '实际开始日期'; -$lang->execution->realEndDate = '实际完成日期'; +$lang->execution->realBeganAB = '实际开始'; +$lang->execution->realEndAB = '实际完成'; +$lang->execution->realBegan = '实际开始日期'; +$lang->execution->realEnd = '实际完成日期'; $lang->execution->to = '至'; $lang->execution->days = '可用工作日'; $lang->execution->day = '天'; @@ -354,9 +354,9 @@ $lang->execution->unfinishedTask = "[%s]个未完成的任务,"; $lang->execution->unresolvedBug = "[%s]个未解决的bug,"; $lang->execution->projectNotEmpty = '所属项目不能为空。'; $lang->execution->realBeganNotEmpty = "实际开始不能为空。"; -$lang->execution->realBeganNotFuture = "实际开始不能为未来日期。"; +$lang->execution->realBeganNotFuture = "实际开始不能大于当前日期。"; $lang->execution->realEndNotEmpty = "实际完成不能为空。"; -$lang->execution->realEndNotFuture = "实际完成不能为未来日期。"; +$lang->execution->realEndNotFuture = "实际完成不能大于当前日期。"; /* 统计。*/ diff --git a/module/execution/model.php b/module/execution/model.php index f58916ea63..7011a5aa37 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -704,25 +704,21 @@ class executionModel extends model ->setDefault('lastEditedBy', $this->app->user->account) ->setDefault('lastEditedDate', $now) ->remove('comment')->get(); + + if($execution->realBegan == '') + { + dao::$errors['realBegan'] = $this->lang->execution->realBeganNotEmpty; + return false; + } + if($execution->realBegan > $now) + { + dao::$errors['realBegan'] = $this->lang->execution->realBeganNotFuture; + return false; + } $this->dao->update(TABLE_EXECUTION)->data($execution)->autoCheck()->where('id')->eq((int)$executionID)->exec(); - if(!dao::isError()) - { - if($execution->realBegan == '') - { - dao::$errors['realBegan'] = $this->lang->execution->realBeganNotEmpty; - return false; - } - - if($execution->realBegan > $now) - { - dao::$errors['realBegan'] = $this->lang->execution->realBeganNotFuture; - return false; - } - - return common::createChanges($oldExecution, $execution); - } + if(!dao::isError()) return common::createChanges($oldExecution, $execution); } /** @@ -869,25 +865,26 @@ class executionModel extends model ->setDefault('lastEditedDate', $now) ->remove('comment') ->get(); + + if($execution->realEnd == '') + { + dao::$errors['realEnd'] = $this->lang->execution->realEndNotEmpty; + return false; + } + + if($execution->realEnd > $now) + { + dao::$errors['realEnd'] = $this->lang->execution->realEndNotFuture; + return false; + } $this->dao->update(TABLE_EXECUTION)->data($execution) ->autoCheck() ->where('id')->eq((int)$executionID) ->exec(); + if(!dao::isError()) - { - if($execution->realEnd == '') - { - dao::$errors['realEnd'] = $this->lang->execution->realEndNotEmpty; - return false; - } - - if($execution->realEnd > $now) - { - dao::$errors['realEnd'] = $this->lang->execution->realEndNotFuture; - return false; - } - + { $this->loadModel('score')->create('execution', 'close', $oldExecution); return common::createChanges($oldExecution, $execution); } diff --git a/module/execution/view/close.html.php b/module/execution/view/close.html.php index 895d33a812..11ebcd1ed4 100644 --- a/module/execution/view/close.html.php +++ b/module/execution/view/close.html.php @@ -31,7 +31,7 @@ printExtendFields($execution, 'table');?>