From: Go MAEDA Date: Sat, 26 Oct 2024 06:38:43 +0000 (+0000) Subject: Add column totals to Issues Summary Report (#691). X-Git-Tag: 6.0.0~45 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c8b6859ba6ecbef2626a933e83ba6632f36306bb;p=redmine.git Add column totals to Issues Summary Report (#691). Contributed by David Petersen (user:petersendidit). git-svn-id: https://svn.redmine.org/redmine/trunk@23163 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index e8242c6ca..630c78476 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -352,6 +352,7 @@ tr.idnt-8 td.subject, tr.idnt-8 td.name {padding-left: 136px; background-positio tr.idnt-9 td.subject, tr.idnt-9 td.name {padding-left: 152px; background-position: 136px 50%;} table.issue-report {table-layout:fixed;} +table.issue-report tr.total, table.issue-report-detailed tr.total { font-weight: bold; border-top:2px solid #d0d7de;} .issue-report-graph {width: 75%; margin: 2em 0;} tr.entry td { white-space: nowrap; } diff --git a/app/views/reports/_details.html.erb b/app/views/reports/_details.html.erb index ab660bc16..930fca6a8 100644 --- a/app/views/reports/_details.html.erb +++ b/app/views/reports/_details.html.erb @@ -24,6 +24,17 @@ <% end %> + + + <%= l(:label_total) %> + <% for status in @statuses %> + <%= aggregate data, { "status_id" => status.id } %> + <% end %> + <%= aggregate data, { "closed" => 0 } %> + <%= aggregate data, { "closed" => 1 } %> + <%= aggregate data, { } %> + + <% other_formats_links do |f| %> <%= f.link_to_with_query_parameters 'CSV', {}, :onclick => "showModal('csv-export-options', '330px'); return false;" %> diff --git a/app/views/reports/_simple.html.erb b/app/views/reports/_simple.html.erb index 754b1f21d..2237728b2 100644 --- a/app/views/reports/_simple.html.erb +++ b/app/views/reports/_simple.html.erb @@ -17,6 +17,14 @@ <%= aggregate_link data, { field_name => row.id }, aggregate_path(@project, field_name, row, :status_id => "*", :subproject_id => nil) %> <% end %> + + + <%= l(:label_total) %> + <%= aggregate data, { "closed" => 0 } %> + <%= aggregate data, { "closed" => 1 } %> + <%= aggregate data, { } %> + + <% end %> diff --git a/test/functional/reports_controller_test.rb b/test/functional/reports_controller_test.rb index 497176b1d..a68c13536 100644 --- a/test/functional/reports_controller_test.rb +++ b/test/functional/reports_controller_test.rb @@ -208,6 +208,17 @@ class ReportsControllerTest < Redmine::ControllerTest assert_select ':nth-child(9)', :text => '1' # closed assert_select ':nth-child(10)', :text => '3' # total end + assert_select 'table.list tfoot :nth-child(1)' do + assert_select 'td', :text => 'Total' + assert_select ':nth-child(2)', :text => '3' # status:1 + assert_select ':nth-child(3)', :text => '0' # status:2 + assert_select ':nth-child(4)', :text => '0' # status:3 + assert_select ':nth-child(5)', :text => '0' # status:4 + assert_select ':nth-child(6)', :text => '1' # status:5 + assert_select ':nth-child(8)', :text => '3' # open + assert_select ':nth-child(9)', :text => '1' # closed + assert_select ':nth-child(10)', :text => '4' # total + end end def test_get_issue_report_details_by_assignee_should_show_non_assigned_issue_count