This commit is contained in:
zhouxudong
2022-06-29 09:00:33 +00:00
parent 62fc297642
commit 461235a048
10 changed files with 66 additions and 29 deletions
+3 -2
View File
@@ -47,6 +47,7 @@ $lang->program->realDuration = 'RealDuration';
$lang->program->openedVersion = 'OpenedVersion';
$lang->program->lastEditedBy = 'LastEditedBy';
$lang->program->lastEditedDate = 'LastEditedDate';
$lang->program->childProgram = 'Child Program';
/* Actions. */
$lang->program->common = 'Program';
@@ -101,8 +102,8 @@ $lang->program->tips = 'If a parent program is selected, the produ
$lang->program->confirmBatchUnlink = "Do you want to batch unlink these stakeholders?";
$lang->program->beginLetterParent = 'The start date of the program "%s" should be ≥ the start date of the parent program "%s": %s.';
$lang->program->endGreaterParent = 'The finish date of the program "%s" should be ≤ the finish date of the parent program "%s": %s.';
$lang->program->beginGreateChild = 'The start date of the parent program "%s" should be ≤the minimum start time of the subprogram "%s": %s.';
$lang->program->endLetterChild = 'The finish time of the parent program "%s" should be ≥ the maximum finish time of the subprogram "%s": %s.';
$lang->program->beginGreateChild = 'The start date of the parent program "%s" should be ≤the minimum start time of the %s "%s": %s.';
$lang->program->endLetterChild = 'The finish time of the parent program "%s" should be ≥ the maximum finish time of the %s "%s": %s.';
$lang->program->closeErrorMessage = 'There are subprograms or projects that are not closed';
$lang->program->hasChildren = 'It has child programs or projects. You cannot delete it.';
$lang->program->hasProduct = 'It has products. You cannot delete it.';
+3 -2
View File
@@ -47,6 +47,7 @@ $lang->program->realDuration = 'RealDuration';
$lang->program->openedVersion = 'OpenedVersion';
$lang->program->lastEditedBy = 'LastEditedBy';
$lang->program->lastEditedDate = 'LastEditedDate';
$lang->program->childProgram = 'Child Program';
/* Actions. */
$lang->program->common = 'Program';
@@ -101,8 +102,8 @@ $lang->program->tips = 'If a parent program is selected, the produ
$lang->program->confirmBatchUnlink = "Do you want to batch unlink these stakeholders?";
$lang->program->beginLetterParent = 'The start date of the program "%s" should be ≥ the start date of the parent program "%s": %s.';
$lang->program->endGreaterParent = 'The finish date of the program "%s" should be ≤ the finish date of the parent program "%s": %s.';
$lang->program->beginGreateChild = 'The start date of the parent program "%s" should be ≤the minimum start time of the subprogram "%s": %s.';
$lang->program->endLetterChild = 'The finish time of the parent program "%s" should be ≥ the maximum finish time of the subprogram "%s": %s.';
$lang->program->beginGreateChild = 'The start date of the parent program "%s" should be ≤the minimum start time of the %s "%s": %s.';
$lang->program->endLetterChild = 'The finish time of the parent program "%s" should be ≥ the maximum finish time of the %s "%s": %s.';
$lang->program->closeErrorMessage = 'There are subprograms or projects that are not closed';
$lang->program->hasChildren = 'The program has a child program or the project exists and can not be deleted.';
$lang->program->hasProduct = 'The program has products exist and can not be deleted.';
+3 -2
View File
@@ -47,6 +47,7 @@ $lang->program->realDuration = 'RealDuration';
$lang->program->openedVersion = 'OpenedVersion';
$lang->program->lastEditedBy = 'LastEditedBy';
$lang->program->lastEditedDate = 'LastEditedDate';
$lang->program->childProgram = 'sous-programme';
/* Actions. */
$lang->program->common = 'Program';
@@ -101,8 +102,8 @@ $lang->program->tips = 'If a parent program is selected, the produ
$lang->program->confirmBatchUnlink = "Do you want to batch unlink these stakeholders?";
$lang->program->beginLetterParent = 'La date de début du programme "%s" doit être ≥ à la date de début du programme parent "%s" : %s.';
$lang->program->endGreaterParent = 'La date de fin du programme "%s" doit être ≤ à la date de fin du programme parent "%s" : %s.';
$lang->program->beginGreateChild = 'La date de début du programme parent "%s" doit être ≤ à la date de début minimum du sous-programme "%s" : %s.';
$lang->program->endLetterChild = 'Le temps de fin du programme parent "%s" doit être ≥ au temps de fin maximum du sous-programme "%s" : %s.';
$lang->program->beginGreateChild = 'La date de début du programme parent "%s" doit être ≤ à la date de début minimum du %s "%s" : %s.';
$lang->program->endLetterChild = 'Le temps de fin du programme parent "%s" doit être ≥ au temps de fin maximum du %s "%s" : %s.';
$lang->program->closeErrorMessage = 'There are subprograms or projects that are not closed';
$lang->program->hasChildren = 'It has child programs or projects. You cannot delete it.';
$lang->program->hasProduct = 'It has products. You cannot delete it.';
+3 -2
View File
@@ -47,6 +47,7 @@ $lang->program->realDuration = '实际周期天数';
$lang->program->openedVersion = '创建版本';
$lang->program->lastEditedBy = '最后编辑人';
$lang->program->lastEditedDate = '最后编辑日期';
$lang->program->childProgram = '子项目集';
/* Actions. */
$lang->program->common = '项目集';
@@ -101,8 +102,8 @@ $lang->program->tips = '选择了父项目集,则可关联该父
$lang->program->confirmBatchUnlink = "您确定要批量移除这些干系人吗?";
$lang->program->beginLetterParent = '项目集“%s”开始日期应大于等于父项目集“%s”的开始日期:%s。';
$lang->program->endGreaterParent = '项目集“%s”完成日期应小于等于父项目集“%s”的完成日期:%s。';
$lang->program->beginGreateChild = '父项目集“%s”的开始日期应小于等于子项目集“%s”的最小开始时间:%s。';
$lang->program->endLetterChild = '父项目集“%s”的完成时间应大于等于子项目集“%s”的最大完成时间:%s。';
$lang->program->beginGreateChild = '父项目集“%s”的开始日期应小于等于%s“%s”的最小开始时间:%s。';
$lang->program->endLetterChild = '父项目集“%s”的完成时间应大于等于%s“%s”的最大完成时间:%s。';
$lang->program->closeErrorMessage = '存在子项目集或项目为未关闭状态';
$lang->program->hasChildren = '该项目集有子项目集或项目存在,不能删除。';
$lang->program->hasProduct = '该项目集有产品存在,不能删除。';
+7 -4
View File
@@ -772,6 +772,7 @@ class programModel extends model
*/
public function update($programID)
{
$this->app->loadLang('project');
$programID = (int)$programID;
$oldProgram = $this->dao->findById($programID)->from(TABLE_PROGRAM)->fetch();
@@ -799,11 +800,13 @@ class programModel extends model
if($children > 0)
{
$minChildBegin = $this->dao->select('name, min(begin) as minBegin')->from(TABLE_PROGRAM)->where('id')->ne($programID)->andWhere('deleted')->eq(0)->andWhere('path')->like("%,{$programID},%")->fetch();
$maxChildEnd = $this->dao->select('name, max(end) as maxEnd')->from(TABLE_PROGRAM)->where('id')->ne($programID)->andWhere('deleted')->eq(0)->andWhere('path')->like("%,{$programID},%")->andWhere('end')->ne('0000-00-00')->fetch();
$minChildBegin = $this->dao->select('name, type, begin as minBegin')->from(TABLE_PROGRAM)->where('id')->ne($programID)->andWhere('deleted')->eq(0)->andWhere('path')->like("%,{$programID},%")->orderBy('begin_asc')->fetch();
$maxChildEnd = $this->dao->select('name, type, end as maxEnd')->from(TABLE_PROGRAM)->where('id')->ne($programID)->andWhere('deleted')->eq(0)->andWhere('path')->like("%,{$programID},%")->andWhere('end')->ne('0000-00-00')->orderBy('end_desc')->fetch();
if($minChildBegin and $program->begin > $minChildBegin) dao::$errors['begin'] = sprintf($this->lang->program->beginGreateChild, $program->name, $minChildBegin->name, $minChildBegin->minBegin);
if($maxChildEnd and $program->end < $maxChildEnd and $this->post->delta != 999) dao::$errors['end'] = sprintf($this->lang->program->endLetterChild, $program->name, $maxChildEnd->name, $maxChildEnd->maxEnd);
$minChildType = ($minChildBegin->type == 'project') ? $this->lang->project->common : $this->lang->program->childProgram;
$maxChildType = ($maxChildEnd->type == 'project') ? $this->lang->project->common : $this->lang->program->childProgram;
if($minChildBegin and $program->begin > $minChildBegin->minBegin) dao::$errors['begin'] = sprintf($this->lang->program->beginGreateChild, $program->name, $minChildType, $minChildBegin->name, $minChildBegin->minBegin);
if($maxChildEnd and $program->end < $maxChildEnd->maxEnd and $this->post->delta != 999) dao::$errors['end'] = sprintf($this->lang->program->endLetterChild, $program->name, $maxChildType, $maxChildEnd->name, $maxChildEnd->maxEnd);
if(dao::isError()) return false;
}