summaryrefslogtreecommitdiffstats
path: root/lib/redmine/export/pdf
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-01-25 15:11:21 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-01-25 15:11:21 +0000
commit9cf1c5cfaeae0424d7477dcb78c6b0521fbb8036 (patch)
tree3fc67426f2e2207b862649c1cb6edba005325ba5 /lib/redmine/export/pdf
parent8e4cb42f8e060ebd9d6f576eeea8c01260ddcee8 (diff)
downloadredmine-9cf1c5cfaeae0424d7477dcb78c6b0521fbb8036.tar.gz
redmine-9cf1c5cfaeae0424d7477dcb78c6b0521fbb8036.zip
Adjust rendering of custom fields in PDF (#21705).
git-svn-id: http://svn.redmine.org/redmine/trunk@16253 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine/export/pdf')
-rw-r--r--lib/redmine/export/pdf/issues_pdf_helper.rb19
1 files changed, 15 insertions, 4 deletions
diff --git a/lib/redmine/export/pdf/issues_pdf_helper.rb b/lib/redmine/export/pdf/issues_pdf_helper.rb
index 75f63d272..45434c345 100644
--- a/lib/redmine/export/pdf/issues_pdf_helper.rb
+++ b/lib/redmine/export/pdf/issues_pdf_helper.rb
@@ -67,9 +67,10 @@ module Redmine
while right.size < rows
right << nil
end
-
- half = (issue.visible_custom_field_values.size / 2.0).ceil
- issue.visible_custom_field_values.each_with_index do |custom_value, i|
+
+ custom_field_values = issue.visible_custom_field_values.reject {|value| value.custom_field.full_width_layout?}
+ half = (custom_field_values.size / 2.0).ceil
+ custom_field_values.each_with_index do |custom_value, i|
(i < half ? left : right) << [custom_value.custom_field.name, show_value(custom_value, false)]
end
@@ -128,7 +129,17 @@ module Redmine
:inline_attachments => false
)
pdf.RDMwriteFormattedCell(35+155, 5, '', '', text, issue.attachments, "LRB")
-
+
+ custom_field_values = issue.visible_custom_field_values.select {|value| value.custom_field.full_width_layout?}
+ custom_field_values.each do |value|
+ pdf.SetFontStyle('B',9)
+ pdf.RDMCell(35+155, 5, value.custom_field.name, "LRT", 1)
+ pdf.SetFontStyle('',9)
+
+ text = show_value(value, false)
+ pdf.RDMwriteFormattedCell(35+155, 5, '', '', text, issue.attachments, "LRB")
+ end
+
unless issue.leaf?
truncate_length = (!is_cjk? ? 90 : 65)
pdf.SetFontStyle('B',9)