Merge branch 'master' into 'master_liuhong_63787'

# Conflicts:
#   module/program/css/browse.css
#   module/project/css/browse.css
This commit is contained in:
王怡栋
2022-08-11 01:22:50 +00:00
99 changed files with 1032 additions and 424 deletions
-43
View File
@@ -704,49 +704,6 @@ class program extends control
echo $html;
}
/**
* Ajax get budget left.
*
* @param int $programID
* @access public
* @return void
*/
public function ajaxGetBudgetLeft($programID)
{
$program = $this->program->getByID($programID);
$budgetLeft = $this->program->getBudgetLeft($program);
echo number_format($budgetLeft, 2);
}
/**
* Ajax get available budget.
*
* @param int $programID
* @param int $selectedProgramID
* @param int $budget
* @access public
* @return void
*/
public function ajaxGetAvailableBudget($programID, $selectedProgramID, $budget)
{
if(!empty($programID))
{
$program = $this->program->getByID($programID);
$selectedProgram = $this->program->getByID($selectedProgramID);
$budgetLeft = $this->program->getBudgetLeft($selectedProgram);
$availableBudget = $program->parent == $selectedProgramID ? $budgetLeft + $program->budget : $budgetLeft;
}
else
{
$selectedProgram = $this->program->getByID($selectedProgramID);
$availableBudget = $this->program->getBudgetLeft($selectedProgram);
}
$tips = '';
if($budget != 0 && $budget !== null && $budget > $availableBudget) $tips = "<span id='beyondBudgetTip' class='text-remind'>" . $this->lang->program->budgetOverrun . zget($this->lang->project->currencySymbol, $selectedProgram->budgetUnit) . $availableBudget . "</span>";
echo json_encode($tips);
}
/**
* Update program order.
*
+2 -1
View File
@@ -14,6 +14,7 @@ tbody.sortable > tr > td.sort-handler {color: #3c4353 !important;}
.has-suffix > a {max-width: calc(100% - 100px); padding-right: 5px; color: #0c60e1; display: inline-block; max-width: calc(100% - 50px);}
div.checkbox-primary + span.table-nest-icon {margin-left:0px !important;}
div.checkbox-primary + span.table-nest-icon {margin-left: 0px !important;}
#checkAll + label.hover:after {border-width: 0px;}
.c-budget {width:100px; text-align: right; padding-right:16px !important;}
.c-status {width: 65px !important;}
+118 -4
View File
@@ -93,6 +93,7 @@ function computeWorkDays(currentID)
{
computeEndDate();
}
outOfDateTip();
}
/**
@@ -111,6 +112,7 @@ function computeEndDate(delta)
if(delta == 999)
{
$('#end').val(longTime);
outOfDateTip();
return false;
}
@@ -294,15 +296,18 @@ $(function()
*/
function setBudgetTipsAndAclList(parentID)
{
var selectedProgramID = $('#parent').val();
if(parentID != 0)
{
$.get(createLink('program', 'ajaxGetBudgetLeft', "ProgramID=" + parentID), function(budgetLeft)
$.get(createLink('project', 'ajaxGetObjectInfo', "objectType=program&objectID=" + parentID + "&selectedProgramID=" + selectedProgramID), function(data)
{
var data = JSON.parse(data);
parentProgram = programList[parentID];
programBudget = parentProgram.budget;
PGMBudgetUnit = currencySymbol[parentProgram.budgetUnit];
budgetNotes = programBudget != 0 ? (PGMParentBudget + PGMBudgetUnit + budgetLeft) : '';
budgetNotes = programBudget != 0 ? (PGMParentBudget + PGMBudgetUnit + data.availableBudget) : '';
$('#budget').attr('placeholder', budgetNotes);
});
$('.aclBox').html($('#subPGMAcl').html());
@@ -315,6 +320,113 @@ function setBudgetTipsAndAclList(parentID)
if(typeof(programID) == 'undefined') programID = 0;
budgetOverrunTips();
outOfDateTip();
}
/**
* compare childlish date.
*
* @access public
* @return void
*/
function compareChildDate()
{
if(page == 'create') return;
var end = $('#end').val();
var begin = $('#begin').val();
var selectedProgramID = $('#parent').val();
if($('#dateTip').length > 0) $('#dateTip').remove();
if(end == longTime) end = LONG_TIME;
if(end.length > 0 && begin.length > 0)
{
var programEnd = new Date(end);
var programBegin = new Date(begin);
$.get(createLink('project', 'ajaxGetObjectInfo', 'objectType=program&objectID=' + programID + '&selectedProgramID=' + selectedProgramID), function(data)
{
var childInfo = JSON.parse(data);
if(childInfo.maxChildEnd == '' || childInfo.minChildBegin == '') return;
var childBegin = new Date(childInfo.minChildBegin);
var childEnd = new Date(childInfo.maxChildEnd);
if(programBegin <= childBegin && programEnd >= childEnd) return;
var dateTip = '';
if(programBegin > childBegin && programEnd >= childEnd)
{
dateTip = "<span id='dateTip' class='text-remind'>" + beginGreateChild + childInfo.minChildBegin + "</span>";
}
else if(programEnd < childEnd && programBegin <= childBegin)
{
dateTip = "<span id='dateTip' class='text-remind'>" + endLetterChild + childInfo.maxChildEnd + "</span>";
}
else
{
dateTip = "<span id='dateTip' class='text-remind'>" + dateExceedChild + childInfo.minChildBegin + "~" + childInfo.maxChildEnd + "</span>";
}
$('#dateBox').after(dateTip);
});
}
}
/**
* 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($('#dateTip').length > 0) $('#dateTip').remove();
if(end == longTime) end = LONG_TIME;
if(end.length > 0 && begin.length > 0)
{
var selectedProgramID = $('#parent').val();
var programEnd = new Date(end);
var programBegin = new Date(begin);
if(selectedProgramID == 0)
{
compareChildDate();
return;
}
if(typeof(programID) == 'undefined') programID = 0;
$.get(createLink('project', 'ajaxGetObjectInfo', 'objectType=program&objectID=' + programID + "&selectedProgramID=" + selectedProgramID), function(data)
{
var dateTip = '';
var data = JSON.parse(data);
var parentEnd = new Date(data.selectedProgramEnd);
var parentBegin = new Date(data.selectedProgramBegin);
if(programBegin >= parentBegin && programEnd <= parentEnd)
{
compareChildDate();
return;
}
if(programBegin < parentBegin && programEnd <= parentEnd && programEnd >= parentBegin)
{
dateTip = "<span id='dateTip' class='text-remind'>" + beginLetterParent + data.selectedProgramBegin + "</span>";
}
else if(programEnd > parentEnd && programBegin >= parentBegin && programBegin <= parentEnd)
{
dateTip = "<span id='dateTip' class='text-remind'>" + endGreaterParent + data.selectedProgramEnd + "</span>";
}
else
{
dateTip = "<span id='dateTip' class='text-remind'>" + dateExceedParent + data.selectedProgramBegin + "~" + data.selectedProgramEnd + "</span>";
}
$('#dateBox').after(dateTip);
});
}
}
/**
@@ -334,11 +446,13 @@ function budgetOverrunTips()
}
if(typeof(programID) == 'undefined') programID = 0;
$.get(createLink('program', 'ajaxGetAvailableBudget', 'programID=' + programID + "&selectedProgramID=" + selectedProgramID + "&budget=" + budget), function(data)
$.get(createLink('project', 'ajaxGetObjectInfo', 'objectType=program&objectID=' + programID + "&selectedProgramID=" + selectedProgramID), function(data)
{
var data = JSON.parse(data);
var tip = "";
if(budget !=0 && budget !== null && budget > data.availableBudget) var tip = "<span id='beyondBudgetTip' class='text-remind'>" + budgetOverrun + currencySymbol[data.budgetUnit] + data.availableBudget + "</span>"
if($('#beyondBudgetTip').length > 0) $('#beyondBudgetTip').remove();
$('#budgetBox').after(data);
$('#budgetBox').after(tip);
});
}
+6 -4
View File
@@ -100,10 +100,12 @@ $lang->program->noProgram = 'No program.';
$lang->program->showClosed = 'Closed programs.';
$lang->program->tips = 'If a parent program is selected, the products under the parent program can be associated. If no program is selected for the project, a product with the same name as the project is created and associated with the project by default.';
$lang->program->confirmBatchUnlink = "Do you want to batch unlink these stakeholders?";
$lang->program->beginLetterParent = 'The start date of the program should be ≥ the start date of the parent program: %s.';
$lang->program->endGreaterParent = 'The finish date of the program should be ≤ the finish date of the parent program: %s.';
$lang->program->beginGreateChild = 'The start date of the parent program should be ≤the minimum start time of the %s: %s.';
$lang->program->endLetterChild = 'The finish time of the parent program should be ≥ the maximum finish time of the %s: %s.';
$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->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->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.';
+6 -4
View File
@@ -100,10 +100,12 @@ $lang->program->noProgram = 'No program.';
$lang->program->showClosed = 'Closed';
$lang->program->tips = 'If a parent program is selected, the products under the parent program can be associated. If no program is selected for the project, a product with the same name as the project is created and associated with the project by default.';
$lang->program->confirmBatchUnlink = "Do you want to batch unlink these stakeholders?";
$lang->program->beginLetterParent = 'The start date of the program should be ≥ the start date of the parent program: %s.';
$lang->program->endGreaterParent = 'The finish date of the program should be ≤ the finish date of the parent program: %s.';
$lang->program->beginGreateChild = 'The start date of the parent program should be ≤the minimum start time of the %s: %s.';
$lang->program->endLetterChild = 'The finish time of the parent program should be ≥ the maximum finish time of the %s: %s.';
$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->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->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.';
+6 -4
View File
@@ -100,10 +100,12 @@ $lang->program->noProgram = 'No program.';
$lang->program->showClosed = 'Closed programs.';
$lang->program->tips = 'If a parent program is selected, the products under the parent program can be associated. If no program is selected for the project, a product with the same name as the project is created and associated with the project by default.';
$lang->program->confirmBatchUnlink = "Do you want to batch unlink these stakeholders?";
$lang->program->beginLetterParent = 'La date de début du programme doit être ≥ à la date de début du programme parent: %s.';
$lang->program->endGreaterParent = 'La date de fin du programme doit être ≤ à la date de fin du programme parent: %s.';
$lang->program->beginGreateChild = 'La date de début du programme parent doit être ≤ à la date de début minimum du %s: %s.';
$lang->program->endLetterChild = 'Le temps de fin du programme parent doit être ≥ au temps de fin maximum du %s: %s.';
$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->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->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.';
+6 -4
View File
@@ -100,10 +100,12 @@ $lang->program->noProgram = '暂时没有项目集';
$lang->program->showClosed = '显示已关闭';
$lang->program->tips = '选择了父项目集,则可关联该父项目集下的产品。如果项目未选择任何项目集,则系统会默认创建一个和该项目同名的产品并关联该项目。';
$lang->program->confirmBatchUnlink = "您确定要批量移除这些干系人吗?";
$lang->program->beginLetterParent = '项目集开始日期应大于等于父项目集的开始日期:%s。';
$lang->program->endGreaterParent = '项目集完成日期应小于等于父项目集的完成日期:%s。';
$lang->program->beginGreateChild = '父项目集的开始日期应小于等于%s的最小开始时间:%s。';
$lang->program->endLetterChild = '父项目集的完成时间应大于等于%s的最大完成时间:%s。';
$lang->program->beginLetterParent = '项目集的开始日期已小于父项目集的开始日期:';
$lang->program->endGreaterParent = '项目集的完成日期已大于父项目集的完成日期:';
$lang->program->dateExceedParent = '项目集的起止日期已超出父项目集的起止日期';
$lang->program->beginGreateChild = '项目集的开始日期已大于子项目集或项目的最小开始日期:';
$lang->program->endLetterChild = '项目集的完成日期已小于子项目集或项目的最大完成日期:';
$lang->program->dateExceedChild = '项目集的起止日期已不包含子项目集或项目的日期范围';
$lang->program->closeErrorMessage = '存在子项目集或项目为未关闭状态';
$lang->program->hasChildren = '该项目集有子项目集或项目存在,不能删除。';
$lang->program->hasProduct = '该项目集有产品存在,不能删除。';
+10 -2
View File
@@ -35,10 +35,18 @@
<?php js::set('holders', $lang->execution->placeholder);?>
<?php js::set('errorSameProducts', $lang->project->errorSameProducts);?>
<?php js::set('longTime', $lang->program->longTime);?>
<?php js::set('LONG_TIME', LONG_TIME);?>
<?php js::set('currencySymbol', $lang->project->currencySymbol);?>
<?php js::set('PGMParentBudget', $lang->program->parentBudget);?>
<?php js::set('future', $lang->project->future);?>
<?php js::set('programList', $programList);?>
<?php js::set('budgetOverrun', $lang->project->budgetOverrun);?>
<?php js::set('currencySymbol', $lang->project->currencySymbol)?>
<?php js::set('parentBudget', $lang->program->parentBudget);?>
<?php js::set('beginLetterParent', $lang->program->beginLetterParent);?>
<?php js::set('endGreaterParent', $lang->program->endGreaterParent);?>
<?php js::set('dateExceedParent', $lang->program->dateExceedParent);?>
<?php js::set('page', $this->app->getMethodName());?>
<?php $aclList = $parentProgram ? $lang->program->subAclList : $lang->program->aclList;?>
<?php $requiredFields = $config->program->create->requiredFields;?>
<div id='mainContent' class='main-content'>
@@ -90,10 +98,10 @@
<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' placeholder='" . $lang->project->end . "' required");?>
<?php echo html::input('end', '', "class='form-control form-date' onchange='outOfDateTip();' placeholder='" . $lang->project->end . "' required");?>
</div>
</td>
<td id="endList" colspan='2'><?php echo html::radio('delta', $lang->program->endList, '', "onclick='computeEndDate(this.value)'");?></td>
+14 -3
View File
@@ -12,6 +12,8 @@
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/kindeditor.html.php';?>
<?php js::set('LONG_TIME', LONG_TIME);?>
<?php js::set('page', $this->app->getMethodName());?>
<?php js::set('weekend', $config->execution->weekend);?>
<?php js::set('longTime', $lang->program->longTime);?>
<?php js::set('currencySymbol', $lang->project->currencySymbol);?>
@@ -25,6 +27,15 @@
<?php js::set('exRateNum', sprintf($lang->error->float, $lang->program->exchangeRate));?>
<?php js::set('exRateNotNegative', $lang->program->exRateNotNegative);?>
<?php js::set('programID', $program->id);?>
<?php js::set('budgetOverrun', $lang->project->budgetOverrun);?>
<?php js::set('currencySymbol', $lang->project->currencySymbol)?>
<?php js::set('parentBudget', $lang->program->parentBudget);?>
<?php js::set('beginLetterParent', $lang->program->beginLetterParent);?>
<?php js::set('endGreaterParent', $lang->program->endGreaterParent);?>
<?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'>
@@ -73,12 +84,12 @@
<tr>
<th id="dateRange"><?php echo $lang->project->dateRange;?></th>
<td>
<div class='input-group'>
<?php echo html::input('begin', $program->begin, "class='form-control form-date' placeholder='" . $lang->project->begin . "' required");?>
<div id='dateBox' class='input-group'>
<?php echo html::input('begin', $program->begin, "class='form-control form-date' onchange='outOfDateTip();' placeholder='" . $lang->project->begin . "' required");?>
<span class='input-group-addon'><?php echo $lang->project->to;?></span>
<?php
$end = $program->end == LONG_TIME ? $lang->program->longTime : $program->end;
echo html::input('end', $end, "class='form-control form-date' placeholder='" . $lang->project->end . "' required");
echo html::input('end', $end, "class='form-control form-date' onchange='outOfDateTip();' placeholder='" . $lang->project->end . "' required");
?>
</div>
</td>