* Finish task #40838.
This commit is contained in:
@@ -63,6 +63,11 @@ $(function()
|
||||
alert(exRateNotEmpty);
|
||||
return false;
|
||||
}
|
||||
else if(exchangeRate < 0)
|
||||
{
|
||||
alert(exRateNotNegative);
|
||||
return false;
|
||||
}
|
||||
|
||||
$('#isChangeUnit').val('true');
|
||||
$('#exchangeRate').val(exchangeRate);
|
||||
|
||||
@@ -54,6 +54,7 @@ $lang->program->endLetterChild = "Child latest end: %s, parent end date
|
||||
$lang->program->closeErrorMessage = 'There are subprograms or projects that are not closed';
|
||||
$lang->program->confirmDelete = "Do you want to delete it?";
|
||||
$lang->program->confirmChangePRJUint = 'Do you want to update the budget unit of the project of the program? If yes, please the current exchange rate.';
|
||||
$lang->program->exRateNotNegative = 'The『exchange rate』should not be negative.';
|
||||
$lang->program->changePRJUnit = 'Update the budget unit of the project';
|
||||
$lang->program->hasChildren = 'It has child programs or projects. You cannot delete it.';
|
||||
$lang->program->readjustTime = 'Change the program begin&end date.';
|
||||
|
||||
@@ -57,6 +57,7 @@ $lang->program->closeErrorMessage = 'There are subprograms or projects tha
|
||||
$lang->program->hasChildren = 'The program has a child program or the project exists and can not be deleted.';
|
||||
$lang->program->confirmDelete = "Do you want to delete it?";
|
||||
$lang->program->confirmChangePRJUint = 'Do you want to update the budget unit of the project of the program? If yes, please the current exchange rate.';
|
||||
$lang->program->exRateNotNegative = 'The『exchange rate』should not be negative.';
|
||||
$lang->program->changePRJUnit = 'Update the budget unit of the project';
|
||||
$lang->program->readjustTime = 'Change the program begin&end date.';
|
||||
$lang->program->accessDenied = 'You have no access to the program.';
|
||||
|
||||
@@ -54,6 +54,7 @@ $lang->program->endLetterChild = "Child latest end: %s, parent end date
|
||||
$lang->program->closeErrorMessage = 'There are subprograms or projects that are not closed';
|
||||
$lang->program->confirmDelete = "Do you want to delete it?";
|
||||
$lang->program->confirmChangePRJUint = 'Do you want to update the budget unit of the project of the program? If yes, please the current exchange rate.';
|
||||
$lang->program->exRateNotNegative = 'The『exchange rate』should not be negative.';
|
||||
$lang->program->changePRJUnit = 'Update the budget unit of the project';
|
||||
$lang->program->hasChildren = 'It has child programs or projects. You cannot delete it.';
|
||||
$lang->program->readjustTime = 'Change the program begin&end date.';
|
||||
|
||||
@@ -54,6 +54,7 @@ $lang->program->endLetterChild = "Child latest end: %s, parent end date
|
||||
$lang->program->closeErrorMessage = 'There are subprograms or projects that are not closed';
|
||||
$lang->program->confirmDelete = "Do you want to delete it?";
|
||||
$lang->program->confirmChangePRJUint = 'Do you want to update the budget unit of the project of the program? If yes, please the current exchange rate.';
|
||||
$lang->program->exRateNotNegative = 'The『exchange rate』should not be negative.';
|
||||
$lang->program->changePRJUnit = 'Update the budget unit of the project';
|
||||
$lang->program->hasChildren = 'It has child programs or projects. You cannot delete it.';
|
||||
$lang->program->readjustTime = 'Change the program begin&end date.';
|
||||
|
||||
@@ -68,6 +68,7 @@ $lang->program->closeErrorMessage = '存在子项目集或项目为未关
|
||||
$lang->program->hasChildren = '该项目集有子项目集或项目存在,不能删除。';
|
||||
$lang->program->confirmDelete = "您确定要删除吗?";
|
||||
$lang->program->confirmChangePRJUint = '是否同步更新项目集下项目的预算的单位?若确认更新,请填写今日汇率。';
|
||||
$lang->program->exRateNotNegative = '『汇率』不能是负数。';
|
||||
$lang->program->changePRJUnit = '更新项目预算单位';
|
||||
$lang->program->readjustTime = '重新调整项目集起止时间';
|
||||
$lang->program->accessDenied = '你无权访问该项目集';
|
||||
|
||||
@@ -452,26 +452,10 @@ class programModel extends model
|
||||
{
|
||||
$this->dao->update(TABLE_PROJECT)
|
||||
->set('budgetUnit')->eq($program->budgetUnit)
|
||||
->beginIF(!empty($_POST['exchangeRate']))->set("budget = {$_POST['exchangeRate']} * `budget`")->fi()
|
||||
->where('parent')->eq($programID)
|
||||
->andWhere('type')->eq('project')
|
||||
->exec();
|
||||
|
||||
if(!empty($_POST['exchangeRate']))
|
||||
{
|
||||
$projectBudgets = $this->dao->select('id,budget')->from(TABLE_PROJECT)
|
||||
->where('parent')->eq($programID)
|
||||
->andWhere('type')->eq('project')
|
||||
->andWhere('budget')->ne('')
|
||||
->fetchAll('id');
|
||||
|
||||
foreach($projectBudgets as $id => $budget)
|
||||
{
|
||||
$this->dao->update(TABLE_PROJECT)
|
||||
->set('budget')->eq($_POST['exchangeRate'] * $budget->budget)
|
||||
->where('id')->eq($id)
|
||||
->exec();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->file->updateObjectID($this->post->uid, $programID, 'project');
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
<?php js::set('budgetUnitList', $budgetUnitList);?>
|
||||
<?php js::set('oldBudgetUnit', $program->budgetUnit);?>
|
||||
<?php js::set('exRateNotEmpty', sprintf($lang->error->notempty, $lang->program->exchangeRate));?>
|
||||
<?php js::set('exRateNotNegative', $lang->program->exRateNotNegative);?>
|
||||
<?php $aclList = $program->parent ? $lang->program->subAclList : $lang->program->aclList;?>
|
||||
<?php $requiredFields = $config->program->edit->requiredFields;?>
|
||||
<div id='mainContent' class='main-content'>
|
||||
|
||||
Reference in New Issue
Block a user