Project

General

Profile

Patch #30026 » issues_pdf_helper-redmine-3.4.6.rb.patch

Dirk Rudolph, 2018-11-24 22:53

View differences:

issues_pdf_helper.rb (Arbeitskopie)
91 91
            heights = []
92 92
            pdf.SetFontStyle('B',9)
93 93
            item = left[i]
94
            heights << pdf.get_string_height(35, item ? "#{item.first}:" : "")
94
            heights << pdf.get_string_height(35, textilizable(item ? "#{item.first}:" : ""))
95 95
            item = right[i]
96
            heights << pdf.get_string_height(35, item ? "#{item.first}:" : "")
96
            heights << pdf.get_string_height(35, textilizable(item ? "#{item.first}:" : ""))
97 97
            pdf.SetFontStyle('',9)
98 98
            item = left[i]
99
            heights << pdf.get_string_height(60, item ? item.last.to_s  : "")
99
            heights << pdf.get_string_height(60, textilizable(item ? item.last.to_s  : ""))
100 100
            item = right[i]
101
            heights << pdf.get_string_height(60, item ? item.last.to_s  : "")
101
            heights << pdf.get_string_height(60, textilizable(item ? item.last.to_s  : ""))
102 102
            height = heights.max
103 103
  
104 104
            item = left[i]
105 105
            pdf.SetFontStyle('B',9)
106 106
            pdf.RDMMultiCell(35, height, item ? "#{item.first}:" : "", (i == 0 ? border_first_top : border_first), '', 0, 0)
107 107
            pdf.SetFontStyle('',9)
108
            pdf.RDMMultiCell(60, height, item ? item.last.to_s : "", (i == 0 ? border_last_top : border_last), '', 0, 0)
109
  
108
            pdf.RDMwriteFormattedCell(60, height, '', '', textilizable(item ? item.last.to_s : ""), issue.attachments,(i == 0 ? border_last_top : border_last), 0)
109

  
110 110
            item = right[i]
111 111
            pdf.SetFontStyle('B',9)
112 112
            pdf.RDMMultiCell(35, height, item ? "#{item.first}:" : "",  (i == 0 ? border_first_top : border_first), '', 0, 0)
113 113
            pdf.SetFontStyle('',9)
114
            pdf.RDMMultiCell(60, height, item ? item.last.to_s : "", (i == 0 ? border_last_top : border_last), '', 0, 2)
114
            pdf.RDMwriteFormattedCell(60, height, '', '', textilizable(item ? item.last.to_s : ""), issue.attachments, (i == 0 ? border_last_top : border_last), 2)
115 115
  
116 116
            pdf.set_x(base_x)
117 117
          end
......
132 132

  
133 133
          custom_field_values = issue.visible_custom_field_values.select {|value| value.custom_field.full_width_layout?}
134 134
          custom_field_values.each do |value|
135
            text = show_value(value, false)
135
            text = show_value(value, true)
136 136
            next if text.blank?
137 137

  
138 138
            pdf.SetFontStyle('B',9)
139 139
            pdf.RDMCell(35+155, 5, value.custom_field.name, "LRT", 1)
140 140
            pdf.SetFontStyle('',9)
141
            pdf.RDMwriteHTMLCell(35+155, 5, '', '', text, issue.attachments, "LRB")
141
            pdf.RDMwriteFormattedCell(35+155, 5, '', '', text, issue.attachments, "LRB")
142 142
          end
143 143

  
144 144
          unless issue.leaf?
......
338 338
            if query.has_column?(:description) && issue.description?
339 339
              pdf.set_x(10)
340 340
              pdf.set_auto_page_break(true, bottom_margin)
341
              pdf.RDMwriteHTMLCell(0, 5, 10, '', issue.description.to_s, issue.attachments, "LRBT")
341
              pdf.RDMwriteFormattedCell(0, 5, 10, '', textilizable(issue, :description), issue.attachments, "LRBT")
342 342
              pdf.set_auto_page_break(false)
343 343
            end
344 344

  
......
371 371
          query.inline_columns.collect do |column|
372 372
            s = if column.is_a?(QueryCustomFieldColumn)
373 373
              cv = issue.visible_custom_field_values.detect {|v| v.custom_field_id == column.custom_field.id}
374
              show_value(cv, false)
374
              show_value(cv, true )
375 375
            else
376 376
              value = issue.send(column.name)
377 377
              case column.name
......
519 519
        def get_issues_to_pdf_write_cells(pdf, col_values, col_widths, head=false)
520 520
          heights = []
521 521
          col_values.each_with_index do |column, i|
522
            heights << pdf.get_string_height(col_widths[i], head ? column.caption : column)
522
            heights << pdf.get_string_height(col_widths[i], head ? column.caption : textilizable(column))
523 523
          end
524 524
          return heights.max
525 525
        end
......
527 527
        # Renders MultiCells and returns the maximum height used
528 528
        def issues_to_pdf_write_cells(pdf, col_values, col_widths, row_height, head=false)
529 529
          col_values.each_with_index do |column, i|
530
            pdf.RDMMultiCell(col_widths[i], row_height, head ? column.caption : column.strip, 1, '', 1, 0)
530
            pdf.RDMwriteFormattedCell(col_widths[i], row_height, '', '', head ? column.caption : column.strip, [], 1, 0, 1)
531 531
          end
532 532
        end
533 533

  
(1-1/6)