From 364a5009f4caf216af843da4a7ad0ca79b4e9c6c Mon Sep 17 00:00:00 2001 From: zhouxudong Date: Tue, 2 Aug 2022 07:21:03 +0000 Subject: [PATCH] * Finish task #62850. --- module/project/css/common.css | 1 + module/project/css/create.css | 3 +++ module/project/css/edit.css | 4 +++- module/project/js/common.js | 6 ++++++ module/project/lang/de.php | 1 + module/project/lang/en.php | 1 + module/project/lang/fr.php | 1 + module/project/lang/zh-cn.php | 1 + module/project/model.php | 2 +- module/project/view/create.html.php | 9 +++++---- module/project/view/edit.html.php | 9 +++++---- 11 files changed, 28 insertions(+), 10 deletions(-) diff --git a/module/project/css/common.css b/module/project/css/common.css index c026c35fbd..c7dfdc44b7 100644 --- a/module/project/css/common.css +++ b/module/project/css/common.css @@ -1,2 +1,3 @@ .future {display: inline-block;} .c-number {overflow: hidden; text-align: right !important; text-overflow: ellipsis; white-space: nowrap;} +.text-remind {color: #ffa34d;} diff --git a/module/project/css/create.css b/module/project/css/create.css index 0232e1b8fa..b92dc698b0 100644 --- a/module/project/css/create.css +++ b/module/project/css/create.css @@ -21,3 +21,6 @@ #productsBox .input-group-addon > div {display: inline-block !important;} #plansBox .row {display: inline-table; width: 102%;} #plansBox .col-sm-4 {float: none; display: inline-block; padding-right: 5px;} +#dataform th {vertical-align: top; padding-top: 13px;} +.undetermined {vertical-align: top !important; padding-top: 13px !important;} +#linkPlan {padding-top: 25px !important;} diff --git a/module/project/css/edit.css b/module/project/css/edit.css index 3a6df893c9..aed960e5f9 100644 --- a/module/project/css/edit.css +++ b/module/project/css/edit.css @@ -2,5 +2,7 @@ #budgetUnit {border-left: 0px;} #plansBox .row {display: inline-table; width: 102%;} #plansBox .col-sm-4 {float: none; display: inline-block;} -#dateRange {vertical-align: top; padding-top: 13px;} +#dateRange, .undetermined {vertical-align: top !important; padding-top: 13px !important;} #endList {vertical-align: top; padding-top: 13px;} +#dataform th {vertical-align: top; padding-top: 13px;} +#linkPlan {padding-top: 25px !important;} diff --git a/module/project/js/common.js b/module/project/js/common.js index 2e0c533dc8..cab744e7c9 100644 --- a/module/project/js/common.js +++ b/module/project/js/common.js @@ -324,6 +324,12 @@ function setBudgetTipsAndAclList(programID) } } +function budgetOverrunTips(budgetLeft) +{ + var budget = $('#budget').val(); + budget > budgetLeft ? $('#programBudget').removeClass('hidden') : $('#programBudget').addClass('hidden'); +} + $(document).on('change', "#plansBox select[name^='plans']", function() { var $plan = $(this); diff --git a/module/project/lang/de.php b/module/project/lang/de.php index deab788c45..a512e8b387 100644 --- a/module/project/lang/de.php +++ b/module/project/lang/de.php @@ -196,6 +196,7 @@ $lang->project->unlinkExecutionMember = "The user participated in %s executions $lang->project->unlinkExecutionMembers = "The team members you are removing are also in the execution team of this project. Do you want to remove them from the execution team too?"; $lang->project->productTip = 'After clicking New Product, the project will not be linked to the selected product.'; $lang->project->noDevStage = 'There is no R&D stage under this project, or you do not have access permissions. The creation of builds is not supported at the moment.'; +$lang->project->budgetOverrun = 'The budget of the project has exceeded the remaining budget of the parent project set.'; $lang->project->tenThousand = ''; $lang->project->hundredMillion = 'Hundred Million'; diff --git a/module/project/lang/en.php b/module/project/lang/en.php index 6330f8cc9a..15e35e5f7d 100644 --- a/module/project/lang/en.php +++ b/module/project/lang/en.php @@ -196,6 +196,7 @@ $lang->project->unlinkExecutionMember = "The user participated in %s executions $lang->project->unlinkExecutionMembers = "The team members you are removing are also in the execution team of this project. Do you want to remove them from the execution team too?"; $lang->project->productTip = 'After clicking New Product, the project will not be linked to the selected product.'; $lang->project->noDevStage = 'There is no R&D stage under this project, or you do not have access permissions. The creation of builds is not supported at the moment.'; +$lang->project->budgetOverrun = 'The budget of the project has exceeded the remaining budget of the parent project set.'; $lang->project->tenThousand = 'Ten Thousand'; $lang->project->hundredMillion = 'Hundred Million'; diff --git a/module/project/lang/fr.php b/module/project/lang/fr.php index 1be54e768a..56a42d58d2 100644 --- a/module/project/lang/fr.php +++ b/module/project/lang/fr.php @@ -196,6 +196,7 @@ $lang->project->unlinkExecutionMember = "The user participated in %s executions $lang->project->unlinkExecutionMembers = "The team members you are removing are also in the execution team of this project. Do you want to remove them from the execution team too?"; $lang->project->productTip = 'After clicking New Product, the project will not be linked to the selected product.'; $lang->project->noDevStage = "Il n'y a pas de phase R&D dans ce projet, ou vous n'avez pas la permission d'accès. La version ne peut pas être créée pour le moment."; +$lang->project->budgetOverrun = 'Le budget du projet a dépassé le budget restant de l\'ensemble de projets parent.'; $lang->project->tenThousand = ''; $lang->project->hundredMillion = 'Hundred Million'; diff --git a/module/project/lang/zh-cn.php b/module/project/lang/zh-cn.php index 2a4bc0aeb5..8bcad8f821 100644 --- a/module/project/lang/zh-cn.php +++ b/module/project/lang/zh-cn.php @@ -196,6 +196,7 @@ $lang->project->unlinkExecutionMember = "该用户参与了%s%s%s个{$lang->exe $lang->project->unlinkExecutionMembers = "移除的团队成员还参与了项目下的执行,是否同步从执行团队中移除?"; $lang->project->productTip = '点击新建产品后,项目将不会关联已选中的产品。'; $lang->project->noDevStage = '该项目下没有研发类型的阶段,或者您没有权限访问,暂时不支持创建版本。'; +$lang->project->budgetOverrun = '项目的预算已超出父项目集的剩余预算。'; $lang->project->tenThousand = '万'; $lang->project->hundredMillion = '亿'; diff --git a/module/project/model.php b/module/project/model.php index 93b1965792..0c727086d1 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1111,7 +1111,7 @@ class projectModel extends model /* Judge products not empty. */ if(empty($linkedProductsCount) and !isset($_POST['newProduct'])) { - dao::$errors[] = $this->lang->project->productNotEmpty; + dao::$errors['products0_chosen'] = $this->lang->project->productNotEmpty; return false; } } diff --git a/module/project/view/create.html.php b/module/project/view/create.html.php index 4866641897..bcfef8c556 100755 --- a/module/project/view/create.html.php +++ b/module/project/view/create.html.php @@ -69,8 +69,8 @@ project->budget;?>
- budget != 0) ? 'placeholder=' . $lang->program->parentBudget . zget($lang->project->currencySymbol, $parentProgram->budgetUnit) . $availableBudget : '';?> - + budget != 0) ? 'placeholder="' . $lang->program->parentBudget . zget($lang->project->currencySymbol, $parentProgram->budgetUnit) . $availableBudget . '"' : '';?> + budgetUnit);?> @@ -78,8 +78,9 @@ project->defaultCurrency, "class='form-control'");?>
+ - +
@@ -145,7 +146,7 @@ - execution->linkPlan;?> + execution->linkPlan;?>
diff --git a/module/project/view/edit.html.php b/module/project/view/edit.html.php index eb68ff2970..fa51624d1a 100755 --- a/module/project/view/edit.html.php +++ b/module/project/view/edit.html.php @@ -75,8 +75,8 @@ project->budget;?>
- budget != 0) ? 'placeholder=' . $lang->project->parentBudget . zget($lang->project->currencySymbol, $parentProgram->budgetUnit) . $availableBudget : '';?> - budget != 0 ? $project->budget : '', "class='form-control' maxlength='10' " . (strpos($requiredFields, 'budget') !== false ? 'required ' : '') . ($project->budget == 0 ? 'disabled ' : '') . $placeholder);?> + budget != 0) ? 'placeholder="' . $lang->project->parentBudget . zget($lang->project->currencySymbol, $parentProgram->budgetUnit) . $availableBudget . '"' : '';?> + budget != 0 ? $project->budget : '', "class='form-control' onchange='budgetOverrunTips($availableBudget)' maxlength='10' " . (strpos($requiredFields, 'budget') !== false ? 'required ' : '') . ($project->budget == 0 ? 'disabled ' : '') . $placeholder);?> budgetUnit);?> @@ -84,8 +84,9 @@ budgetUnit, "class='form-control'");?>
+ - +
budget == 0) echo 'checked';?> /> @@ -153,7 +154,7 @@ - execution->linkPlan;?> + execution->linkPlan;?>