From 463b4d07107369382d22d862f6dd518a41baa2df Mon Sep 17 00:00:00 2001 From: zhouxudong Date: Fri, 24 Jun 2022 02:14:08 +0000 Subject: [PATCH] * Finish task #57859. --- module/program/css/browse.css | 1 + module/program/js/browse.js | 23 +++++++++++++++++++++++ module/program/lang/de.php | 1 + module/program/lang/en.php | 1 + module/program/lang/fr.php | 1 + module/program/lang/zh-cn.php | 1 + module/program/view/browse.html.php | 3 ++- module/program/view/browsebylist.html.php | 2 +- 8 files changed, 31 insertions(+), 2 deletions(-) diff --git a/module/program/css/browse.css b/module/program/css/browse.css index 735d63b292..412e5acb45 100644 --- a/module/program/css/browse.css +++ b/module/program/css/browse.css @@ -1,4 +1,5 @@ #mainMenu .pull-left .checkbox-primary {display: inline-block; margin-left: 10px;} +#projectsSummary {padding-left: 10px;} .main-table tbody>tr>td:first-child, .main-table thead>tr>th:first-child {padding-left: 8px;} .table tbody>tr>td .dropdown {display: inline-block; line-height: 1;} tbody.sortable > tr > td.sort-handler .table-nest-toggle:before {cursor: pointer !important;} diff --git a/module/program/js/browse.js b/module/program/js/browse.js index 6099d6acaa..1b57fc93d4 100644 --- a/module/program/js/browse.js +++ b/module/program/js/browse.js @@ -28,6 +28,21 @@ $(function() $('.table-footer #checkAll').prop('checked', false); $('#programForm').removeClass('has-row-checked'); } + + var summary = checkedProjects.replace('%s', checkedLength); + var statistic = "
" + summary + "
"; + if(checkedLength > 0) + { + $('#programSummary').addClass('hidden'); + $('#projectsSummary').remove(); + $('.editCheckbox').after(statistic); + } + else + { + $('#programSummary').removeClass('hidden'); + $('#projectsSummary').addClass('hidden'); + } + }); $(document).on('click', ".table-footer #checkAll", function() @@ -36,11 +51,19 @@ $(function() { $(":checkbox[name^='projectIdList']").prop('checked', true); $('#programForm').addClass('has-row-checked'); + var checkedLength = $(":checkbox[name^='projectIdList']:checked").length; + var summary = checkedProjects.replace('%s', checkedLength); + var statistic = "
" + summary + "
"; + $('#programSummary').addClass('hidden'); + $('#projectsSummary').remove(); + $('.editCheckbox').after(statistic); } else { $(":checkbox[name^='projectIdList']").prop('checked', false); $('#programForm').removeClass('has-row-checked'); + $('#programSummary').removeClass('hidden'); + $('#projectsSummary').addClass('hidden'); } }); }); diff --git a/module/program/lang/de.php b/module/program/lang/de.php index be6975e083..461c62007a 100644 --- a/module/program/lang/de.php +++ b/module/program/lang/de.php @@ -111,6 +111,7 @@ $lang->program->unlinkStakeholder = 'Unlink Stakeholder'; $lang->program->readjustTime = 'Change the program begin&end date.'; $lang->program->accessDenied = 'You have no access to the program.'; $lang->program->beyondParentBudget = 'The remaining budget of the owned program has been exceeded.'; +$lang->program->checkedProjects = 'Seleted %s items'; $lang->program->endList[31] = 'One month'; $lang->program->endList[93] = 'Trimester'; diff --git a/module/program/lang/en.php b/module/program/lang/en.php index 8641ad4c6f..97f6558e2f 100644 --- a/module/program/lang/en.php +++ b/module/program/lang/en.php @@ -111,6 +111,7 @@ $lang->program->unlinkStakeholder = 'Do you want to remove the Stakeholder?'; $lang->program->readjustTime = 'Change the program begin&end date.'; $lang->program->accessDenied = 'You have no access to the program.'; $lang->program->beyondParentBudget = 'The remaining budget of the owned program has been exceeded.'; +$lang->program->checkedProjects = 'Seleted %s items'; $lang->program->endList[31] = 'One month'; $lang->program->endList[93] = 'Trimester'; diff --git a/module/program/lang/fr.php b/module/program/lang/fr.php index be6975e083..b8eea8f6d2 100644 --- a/module/program/lang/fr.php +++ b/module/program/lang/fr.php @@ -111,6 +111,7 @@ $lang->program->unlinkStakeholder = 'Unlink Stakeholder'; $lang->program->readjustTime = 'Change the program begin&end date.'; $lang->program->accessDenied = 'You have no access to the program.'; $lang->program->beyondParentBudget = 'The remaining budget of the owned program has been exceeded.'; +$lang->program->checkedProjects = "Pour s électionner l'élément% s"; $lang->program->endList[31] = 'One month'; $lang->program->endList[93] = 'Trimester'; diff --git a/module/program/lang/zh-cn.php b/module/program/lang/zh-cn.php index 7feab8d484..2e8bce41d4 100644 --- a/module/program/lang/zh-cn.php +++ b/module/program/lang/zh-cn.php @@ -111,6 +111,7 @@ $lang->program->unlinkStakeholder = '您确定要移除干系人吗?'; $lang->program->readjustTime = '重新调整项目集起止时间'; $lang->program->accessDenied = '你无权访问该项目集'; $lang->program->beyondParentBudget = '已超出所属项目集的剩余预算'; +$lang->program->checkedProjects = '已选择%s项'; $lang->program->endList[31] = '一个月'; $lang->program->endList[93] = '三个月'; diff --git a/module/program/view/browse.html.php b/module/program/view/browse.html.php index e9a8dc9304..0f2cd999cc 100644 --- a/module/program/view/browse.html.php +++ b/module/program/view/browse.html.php @@ -16,8 +16,9 @@ edit);?> selectAll);?> +program->checkedProjects);?> - +