68 |
68 |
right << nil
|
69 |
69 |
end
|
70 |
70 |
|
71 |
|
half = (issue.visible_custom_field_values.size / 2.0).ceil
|
72 |
|
issue.visible_custom_field_values.each_with_index do |custom_value, i|
|
73 |
|
(i < half ? left : right) << [custom_value.custom_field.name, show_value(custom_value, false)]
|
74 |
|
end
|
75 |
|
|
76 |
|
if pdf.get_rtl
|
77 |
|
border_first_top = 'RT'
|
78 |
|
border_last_top = 'LT'
|
79 |
|
border_first = 'R'
|
80 |
|
border_last = 'L'
|
81 |
|
else
|
82 |
|
border_first_top = 'LT'
|
83 |
|
border_last_top = 'RT'
|
84 |
|
border_first = 'L'
|
85 |
|
border_last = 'R'
|
86 |
|
end
|
87 |
|
|
88 |
|
rows = left.size > right.size ? left.size : right.size
|
89 |
|
rows.times do |i|
|
90 |
|
heights = []
|
91 |
|
pdf.SetFontStyle('B',9)
|
92 |
|
item = left[i]
|
93 |
|
heights << pdf.get_string_height(35, item ? "#{item.first}:" : "")
|
94 |
|
item = right[i]
|
95 |
|
heights << pdf.get_string_height(35, item ? "#{item.first}:" : "")
|
96 |
|
pdf.SetFontStyle('',9)
|
97 |
|
item = left[i]
|
98 |
|
heights << pdf.get_string_height(60, item ? item.last.to_s : "")
|
99 |
|
item = right[i]
|
100 |
|
heights << pdf.get_string_height(60, item ? item.last.to_s : "")
|
101 |
|
height = heights.max
|
|
71 |
group_by_keys(issue.project_id, issue.tracker_id, issue.visible_custom_field_values).each do |title, values|
|
|
72 |
unless title.nil?
|
|
73 |
pdf.RDMCell(35+155, 5, title, "LRT", 1)
|
|
74 |
left = []
|
|
75 |
right = []
|
|
76 |
end
|
102 |
77 |
|
103 |
|
item = left[i]
|
104 |
|
pdf.SetFontStyle('B',9)
|
105 |
|
pdf.RDMMultiCell(35, height, item ? "#{item.first}:" : "", (i == 0 ? border_first_top : border_first), '', 0, 0)
|
106 |
|
pdf.SetFontStyle('',9)
|
107 |
|
pdf.RDMMultiCell(60, height, item ? item.last.to_s : "", (i == 0 ? border_last_top : border_last), '', 0, 0)
|
108 |
|
|
109 |
|
item = right[i]
|
110 |
|
pdf.SetFontStyle('B',9)
|
111 |
|
pdf.RDMMultiCell(35, height, item ? "#{item.first}:" : "", (i == 0 ? border_first_top : border_first), '', 0, 0)
|
112 |
|
pdf.SetFontStyle('',9)
|
113 |
|
pdf.RDMMultiCell(60, height, item ? item.last.to_s : "", (i == 0 ? border_last_top : border_last), '', 0, 2)
|
|
78 |
half = (values.size / 2.0).ceil
|
|
79 |
values.each_with_index do |custom_value, i|
|
|
80 |
(i < half ? left : right) << [custom_value.custom_field.name, show_value(custom_value, false)]
|
|
81 |
end
|
114 |
82 |
|
115 |
|
pdf.set_x(base_x)
|
|
83 |
if pdf.get_rtl
|
|
84 |
border_first_top = 'RT'
|
|
85 |
border_last_top = 'LT'
|
|
86 |
border_first = 'R'
|
|
87 |
border_last = 'L'
|
|
88 |
else
|
|
89 |
border_first_top = 'LT'
|
|
90 |
border_last_top = 'RT'
|
|
91 |
border_first = 'L'
|
|
92 |
border_last = 'R'
|
|
93 |
end
|
|
94 |
|
|
95 |
rows = left.size > right.size ? left.size : right.size
|
|
96 |
rows.times do |i|
|
|
97 |
heights = []
|
|
98 |
pdf.SetFontStyle('B',9)
|
|
99 |
item = left[i]
|
|
100 |
heights << pdf.get_string_height(35, item ? "#{item.first}:" : "")
|
|
101 |
item = right[i]
|
|
102 |
heights << pdf.get_string_height(35, item ? "#{item.first}:" : "")
|
|
103 |
pdf.SetFontStyle('',9)
|
|
104 |
item = left[i]
|
|
105 |
heights << pdf.get_string_height(60, item ? item.last.to_s : "")
|
|
106 |
item = right[i]
|
|
107 |
heights << pdf.get_string_height(60, item ? item.last.to_s : "")
|
|
108 |
height = heights.max
|
|
109 |
|
|
110 |
item = left[i]
|
|
111 |
pdf.SetFontStyle('B',9)
|
|
112 |
pdf.RDMMultiCell(35, height, item ? "#{item.first}:" : "", (i == 0 ? border_first_top : border_first), '', 0, 0)
|
|
113 |
pdf.SetFontStyle('',9)
|
|
114 |
pdf.RDMMultiCell(60, height, item ? item.last.to_s : "", (i == 0 ? border_last_top : border_last), '', 0, 0)
|
|
115 |
|
|
116 |
item = right[i]
|
|
117 |
pdf.SetFontStyle('B',9)
|
|
118 |
pdf.RDMMultiCell(35, height, item ? "#{item.first}:" : "", (i == 0 ? border_first_top : border_first), '', 0, 0)
|
|
119 |
pdf.SetFontStyle('',9)
|
|
120 |
pdf.RDMMultiCell(60, height, item ? item.last.to_s : "", (i == 0 ? border_last_top : border_last), '', 0, 2)
|
|
121 |
|
|
122 |
pdf.set_x(base_x)
|
|
123 |
end
|
116 |
124 |
end
|
117 |
125 |
|
118 |
126 |
pdf.SetFontStyle('B',9)
|