summaryrefslogtreecommitdiffstats
path: root/lib/redmine/export
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2015-10-09 09:02:29 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2015-10-09 09:02:29 +0000
commiteee65c8ba82216fb5a7501b7c1cf37896c5f2f23 (patch)
tree1bf03eec11df9611e9ab0d1356af20e05554f65b /lib/redmine/export
parent498a429a41bc47fc7e3980926901cc60863afe9a (diff)
downloadredmine-eee65c8ba82216fb5a7501b7c1cf37896c5f2f23.tar.gz
redmine-eee65c8ba82216fb5a7501b7c1cf37896c5f2f23.zip
Display totals if the PDF export (#1561).
git-svn-id: http://svn.redmine.org/redmine/trunk@14666 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine/export')
-rw-r--r--lib/redmine/export/pdf/issues_pdf_helper.rb19
1 files changed, 16 insertions, 3 deletions
diff --git a/lib/redmine/export/pdf/issues_pdf_helper.rb b/lib/redmine/export/pdf/issues_pdf_helper.rb
index 55980e882..a7a495680 100644
--- a/lib/redmine/export/pdf/issues_pdf_helper.rb
+++ b/lib/redmine/export/pdf/issues_pdf_helper.rb
@@ -274,9 +274,17 @@ module Redmine
# title
pdf.SetFontStyle('B',11)
- pdf.RDMCell(190,10, title)
+ pdf.RDMCell(190, 8, title)
pdf.ln
-
+
+ # totals
+ totals = query.totals.map {|column, total| "#{column.caption}: #{total}"}
+ if totals.present?
+ pdf.SetFontStyle('B',10)
+ pdf.RDMCell(table_width, 6, totals.join(" "), 0, 1, 'R')
+ end
+
+ totals_by_group = query.totals_by_group
render_table_header(pdf, query, col_width, row_height, table_width)
previous_group = false
issue_list(issues) do |issue, level|
@@ -286,8 +294,13 @@ module Redmine
group_label = group.blank? ? 'None' : group.to_s.dup
group_label << " (#{query.issue_count_by_group[group]})"
pdf.bookmark group_label, 0, -1
- pdf.RDMCell(table_width, row_height * 2, group_label, 1, 1, 'L')
+ pdf.RDMCell(table_width, row_height * 2, group_label, 'LR', 1, 'L')
pdf.SetFontStyle('',8)
+
+ totals = totals_by_group.map {|column, total| "#{column.caption}: #{total[group]}"}.join(" ")
+ if totals.present?
+ pdf.RDMCell(table_width, row_height, totals, 'LR', 1, 'L')
+ end
previous_group = group
end