*Finish task #45148.
This commit is contained in:
@@ -351,6 +351,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 = 'Real Began should not be empty.';
|
||||
$lang->execution->realBeganNotFuture = 'Real Began should not be a feture date.';
|
||||
$lang->execution->realEndNotEmpty = 'Real End should not be empty.';
|
||||
$lang->execution->realEndNotFuture = 'Real End should not be a feture date.';
|
||||
|
||||
/* Statistics. */
|
||||
$lang->execution->charts = new stdclass();
|
||||
|
||||
@@ -351,6 +351,11 @@ $lang->execution->unfinishedExecution = "该{$lang->executionCommon}下
|
||||
$lang->execution->unfinishedTask = "[%s]个未完成的任务,";
|
||||
$lang->execution->unresolvedBug = "[%s]个未解决的bug,";
|
||||
$lang->execution->projectNotEmpty = '所属项目不能为空。';
|
||||
$lang->execution->realBeganNotEmpty = "实际开始不能为空。";
|
||||
$lang->execution->realBeganNotFuture = "实际开始不能为未来日期。";
|
||||
$lang->execution->realEndNotEmpty = "实际完成不能为空。";
|
||||
$lang->execution->realEndNotFuture = "实际完成不能为未来日期。";
|
||||
|
||||
|
||||
/* 统计。*/
|
||||
$lang->execution->charts = new stdclass();
|
||||
|
||||
@@ -707,7 +707,22 @@ class executionModel extends model
|
||||
|
||||
$this->dao->update(TABLE_EXECUTION)->data($execution)->autoCheck()->where('id')->eq((int)$executionID)->exec();
|
||||
|
||||
if(!dao::isError()) return common::createChanges($oldExecution, $execution);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -778,6 +793,7 @@ class executionModel extends model
|
||||
$now = helper::now();
|
||||
|
||||
$execution = fixer::input('post')
|
||||
->setDefault('realEnd','')
|
||||
->setDefault('status', 'doing')
|
||||
->setDefault('lastEditedBy', $this->app->user->account)
|
||||
->setDefault('lastEditedDate', $now)
|
||||
@@ -847,7 +863,6 @@ class executionModel extends model
|
||||
|
||||
$execution = fixer::input('post')
|
||||
->setDefault('status', 'closed')
|
||||
->setDefault('realEnd', helper::today())
|
||||
->setDefault('closedBy', $this->app->user->account)
|
||||
->setDefault('closedDate', $now)
|
||||
->setDefault('lastEditedBy', $this->app->user->account)
|
||||
@@ -861,6 +876,18 @@ class executionModel extends model
|
||||
->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);
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<th><?php echo $lang->execution->realEnd;?></th>
|
||||
<td>
|
||||
<div class='w-150px'>
|
||||
<?php echo html::input('realEnd',(!empty($execution->realEnd) && $execution->realEnd != '0000-00-00' ? $execution->realEnd : date('Y-m-d')), "class='form-control form-date'");?>
|
||||
<?php echo html::input('realEnd',(!empty($execution->realEnd) && $execution->realEnd != '0000-00-00' ? $execution->realEnd : date('Y-m-d')), "class='form-control form-date' required");?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<th><?php echo $lang->execution->realBegan;?></th>
|
||||
<td>
|
||||
<div class = 'w-150px'>
|
||||
<?php echo html::input('realBegan',(!empty($execution->realBegan) && $execution->realBegan != '0000-00-00' ? $execution->realBegan : date('Y-m-d')), "class='form-control form-date'");?>
|
||||
<?php echo html::input('realBegan',(!empty($execution->realBegan) && $execution->realBegan != '0000-00-00' ? $execution->realBegan : date('Y-m-d')), "class='form-control form-date' required");?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -177,6 +177,9 @@ $lang->project->createExecution = "There is no {$lang->executionCommon} u
|
||||
$lang->project->unlinkExecutionMember = "The user participated in %s executions such as %s%s. Do you want to remove the user from those executions as well? (The data related to this user will not be deleted.)";
|
||||
$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 = 'Real End should not be empty.';
|
||||
$lang->project->realEndNotFuture = 'Real End should not be a feture date.';
|
||||
|
||||
$lang->project->tenThousand = '';
|
||||
|
||||
$lang->project->unitList['CNY'] = 'RMB';
|
||||
|
||||
@@ -177,6 +177,9 @@ $lang->project->createExecution = "该项目下没有{$lang->executionCom
|
||||
$lang->project->unlinkExecutionMember = "该用户参与了%s%s%s个{$lang->execution->common},是否同时将其移除?(该用户所产生的数据不会受影响。)";
|
||||
$lang->project->unlinkExecutionMembers = "移除的团队成员还参与了项目下的执行,是否同步从执行团队中移除?";
|
||||
|
||||
$lang->project->realEndNotEmpty = "实际完成不能为空。";
|
||||
$lang->project->realEndNotFuture = "实际完成不能为未来日期。";
|
||||
|
||||
$lang->project->tenThousand = '万';
|
||||
|
||||
$lang->project->unitList['CNY'] = '人民币';
|
||||
|
||||
@@ -1206,6 +1206,7 @@ class projectModel extends model
|
||||
$now = helper::now();
|
||||
|
||||
$project = fixer::input('post')
|
||||
->setDefault('realEnd','')
|
||||
->setDefault('status', 'doing')
|
||||
->setDefault('lastEditedBy', $this->app->user->account)
|
||||
->setDefault('lastEditedDate', $now)
|
||||
@@ -1288,6 +1289,18 @@ class projectModel extends model
|
||||
->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);
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<th><?php echo $lang->project->realEnd;?></th>
|
||||
<td>
|
||||
<div class='w-150px'>
|
||||
<?php echo html::input('realEnd',(!empty($project->realEnd) && $project->realEnd != '0000-00-00' ? $project->realEnd : date('Y-m-d')), "class='form-control form-date'");?>
|
||||
<?php echo html::input('realEnd',(!empty($project->realEnd) && $project->realEnd != '0000-00-00' ? $project->realEnd : date('Y-m-d')), "class='form-control form-date' required");?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user