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');?> - execution->realEndDate;?> + execution->realEnd;?>
realEnd) && $execution->realEnd != '0000-00-00' ? $execution->realEnd : date('Y-m-d')), "class='form-control form-date' required");?> diff --git a/module/execution/view/view.html.php b/module/execution/view/view.html.php index 4b1a0b8932..99bc17355d 100644 --- a/module/execution/view/view.html.php +++ b/module/execution/view/view.html.php @@ -238,13 +238,13 @@ execution->begin;?> begin;?> - execution->realBegan;?> + execution->realBeganAB;?> realBegan == '0000-00-00' ? '' : $execution->realBegan;?> execution->end;?> end;?> - execution->realEnd;?> + execution->realEndAB;?> realEnd == '0000-00-00' ? '' : $execution->realEnd;?> diff --git a/module/project/lang/en.php b/module/project/lang/en.php index 814f590d48..95e4c82b59 100644 --- a/module/project/lang/en.php +++ b/module/project/lang/en.php @@ -108,10 +108,10 @@ $lang->project->surplus = 'Left'; $lang->project->progress = 'Progress'; $lang->project->dateRange = 'Duration'; $lang->project->to = ' to '; -$lang->project->realEnd = 'Actual End'; +$lang->project->realBeganAB = 'Actual Begin'; +$lang->project->realEndAB = 'Actual End'; $lang->project->realBegan = 'Actual Begin'; -$lang->project->realEndDate = 'Actual End'; -$lang->project->realBeganDate = 'Actual Begin'; +$lang->project->realEnd = 'Actual End'; $lang->project->bygrid = 'Kanban'; $lang->project->bylist = 'List'; $lang->project->bycard = 'Card'; @@ -180,7 +180,7 @@ $lang->project->unlinkExecutionMember = "The user participated in %s executions $lang->project->unlinkExecutionMembers = "The team members you are removing are also in the execution team of this project. Do you want to remove them from the execution team too?"; $lang->project->realEndNotEmpty = 'Actual End should not be empty.'; -$lang->project->realEndNotFuture = 'Actual End should not be a future date.'; +$lang->project->realEndNotFuture = 'Actual End should be < = today.'; $lang->project->tenThousand = ''; diff --git a/module/project/lang/zh-cn.php b/module/project/lang/zh-cn.php index 7e3d681902..ddc6701344 100644 --- a/module/project/lang/zh-cn.php +++ b/module/project/lang/zh-cn.php @@ -108,10 +108,10 @@ $lang->project->surplus = '剩余'; $lang->project->progress = '进度'; $lang->project->dateRange = '起止日期'; $lang->project->to = '至'; -$lang->project->realEnd = '实际完成'; -$lang->project->realBegan = '实际开始'; -$lang->project->realEndDate = '实际完成日期'; -$lang->project->realBeganDate = '实际开始日期'; +$lang->project->realBeganAB = '实际开始'; +$lang->project->realEndAB = '实际完成'; +$lang->project->realBegan = '实际开始日期'; +$lang->project->realEnd = '实际完成日期'; $lang->project->bygrid = '看板'; $lang->project->bylist = '列表'; $lang->project->bycard = '卡片'; @@ -180,7 +180,7 @@ $lang->project->unlinkExecutionMember = "该用户参与了%s%s%s个{$lang->exe $lang->project->unlinkExecutionMembers = "移除的团队成员还参与了项目下的执行,是否同步从执行团队中移除?"; $lang->project->realEndNotEmpty = "实际完成不能为空。"; -$lang->project->realEndNotFuture = "实际完成不能为未来日期。"; +$lang->project->realEndNotFuture = "实际完成不能大于当前日期。"; $lang->project->tenThousand = '万'; diff --git a/module/project/model.php b/module/project/model.php index 1f4e3cb979..062183813c 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1283,24 +1283,24 @@ class projectModel extends model ->remove('comment') ->get(); + if($project->realEnd == '') + { + dao::$errors['realEnd'] = $this->lang->project->realEndNotEmpty; + return false; + } + if($project->realEnd > $now) + { + dao::$errors['realEnd'] = $this->lang->project->realEndNotFuture; + return false; + } + $this->dao->update(TABLE_PROJECT)->data($project) ->autoCheck() ->where('id')->eq((int)$projectID) ->exec(); + if(!dao::isError()) - { - if($project->realEnd == '') - { - dao::$errors['realEnd'] = $this->lang->project->realEndNotEmpty; - return false; - } - - if($project->realEnd > $now) - { - dao::$errors['realEnd'] = $this->lang->project->realEndNotFuture; - return false; - } - + { $this->loadModel('score')->create('project', 'close', $oldProject); return common::createChanges($oldProject, $project); } diff --git a/module/project/view/close.html.php b/module/project/view/close.html.php index 2b9336051f..0fd52dabdd 100644 --- a/module/project/view/close.html.php +++ b/module/project/view/close.html.php @@ -31,7 +31,7 @@ printExtendFields($project, 'table');?> - project->realEndDate;?> + project->realEnd;?>
realEnd) && $project->realEnd != '0000-00-00' ? $project->realEnd : date('Y-m-d')), "class='form-control form-date' required");?> diff --git a/module/project/view/view.html.php b/module/project/view/view.html.php index 9972d2dec9..7c10b7262d 100644 --- a/module/project/view/view.html.php +++ b/module/project/view/view.html.php @@ -178,13 +178,13 @@ project->begin;?> begin;?> - project->realBegan;?> + project->realBeganAB;?> realBegan == '0000-00-00' ? '' : $project->realBegan;?> project->end;?> end;?> - project->realEnd;?> + project->realEndAB;?> realEnd == '0000-00-00' ? '' : $project->realEnd;?>