* Finish task #63679.

This commit is contained in:
zhouxudong
2022-08-07 15:21:43 +00:00
parent c68f271328
commit abc59ed7aa
9 changed files with 69 additions and 10 deletions
+6
View File
@@ -322,6 +322,12 @@ function setBudgetTipsAndAclList(parentID)
outOfDateTip();
}
/**
* The date is out of the range of the parent project set, and a prompt is given.
*
* @access public
* @return void
*/
function outOfDateTip()
{
var end = $('#end').val();
+42
View File
@@ -95,6 +95,7 @@ function computeWorkDays(currentID)
{
computeEndDate();
}
outOfDateTip();
}
/**
@@ -350,3 +351,44 @@ function budgetOverrunTips()
$('#budget').attr('placeholder', placeholder);
});
}
/**
*The date is out of the range of the parent project set, and a prompt is given.
*
* @access public
* @return void
*/
function outOfDateTip()
{
var end = $('#end').val();
var begin = $('#begin').val();
if(end.length > 0 && begin.length > 0)
{
var selectedProgramID = $('#parent').val();
var budget = $('#budget').val();
if(selectedProgramID == 0)
{
if($('#dateTip').length > 0) $('#dateTip').remove();
return false;
}
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 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);
});
}
}
+1
View File
@@ -5,6 +5,7 @@ $(function()
var programID = $(this).val();
setAclList(programID);
budgetOverrunTips();
outOfDateTip();
/* Determine whether the project can change the project set. */
link = createLink('project', 'ajaxCheckProduct', 'programID=' + programID + '&projectID=' + projectID);
+3 -2
View File
@@ -320,8 +320,9 @@ $lang->project->cannotChangeToCat = "It is not empty, so you cannot change it
$lang->project->cannotCancelCat = "It has child projects, so you cannot unmark the parent.";
$lang->project->parentBeginEnd = "Parent begin&end date: %s ~ %s";
$lang->project->parentBudget = "The budget of the parent project: ";
$lang->project->beginLetterParent = "The begin date of the parent project: %s. It cannot be < the begin date of its parent project.";
$lang->project->endGreaterParent = "The end date of the parent project: %s. It cannot be > the end date of its 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->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.';
+3 -2
View File
@@ -320,8 +320,9 @@ $lang->project->cannotChangeToCat = "The project has contents, so you cannot i
$lang->project->cannotCancelCat = "There are child projects of this project. You cannot cancel the parent project mark.";
$lang->project->parentBeginEnd = "The begin and end date of the parent project: %s ~ %s";
$lang->project->parentBudget = "The budget of the parent project: ";
$lang->project->beginLetterParent = "The begin date of the parent project: %s. It cannot be < the begin date of its parent project.";
$lang->project->endGreaterParent = "The end date of the parent project: %s. It cannot be > the end date of its 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->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.';
+3 -2
View File
@@ -320,8 +320,9 @@ $lang->project->cannotChangeToCat = "It is not empty, so you cannot change it
$lang->project->cannotCancelCat = "It has child projects, so you cannot unmark the parent.";
$lang->project->parentBeginEnd = "Parent begin&end date: %s ~ %s";
$lang->project->parentBudget = "The budget of the parent project: ";
$lang->project->beginLetterParent = "The begin date of the parent project: %s. It cannot be < the begin date of its parent project.";
$lang->project->endGreaterParent = "The end date of the parent project: %s. It cannot be > the end date of its 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->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';
+3 -2
View File
@@ -320,8 +320,9 @@ $lang->project->cannotChangeToCat = "该项目已经有实际的内容,无
$lang->project->cannotCancelCat = "该项目下已经有子项目,无法取消父项目标记";
$lang->project->parentBeginEnd = "父项目起止时间:%s ~ %s";
$lang->project->parentBudget = "父项目预算:";
$lang->project->beginLetterParent = "父项目的开始日期:%s,开始日期不能小于父项目的开始日期";
$lang->project->endGreaterParent = "父项目的完成日期:%s,完成日期不能大于父项目的完成日期";
$lang->project->beginLetterParent = "项目的开始日期已小于父项目集的最小开始日期:";
$lang->project->endGreaterParent = "项目的完成日期已大于父项目集的最大完成日期:";
$lang->project->dataExceedParent = "项目的起止日期已超出父项目集的起止日期:";
$lang->project->beginGreateChild = '项目的开始日期应大于等于项目集的最小开始日期:%s';
$lang->project->endLetterChild = '项目的完成日期应小于等于项目集的最大完成日期:%s';
$lang->project->begigLetterExecution = '项目的开始日期应小于等于执行的最小开始日期:%s';
+4 -1
View File
@@ -29,6 +29,9 @@
<?php js::set('budgetOverrun', $lang->project->budgetOverrun);?>
<?php js::set('currencySymbol', $lang->project->currencySymbol)?>
<?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 $requiredFields = $config->project->create->requiredFields;?>
<?php js::set('requiredFields', $requiredFields);?>
<div id='mainContent' class='main-content'>
@@ -92,7 +95,7 @@
<tr>
<th id="dateRange"><?php echo $lang->project->dateRange;?></th>
<td>
<div class='input-group'>
<div id='dateBox' class='input-group'>
<?php echo html::input('begin', date('Y-m-d'), "class='form-control form-date' onchange='computeWorkDays();' placeholder='" . $lang->project->begin . "' required");?>
<span class='input-group-addon'><?php echo $lang->project->to;?></span>
<?php echo html::input('end', '', "class='form-control form-date' onchange='computeWorkDays();' placeholder='" . $lang->project->end . "' required");?>
+4 -1
View File
@@ -33,6 +33,9 @@
<?php js::set('budgetOverrun', $lang->project->budgetOverrun);?>
<?php js::set('currencySymbol', $lang->project->currencySymbol)?>
<?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);?>
<div id='mainContent' class='main-content'>
<div class='center-block'>
<div class='main-header'>
@@ -98,7 +101,7 @@
<tr>
<th id="dateRange"><?php echo $lang->project->dateRange;?></th>
<td>
<div class='input-group'>
<div id='dateBox' class='input-group'>
<?php echo html::input('begin', $project->begin, "class='form-control form-date' onchange='computeWorkDays();' placeholder='" . $lang->project->begin . "' required");?>
<span class='input-group-addon'><?php echo $lang->project->to;?></span>
<?php