"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/redmine/export/pdf/issues_pdf_helper.rb" between
redmine-4.1.0.tar.gz and redmine-4.1.1.tar.gz

About: Redmine is a flexible project management and bug-tracking web application (using the Ruby on Rails framework). It supports also project wikis and forums, documents management, and multiple version control systems.

issues_pdf_helper.rb  (redmine-4.1.0):issues_pdf_helper.rb  (redmine-4.1.1)
skipping to change at line 215 skipping to change at line 215
end end
end end
if assoc[:journals].present? if assoc[:journals].present?
pdf.SetFontStyle('B',9) pdf.SetFontStyle('B',9)
pdf.RDMCell(190,5, l(:label_history), "B") pdf.RDMCell(190,5, l(:label_history), "B")
pdf.ln pdf.ln
assoc[:journals].each do |journal| assoc[:journals].each do |journal|
pdf.SetFontStyle('B',8) pdf.SetFontStyle('B',8)
title = "##{journal.indice} - #{format_time(journal.created_on)} - #{journal.user}" title = "##{journal.indice} - #{format_time(journal.created_on)} - #{journal.user}"
title << " (#{l(:field_private_notes)})" if journal.private_notes? title += " (#{l(:field_private_notes)})" if journal.private_notes?
pdf.RDMCell(190,5, title) pdf.RDMCell(190,5, title)
pdf.ln pdf.ln
pdf.SetFontStyle('I',8) pdf.SetFontStyle('I',8)
details_to_strings(journal.visible_details, true).each do |string| details_to_strings(journal.visible_details, true).each do |string|
pdf.RDMMultiCell(190,5, "- " + string) pdf.RDMMultiCell(190,5, "- " + string)
end end
if journal.notes? if journal.notes?
pdf.ln unless journal.details.empty? pdf.ln unless journal.details.empty?
pdf.SetFontStyle('',8) pdf.SetFontStyle('',8)
text = text =
skipping to change at line 282 skipping to change at line 282
row_height = 4 row_height = 4
# column widths # column widths
table_width = page_width - right_margin - left_margin table_width = page_width - right_margin - left_margin
col_width = [] col_width = []
unless query.inline_columns.empty? unless query.inline_columns.empty?
col_width = calc_col_width(issues, query, table_width, pdf) col_width = calc_col_width(issues, query, table_width, pdf)
table_width = col_width.inject(0, :+) table_width = col_width.inject(0, :+)
end end
# use full width if the description or last_notes are displayed # use full width if the query has block columns (description, last_not
if table_width > 0 && (query.has_column?(:description) || query.has_co es or full width custom fieds)
lumn?(:last_notes)) if table_width > 0 && query.block_columns.any?
col_width = col_width.map {|w| w * (page_width - right_margin - left _margin) / table_width} col_width = col_width.map {|w| w * (page_width - right_margin - left _margin) / table_width}
table_width = col_width.inject(0, :+) table_width = col_width.inject(0, :+)
end end
# title # title
pdf.SetFontStyle('B',11) pdf.SetFontStyle('B',11)
pdf.RDMCell(190, 8, title) pdf.RDMCell(190, 8, title)
pdf.ln pdf.ln
# totals # totals
skipping to change at line 339 skipping to change at line 339
if max_height > space_left if max_height > space_left
pdf.add_page("L") pdf.add_page("L")
render_table_header(pdf, query, col_width, row_height, table_width ) render_table_header(pdf, query, col_width, row_height, table_width )
base_y = pdf.get_y base_y = pdf.get_y
end end
# write the cells on page # write the cells on page
issues_to_pdf_write_cells(pdf, col_values, col_width, max_height) issues_to_pdf_write_cells(pdf, col_values, col_width, max_height)
pdf.set_y(base_y + max_height) pdf.set_y(base_y + max_height)
if query.has_column?(:description) && issue.description? query.block_columns.each do |column|
pdf.set_x(10) if column.is_a?(QueryCustomFieldColumn)
pdf.set_auto_page_break(true, bottom_margin) cv = issue.visible_custom_field_values.detect {|v| v.custom_field_
pdf.RDMwriteHTMLCell(0, 5, 10, '', issue.description.to_s, issue.a id == column.custom_field.id}
ttachments, "LRBT") text = show_value(cv, false)
pdf.set_auto_page_break(false) else
text = issue.send(column.name)
end end
next if text.blank?
if query.has_column?(:last_notes) && issue.last_notes.present? pdf.set_x(10)
pdf.set_x(10) pdf.set_auto_page_break(true, bottom_margin)
pdf.set_auto_page_break(true, bottom_margin) pdf.SetFontStyle('B',9)
pdf.RDMwriteHTMLCell(0, 5, 10, '', issue.last_notes.to_s, [], "LRB pdf.RDMCell(0, 5, column.caption, "LRT", 1)
T") pdf.SetFontStyle('',9)
pdf.set_auto_page_break(false) pdf.RDMwriteHTMLCell(0, 5, '', '', text, [], "LRB")
pdf.set_auto_page_break(false)
end end
end end
if issues.size == Setting.issues_export_limit.to_i if issues.size == Setting.issues_export_limit.to_i
pdf.SetFontStyle('B',10) pdf.SetFontStyle('B',10)
pdf.RDMCell(0, row_height, '...') pdf.RDMCell(0, row_height, '...')
end end
pdf.output pdf.output
end end
skipping to change at line 378 skipping to change at line 382
end end
# fetch row values # fetch row values
def fetch_row_values(issue, query, level) def fetch_row_values(issue, query, level)
query.inline_columns.collect do |column| query.inline_columns.collect do |column|
s = s =
if column.is_a?(QueryCustomFieldColumn) if column.is_a?(QueryCustomFieldColumn)
cv = issue.visible_custom_field_values.detect {|v| v.custom_fiel d_id == column.custom_field.id} cv = issue.visible_custom_field_values.detect {|v| v.custom_fiel d_id == column.custom_field.id}
show_value(cv, false) show_value(cv, false)
else else
value = issue.send(column.name) value = column.value_object(issue)
case column.name case column.name
when :subject when :subject
value = " " * level + value value = " " * level + value
when :attachments when :attachments
value = value.to_a.map {|a| a.filename}.join("\n") value = value.to_a.map {|a| a.filename}.join("\n")
end end
if value.is_a?(Date) if value.is_a?(Date)
format_date(value) format_date(value)
elsif value.is_a?(Time) elsif value.is_a?(Time)
format_time(value) format_time(value)
 End of changes. 6 change blocks. 
17 lines changed or deleted 20 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)