Merge branch 'sprint/175_zhengrunyu_45150' into 'master'

*Finish task #45150.

See merge request easycorp/zentaopms!688
This commit is contained in:
孙广明
2021-12-01 02:43:19 +00:00
7 changed files with 33 additions and 52 deletions
+6 -2
View File
@@ -17,8 +17,12 @@ $app->loadLang('task');
$config->execution->task = new stdclass();
$config->execution->create = new stdclass();
$config->execution->edit = new stdclass();
$config->execution->create->requiredFields = 'name,code,begin,end';
$config->execution->edit->requiredFields = 'name,code,begin,end';
$config->execution->start = new stdclass();
$config->execution->close = new stdclass();
$config->execution->create->requiredFields = 'name,code,begin,end';
$config->execution->edit->requiredFields = 'name,code,begin,end';
$config->execution->start->requiredFields = 'realBegan';
$config->execution->close->requiredFields = 'realEnd';
$config->execution->customBatchEditFields = 'days,type,teamname,status,desc,PO,QD,PM,RD';
-4
View File
@@ -355,10 +355,6 @@ $lang->execution->unfinishedTask = "[%s] unfinished tasks. ";
$lang->execution->unresolvedBug = "[%s] unresolved bugs. ";
$lang->execution->projectNotEmpty = 'Project cannot be empty.';
$lang->execution->confirmStoryToTask = $lang->SRCommon . '%s are converted to tasks in the current. Do you want to convert them anyways?';
$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();
-4
View File
@@ -356,10 +356,6 @@ $lang->execution->unfinishedTask = "[%s]个未完成的任务,";
$lang->execution->unresolvedBug = "[%s]个未解决的bug,";
$lang->execution->projectNotEmpty = '所属项目不能为空。';
$lang->execution->confirmStoryToTask = '%s' . $lang->SRCommon . '已经在当前' . $lang->execution->common . '中转了任务,请确认是否重复转任务。';
$lang->execution->realBeganNotEmpty = "实际开始不能为空。";
$lang->execution->realBeganNotFuture = "实际开始不能大于当前日期。";
$lang->execution->realEndNotEmpty = "实际完成不能为空。";
$lang->execution->realEndNotFuture = "实际完成不能大于当前日期。";
/* 统计。*/
$lang->execution->charts = new stdclass();
+12 -26
View File
@@ -715,20 +715,15 @@ class executionModel extends model
->setDefault('status', 'doing')
->setDefault('lastEditedBy', $this->app->user->account)
->setDefault('lastEditedDate', $now)
->remove('comment')->get();
->remove('comment')
->get();
if($execution->realBegan == '')
{
dao::$errors['realBegan'] = $this->lang->execution->realBeganNotEmpty;
return false;
}
if($execution->realBegan > helper::today())
{
dao::$errors['realBegan'] = $this->lang->execution->realBeganNotFuture;
return false;
}
$this->dao->update(TABLE_EXECUTION)->data($execution)->autoCheck()->where('id')->eq((int)$executionID)->exec();
$this->dao->update(TABLE_EXECUTION)->data($execution)
->autoCheck()
->check($this->config->execution->start->requiredFields, 'notempty')
->checkIF($execution->realBegan != '', 'realBegan', 'le', helper::today())
->where('id')->eq((int)$executionID)
->exec();
if(!dao::isError()) return common::createChanges($oldExecution, $execution);
}
@@ -868,7 +863,7 @@ class executionModel extends model
{
$oldExecution = $this->getById($executionID);
$now = helper::now();
$execution = fixer::input('post')
->setDefault('status', 'closed')
->setDefault('closedBy', $this->app->user->account)
@@ -878,20 +873,11 @@ class executionModel extends model
->remove('comment')
->get();
if($execution->realEnd == '')
{
dao::$errors['realEnd'] = $this->lang->execution->realEndNotEmpty;
return false;
}
if($execution->realEnd > helper::today())
{
dao::$errors['realEnd'] = $this->lang->execution->realEndNotFuture;
return false;
}
$this->dao->update(TABLE_EXECUTION)->data($execution)
->autoCheck()
->check($this->config->execution->close->requiredFields,'notempty')
->checkIF($execution->realEnd != '', 'realEnd', 'le', helper::today())
->checkIF($execution->realEnd != '', 'realEnd', 'ge', $oldExecution->realBegan)
->where('id')->eq((int)$executionID)
->exec();