From f080000984f138134c67d7b1f99004e906b691ef Mon Sep 17 00:00:00 2001 From: tianshujie Date: Mon, 10 Oct 2022 14:14:33 +0800 Subject: [PATCH] * Finish task #71905. --- module/program/js/project.js | 30 +++++++++++++++++++++++ module/program/view/browsebylist.html.php | 2 +- module/program/view/project.html.php | 21 +++++++++++++--- 3 files changed, 49 insertions(+), 4 deletions(-) diff --git a/module/program/js/project.js b/module/program/js/project.js index b898958760..0af27f8677 100644 --- a/module/program/js/project.js +++ b/module/program/js/project.js @@ -1,5 +1,35 @@ $(function() { + $('#projectsForm').table( + { + replaceId: 'projectIdList', + statisticCreator: function(table) + { + var $table = table.getTable(); + var $checkedRows = $table.find('tbody>tr.checked'); + var checkedTotal = $checkedRows.length; + var statistics = summary; + var checkedStatistics = checkedSummary.replace('%total%', checkedTotal); + + if(browseType == 'all' || browseType == 'unclosed') + { + var checkedWait = $checkedRows.filter("[data-status=wait]").length; + var checkedDoing = $checkedRows.filter("[data-status=doing]").length; + var checkedSuspended = $checkedRows.filter("[data-status=suspended]").length; + var checkedClosed = $checkedRows.filter("[data-status=closed]").length; + + statistics = allSummary; + checkedStatistics = checkedAllSummary.replace('%total%', checkedTotal) + .replace('%wait%', checkedWait) + .replace('%doing%', checkedDoing) + .replace('%suspended%', checkedSuspended) + .replace('%closed%', checkedClosed); + } + + return checkedTotal ? checkedStatistics : statistics; + } + }); + $('input[name^="showEdit"]').click(function() { $.cookie('showProjectBatchEdit', $(this).is(':checked') ? 1 : 0, {expires: config.cookieLife, path: config.webRoot}); diff --git a/module/program/view/browsebylist.html.php b/module/program/view/browsebylist.html.php index 586bb1e86f..52eac4e2e1 100644 --- a/module/program/view/browsebylist.html.php +++ b/module/program/view/browsebylist.html.php @@ -48,7 +48,7 @@ $originOrders[] = $program->order; ?> - data-type="type;?>"> + data-type="type;?>" data-status="status?>"> has-prefix has-suffix' title='name?>'> +
project->allSummary, count($projectStats), $waitCount, $doingCount, $suspendedCount, $closedCount) : sprintf($lang->project->summary, count($projectStats));?>
show('right', 'pagerjs');?> +project->summary, count($projectStats))); +js::set('allSummary', sprintf($lang->project->allSummary, count($projectStats), $waitCount, $doingCount, $suspendedCount, $closedCount)); +js::set('checkedSummary', $lang->project->checkedSummary); +js::set('checkedAllSummary', $lang->project->checkedAllSummary); +?>