* Finish task #63581.

This commit is contained in:
zhouxudong
2022-08-08 14:37:33 +00:00
parent abc59ed7aa
commit ef847f1169
15 changed files with 110 additions and 54 deletions
+21
View File
@@ -704,6 +704,27 @@ class program extends control
echo $html;
}
/**
* ajax get childish information.
*
* @param int $programID
* @access public
* @return void
*/
public function ajaxGetChildInfo($programID)
{
$children = $this->program->getChildren($programID);
if($children > 0)
{
$minChildBegin = $this->dao->select('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('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();
}
$data = array('minChildBegin' => $minChildBegin->minBegin, 'maxChildEnd' => $maxChildEnd->maxEnd);
echo json_encode($data);
}
/**
* Update program order.
*
+62 -29
View File
@@ -322,6 +322,36 @@ function setBudgetTipsAndAclList(parentID)
outOfDateTip();
}
/**
* compare childlish date.
*
* @access public
* @return void
*/
function compareChildDate()
{
var end = $('#end').val();
var begin = $('#begin').val();
if(end.length > 0 && begin.length > 0)
{
var programEnd = new Date(end);
var programBegin = new Date(begin);
$.get(createLink('program', 'ajaxGetChildInfo', 'programID=' + programID), function(data)
{
var childInfo = JSON.parse(data);
var childBegin = new Date(childInfo.minChildBegin);
var childEnd = new Date(childInfo.maxChildEnd);
if(programBegin > childBegin) dateTip = "<span id='dateTip' class='text-remind'>" + beginGreateChild + childInfo.minChildBegin + "</span>";
if(programEnd < childEnd) dateTip = "<span id='dateTip' class='text-remind'>" + endLetterChild + childInfo.maxChildEnd + "</span>";
if((programEnd < childBegin && programEnd < childEnd) || (programBegin > childBegin && programBegin > childEnd) || (programBegin > childBegin && programEnd < childEnd)) dateTip = "<span id='dateTip' class='text-remind'>" + dateLetterChild + childInfo.minChildBegin + "~" + childInfo.maxChildEnd + "</span>";
if($('#dateTip').length > 0) $('#dateTip').remove();
$('#dateBox').after(dateTip);
});
}
}
/**
* The date is out of the range of the parent project set, and a prompt is given.
*
@@ -330,37 +360,40 @@ function setBudgetTipsAndAclList(parentID)
*/
function outOfDateTip()
{
var end = $('#end').val();
var begin = $('#begin').val();
if(end.length > 0 && begin.length > 0)
var end = $('#end').val();
var begin = $('#begin').val();
if(end.length > 0 && begin.length > 0)
{
var selectedProgramID = $('#parent').val();
var budget = $('#budget').val();
var programEnd = new Date(end);
var programBegin = new Date(begin);
if(selectedProgramID == 0)
{
var selectedProgramID = $('#parent').val();
var budget = $('#budget').val();
if(selectedProgramID == 0)
{
if($('#dateTip').length > 0) $('#dateTip').remove();
return false;
}
if(typeof(programID) == 'undefined') programID = 0;
$.get(createLink('project', 'ajaxGetParentInfo', 'objectType=program&objectID=' + programID + "&selectedProgramID=" + selectedProgramID), function(data)
{
var data = JSON.parse(data);
var parentEnd = new Date(data.selectedProgramEnd);
var parentBegin = new Date(data.selectedProgramBegin);
var objectEnd = new Date(end);
var objectBegin = new Date(begin);
var dateTip = "";
if(objectBegin < parentBegin && objectEnd <= parentEnd) dateTip = "<span id='dateTip' class='text-remind'>" + beginLetterParent + data.selectedProgramBegin + "</span>";
if(objectBegin >= parentBegin && objectEnd > parentEnd) dateTip = "<span id='dateTip' class='text-remind'>" + endGreaterParent + data.selectedProgramEnd + "</span>";
if((objectBegin < parentBegin && objectEnd > parentEnd) || (objectEnd <= parentBegin && objectBegin <= parentBegin) || (objectBegin >= parentEnd && objectEnd >= parentEnd)) dateTip = "<span id='dateTip' class='text-remind'>" + dataExceedParent + data.selectedProgramBegin + "~" + data.selectedProgramEnd + "</span>";
if($('#dateTip').length > 0) $('#dateTip').remove();
console.log(dateTip);
$('#dateBox').after(dateTip);
});
if($('#dateTip').length > 0) $('#dateTip').remove();
compareChildDate();
return false;
}
if(typeof(programID) == 'undefined') programID = 0;
$.get(createLink('project', 'ajaxGetParentInfo', 'objectType=program&objectID=' + programID + "&selectedProgramID=" + selectedProgramID), function(data)
{
console.log('789');
var data = JSON.parse(data);
var parentEnd = new Date(data.selectedProgramEnd);
var parentBegin = new Date(data.selectedProgramBegin);
var dateTip = "";
if(programBegin < parentBegin && programEnd <= parentEnd) dateTip = "<span id='dateTip' class='text-remind'>" + beginLetterParent + data.selectedProgramBegin + "</span>";
if(programBegin >= parentBegin && programEnd > parentEnd) dateTip = "<span id='dateTip' class='text-remind'>" + endGreaterParent + data.selectedProgramEnd + "</span>";
if((programBegin < parentBegin && programEnd > parentEnd) || (projectEnd <= parentBegin && projectBegin <= parentBeg in) || (projectBegin >= parentEnd && projectEnd >= parentEnd)) dateTip = "<span id='dateTip' class='text-remind'>" + dateExceedParent + data.selectedProgramBegin + "~" + data.selectedProgramEnd + "</span>";
if($('#dateTip').length > 0) $('#dateTip').remove();
$('#dateBox').after(dateTip);
});
compareChildDate();
}
}
/**
+2 -2
View File
@@ -102,10 +102,10 @@ $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 was < the start date of the parent program:';
$lang->program->endGreaterParent = 'The finish date of the program was > the finish date of the parent program:';
$lang->program->dataExceedParent = 'The start and finish date of the program was > the start and finish date of the parent program:';
$lang->program->dateExceedParent = 'The start and finish date of the program was > the start and finish date of the parent program:';
$lang->program->beginGreateChild = 'The start date of the program was > the minimum start date of the subprogram or project:';
$lang->program->endLetterChild = 'The finish date of the program was < the maximum finish date of the subprogram or project:';
$lang->program->dataLetterChild = 'The start and finish date of the program no longer include the date scope of the subprogram or project:';
$lang->program->dateLetterChild = 'The start and finish date of the program no longer include the date scope of the subprogram or project:';
$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.';
+2 -2
View File
@@ -102,10 +102,10 @@ $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 was < the start date of the parent program:';
$lang->program->endGreaterParent = 'The finish date of the program was > the finish date of the parent program:';
$lang->program->dataExceedParent = 'The start and finish date of the program was > the start and finish date of the parent program:';
$lang->program->dateExceedParent = 'The start and finish date of the program was > the start and finish date of the parent program:';
$lang->program->beginGreateChild = 'The start date of the program was > the minimum start date of the subprogram or project:';
$lang->program->endLetterChild = 'The finish date of the program was < the maximum finish date of the subprogram or project:';
$lang->program->dataLetterChild = 'The start and finish date of the program no longer include the date scope of the subprogram or project:';
$lang->program->dateLetterChild = 'The start and finish date of the program no longer include the date scope of the subprogram or project:';
$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.';
+2 -2
View File
@@ -102,10 +102,10 @@ $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 était < à la date de début du programme parent:';
$lang->program->endGreaterParent = 'La date de fin du programme était > à la date de fin du programme parent:';
$lang->program->dataExceedParent = 'La date de début et de fin du programme était > à la date de début et de fin du programme parent:';
$lang->program->dateExceedParent = 'La date de début et de fin du programme était > à la date de début et de fin du programme parent:';
$lang->program->beginGreateChild = 'La date de début du programme était > à la date minimale de début du sous-programme ou du projet:';
$lang->program->endLetterChild = 'La date de fin du programme était < à la de fin maximale du sous-programme ou du projet:';
$lang->program->dataLetterChild = 'La date de début et de fin du programme ne correspond plus la date du sous-programme ou du projet:';
$lang->program->dateLetterChild = 'La date de début et de fin du programme ne correspond plus la date du sous-programme ou du projet:';
$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.';
+2 -2
View File
@@ -102,10 +102,10 @@ $lang->program->tips = '选择了父项目集,则可关联该父
$lang->program->confirmBatchUnlink = "您确定要批量移除这些干系人吗?";
$lang->program->beginLetterParent = '项目集的开始日期已小于父项目集的开始日期:';
$lang->program->endGreaterParent = '项目集的完成日期已大于父项目集的完成日期:';
$lang->program->dataExceedParent = '项目集的起止日期已超出父项目集的起止日期';
$lang->program->dateExceedParent = '项目集的起止日期已超出父项目集的起止日期';
$lang->program->beginGreateChild = '项目集的开始日期已大于子项目集或项目的最小开始日期:';
$lang->program->endLetterChild = '项目集的完成日期已小于子项目集或项目的最大完成日期:';
$lang->program->dataLetterChild = '项目集的起止日期已不包含子项目集或项目的日期范围';
$lang->program->dateExceedChild = '项目集的起止日期已不包含子项目集或项目的日期范围';
$lang->program->closeErrorMessage = '存在子项目集或项目为未关闭状态';
$lang->program->hasChildren = '该项目集有子项目集或项目存在,不能删除。';
$lang->program->hasProduct = '该项目集有产品存在,不能删除。';
+1 -1
View File
@@ -44,7 +44,7 @@
<?php js::set('parentBudget', $lang->program->parentBudget);?>
<?php js::set('beginLetterParent', $lang->program->beginLetterParent);?>
<?php js::set('endGreaterParent', $lang->program->endGreaterParent);?>
<?php js::set('dataExceedParent', $lang->program->dataExceedParent);?>
<?php js::set('dateExceedParent', $lang->program->dateExceedParent);?>
<?php $aclList = $parentProgram ? $lang->program->subAclList : $lang->program->aclList;?>
<?php $requiredFields = $config->program->create->requiredFields;?>
<div id='mainContent' class='main-content'>
+4 -1
View File
@@ -30,7 +30,10 @@
<?php js::set('parentBudget', $lang->program->parentBudget);?>
<?php js::set('beginLetterParent', $lang->program->beginLetterParent);?>
<?php js::set('endGreaterParent', $lang->program->endGreaterParent);?>
<?php js::set('dataExceedParent', $lang->program->dataExceedParent);?>
<?php js::set('dateExceedParent', $lang->program->dateExceedParent);?>
<?php js::set('beginGreateChild', $lang->program->beginGreateChild);?>
<?php js::set('endLetterChild', $lang->program->endLetterChild);?>
<?php js::set('dateExceedChild', $lang->program->dateExceedChild);?>
<?php $aclList = $program->parent ? $lang->program->subAclList : $lang->program->aclList;?>
<?php $requiredFields = $config->program->edit->requiredFields;?>
<div id='mainContent' class='main-content'>
+8 -9
View File
@@ -376,18 +376,17 @@ function outOfDateTip()
if(typeof(projectID) == 'undefined') projectID = 0;
$.get(createLink('project', 'ajaxGetParentInfo', 'objectType=project&objectID=' + projectID + "&selectedProgramID=" + selectedProgramID), function(data)
{
var data = JSON.parse(data);
var parentEnd = new Date(data.selectedProgramEnd);
var parentBegin = new Date(data.selectedProgramBegin);
var objectEnd = new Date(end);
var objectBegin = new Date(begin);
var data = JSON.parse(data);
var parentEnd = new Date(data.selectedProgramEnd);
var parentBegin = new Date(data.selectedProgramBegin);
var projectEnd = new Date(end);
var projectBegin = new Date(begin);
var dateTip = "";
if(objectBegin < parentBegin && objectEnd <= parentEnd) dateTip = "<span id='dateTip' class='text-remind'>" + beginLetterParent + data.selectedProgramBegin + "</span>";
if(objectBegin >= parentBegin && objectEnd > parentEnd) dateTip = "<span id='dateTip' class='text-remind'>" + endGreaterParent + data.selectedProgramEnd + "</span>";
if((objectBegin < parentBegin && objectEnd > parentEnd) || (objectEnd <= parentBegin && objectBegin <= parentBegin) || (objectBegin >= parentEnd && objectEnd >= parentEnd)) dateTip = "<span id='dateTip' class='text-remind'>" + dataExceedParent + data.selectedProgramBegin + "~" + data.selectedProgramEnd + "</span>";
if(projectBegin < parentBegin && projectEnd <= parentEnd) dateTip = "<span id='dateTip' class='text-remind'>" + beginLetterParent + data.selectedProgramBegin + "</span>";
if(projectBegin >= parentBegin && projectEnd > parentEnd) dateTip = "<span id='dateTip' class='text-remind'>" + endGreaterParent + data.selectedProgramEnd + "</span>";
if((projectBegin < parentBegin && projectEnd > parentEnd) || (projectEnd <= parentBegin && projectBegin <= parentBegin) || (projectBegin >= parentEnd && projectEnd >= parentEnd)) dateTip = "<span id='dateTip' class='text-remind'>" + dateExceedParent + data.selectedProgramBegin + "~" + data.selectedProgramEnd + "</span>";
if($('#dateTip').length > 0) $('#dateTip').remove();
console.log(dateTip);
$('#dateBox').after(dateTip);
});
}
+1 -1
View File
@@ -322,7 +322,7 @@ $lang->project->parentBeginEnd = "Parent begin&end date: %s ~ %s";
$lang->project->parentBudget = "The budget of the parent project: ";
$lang->project->beginLetterParent = "The start date of the project was < the minimum start date of the parent program:";
$lang->project->endGreaterParent = "The finish date of the project was > the maximum finish date of the parent program:";
$lang->project->dataExceedParent = "The start and finish date of the project was > the start and finish date of the parent program:";
$lang->project->dateExceedParent = "The start and finish date of the project was > the start and finish date of the parent program:";
$lang->project->beginGreateChild = 'The start date of the project should be ≥ the start date of program: %s.';
$lang->project->endLetterChild = 'The finish date of the project should be ≤ the finish date of program: %s.';
$lang->project->begigLetterExecution = 'The start date of project should be ≤ the minimum start date of the execution: %s.';
+1 -1
View File
@@ -322,7 +322,7 @@ $lang->project->parentBeginEnd = "The begin and end date of the parent proj
$lang->project->parentBudget = "The budget of the parent project: ";
$lang->project->beginLetterParent = "The start date of the project was < the minimum start date of the parent program:";
$lang->project->endGreaterParent = "The finish date of the project was > the maximum finish date of the parent program:";
$lang->project->dataExceedParent = "The start and finish date of the project was > the start and finish date of the parent program:";
$lang->project->dateExceedParent = "The start and finish date of the project was > the start and finish date of the parent program:";
$lang->project->beginGreateChild = 'The start date of the project should be ≥ the start date of program: %s.';
$lang->project->endLetterChild = 'The finish date of the project should be ≤ the finish date of program: %s.';
$lang->project->begigLetterExecution = 'The start date of project should be ≤ the minimum start date of the execution: %s.';
+1 -1
View File
@@ -322,7 +322,7 @@ $lang->project->parentBeginEnd = "Parent begin&end date: %s ~ %s";
$lang->project->parentBudget = "The budget of the parent project: ";
$lang->project->beginLetterParent = "La date de début du projet était < à la date minimale de début du programme parent:";
$lang->project->endGreaterParent = "La date de fin du projet était > à la date de fin maximale du programme parent:";
$lang->project->dataExceedParent = "La date de début et de fin du project était > à la date de début et de fin du programme parent:";
$lang->project->dateExceedParent = "La date de début et de fin du project était > à la date de début et de fin du programme parent:";
$lang->project->beginGreateChild = 'La date de début du projets "%s" doit être ≥ à la date de début du programme "%s" : %s.';
$lang->project->endLetterChild = 'La date de fin du projets doit être ≤ à la date de fin du programme: %s.';
$lang->project->begigLetterExecution = 'La date de début du projet "%s" doit être ≤ à la date de début minimum d\'excution: %s';
+1 -1
View File
@@ -322,7 +322,7 @@ $lang->project->parentBeginEnd = "父项目起止时间:%s ~ %s";
$lang->project->parentBudget = "父项目预算:";
$lang->project->beginLetterParent = "项目的开始日期已小于父项目集的最小开始日期:";
$lang->project->endGreaterParent = "项目的完成日期已大于父项目集的最大完成日期:";
$lang->project->dataExceedParent = "项目的起止日期已超出父项目集的起止日期:";
$lang->project->dateExceedParent = "项目的起止日期已超出父项目集的起止日期:";
$lang->project->beginGreateChild = '项目的开始日期应大于等于项目集的最小开始日期:%s';
$lang->project->endLetterChild = '项目的完成日期应小于等于项目集的最大完成日期:%s';
$lang->project->begigLetterExecution = '项目的开始日期应小于等于执行的最小开始日期:%s';
+1 -1
View File
@@ -31,7 +31,7 @@
<?php js::set('parentBudget', $lang->project->parentBudget);?>
<?php js::set('beginLetterParent', $lang->project->beginLetterParent);?>
<?php js::set('endGreaterParent', $lang->project->endGreaterParent);?>
<?php js::set('dataExceedParent', $lang->project->dataExceedParent);?>
<?php js::set('dateExceedParent', $lang->project->dateExceedParent);?>
<?php $requiredFields = $config->project->create->requiredFields;?>
<?php js::set('requiredFields', $requiredFields);?>
<div id='mainContent' class='main-content'>
+1 -1
View File
@@ -35,7 +35,7 @@
<?php js::set('parentBudget', $lang->project->parentBudget);?>
<?php js::set('beginLetterParent', $lang->project->beginLetterParent);?>
<?php js::set('endGreaterParent', $lang->project->endGreaterParent);?>
<?php js::set('dataExceedParent', $lang->project->dataExceedParent);?>
<?php js::set('dateExceedParent', $lang->project->dateExceedParent);?>
<div id='mainContent' class='main-content'>
<div class='center-block'>
<div class='main-header'>