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; ?> -