Project

General

Profile

Defect #32859 » fix_32859.patch

Marius BĂLTEANU, 2020-01-25 11:19

View differences:

lib/redmine/export/pdf/issues_pdf_helper.rb
279 279
            table_width = col_width.inject(0, :+)
280 280
          end
281 281

  
282
          # use full width if the description or last_notes are displayed
283
          if table_width > 0 && (query.has_column?(:description) || query.has_column?(:last_notes))
282
          # use full width if the query has block columns (description, last_notes or full width custom fieds)
283
          if table_width > 0 && query.block_columns.any?
284 284
            col_width = col_width.map {|w| w * (page_width - right_margin - left_margin) / table_width}
285 285
            table_width = col_width.inject(0, :+)
286 286
          end
......
336 336
            issues_to_pdf_write_cells(pdf, col_values, col_width, max_height)
337 337
            pdf.set_y(base_y + max_height)
338 338

  
339
            if query.has_column?(:description) && issue.description?
340
              pdf.set_x(10)
341
              pdf.set_auto_page_break(true, bottom_margin)
342
              pdf.RDMwriteHTMLCell(0, 5, 10, '', issue.description.to_s, issue.attachments, "LRBT")
343
              pdf.set_auto_page_break(false)
339
            query.block_columns.each do |column|
340
            if column.is_a?(QueryCustomFieldColumn)
341
              cv = issue.visible_custom_field_values.detect {|v| v.custom_field_id == column.custom_field.id}
342
              text = show_value(cv, false)
343
            else
344
              text = issue.send(column.name)
344 345
            end
346
            next if text.blank?
345 347

  
346
            if query.has_column?(:last_notes) && issue.last_notes.present?
347
              pdf.set_x(10)
348
              pdf.set_auto_page_break(true, bottom_margin)
349
              pdf.RDMwriteHTMLCell(0, 5, 10, '', issue.last_notes.to_s, [], "LRBT")
350
              pdf.set_auto_page_break(false)
348
            pdf.set_x(10)
349
            pdf.set_auto_page_break(true, bottom_margin)
350
            pdf.SetFontStyle('B',9)
351
            pdf.RDMCell(0, 5, column.caption, "LRT", 1)
352
            pdf.SetFontStyle('',9)
353
            pdf.RDMwriteHTMLCell(0, 5, '', '', text, [], "LRB")
354
            pdf.set_auto_page_break(false)
351 355
            end
352 356
          end
353 357

  
    (1-1/1)