diff options
author | Go MAEDA <maeda@farend.jp> | 2020-01-26 14:06:10 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2020-01-26 14:06:10 +0000 |
commit | 1c5ab7510dfa3acf2e9d785b12c52b3684b23fba (patch) | |
tree | 97caeaf5080002462a2afc92c0ae7fdac018cc8b /lib | |
parent | fca346bc52057e78172b0a100ed770d9e4735687 (diff) | |
download | redmine-1c5ab7510dfa3acf2e9d785b12c52b3684b23fba.tar.gz redmine-1c5ab7510dfa3acf2e9d785b12c52b3684b23fba.zip |
Issue list: long text custom field missing in PDF export (#32859).
Patch by Marius BALTEANU.
git-svn-id: http://svn.redmine.org/redmine/trunk@19464 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r-- | lib/redmine/export/pdf/issues_pdf_helper.rb | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/lib/redmine/export/pdf/issues_pdf_helper.rb b/lib/redmine/export/pdf/issues_pdf_helper.rb index 81f1a8174..652622755 100644 --- a/lib/redmine/export/pdf/issues_pdf_helper.rb +++ b/lib/redmine/export/pdf/issues_pdf_helper.rb @@ -279,8 +279,8 @@ module Redmine table_width = col_width.inject(0, :+) end - # use full width if the description or last_notes are displayed - if table_width > 0 && (query.has_column?(:description) || query.has_column?(:last_notes)) + # use full width if the query has block columns (description, last_notes or full width custom fieds) + if table_width > 0 && query.block_columns.any? col_width = col_width.map {|w| w * (page_width - right_margin - left_margin) / table_width} table_width = col_width.inject(0, :+) end @@ -336,18 +336,22 @@ module Redmine issues_to_pdf_write_cells(pdf, col_values, col_width, max_height) pdf.set_y(base_y + max_height) - if query.has_column?(:description) && issue.description? - pdf.set_x(10) - pdf.set_auto_page_break(true, bottom_margin) - pdf.RDMwriteHTMLCell(0, 5, 10, '', issue.description.to_s, issue.attachments, "LRBT") - pdf.set_auto_page_break(false) + query.block_columns.each do |column| + if column.is_a?(QueryCustomFieldColumn) + cv = issue.visible_custom_field_values.detect {|v| v.custom_field_id == column.custom_field.id} + text = show_value(cv, false) + else + text = issue.send(column.name) end + next if text.blank? - if query.has_column?(:last_notes) && issue.last_notes.present? - pdf.set_x(10) - pdf.set_auto_page_break(true, bottom_margin) - pdf.RDMwriteHTMLCell(0, 5, 10, '', issue.last_notes.to_s, [], "LRBT") - pdf.set_auto_page_break(false) + pdf.set_x(10) + pdf.set_auto_page_break(true, bottom_margin) + pdf.SetFontStyle('B',9) + pdf.RDMCell(0, 5, column.caption, "LRT", 1) + pdf.SetFontStyle('',9) + pdf.RDMwriteHTMLCell(0, 5, '', '', text, [], "LRB") + pdf.set_auto_page_break(false) end end |