Project

General

Profile

Feature #5634 » 0001-Forward-port-of-Export-issue-to-PDF-does-not-include.patch

patch against trunk - Bernhard Furtmueller, 2011-01-28 20:57

View differences:

lib/redmine/export/pdf.rb
pdf.footer_date = format_date(Date.today)
pdf.AddPage
pdf.SetFontStyle('B',11)
pdf.Cell(190,10, "#{issue.project} - #{issue.tracker} # #{issue.id}: #{issue.subject}")
i = 0
pdf.SetFontStyle('',9)
issue.ancestors.each do |ancestor|
if i == 0
pdf.MultiCell(190,5,(i>=1?" " * i + ">":"") + "#{ancestor.project} - #{ancestor.tracker} # #{ancestor.id}: #{ancestor.subject} (#{ancestor.status.to_s})", "0", 1 )
else
pdf.MultiCell(190,5,(i>=1?" " * i + ">":"") + "#{ancestor.project} - #{ancestor.tracker} # #{ancestor.id}: #{ancestor.subject} (#{ancestor.status.to_s})", "0", 1 )
end
i += 1
end
pdf.SetFontStyle('B',11)
pdf.Cell(190,10,(i>=1?" " * (i+1) + ">":"") + "#{issue.project} - #{issue.tracker} # #{issue.id}: #{issue.subject}")
pdf.Ln
y0 = pdf.GetY
......
pdf.Ln
pdf.SetFontStyle('B',9)
pdf.Cell(35,5, l(:field_description) + ":")
y = pdf.GetY
x = pdf.GetX
pdf.Cell(35,5, l(:field_description) + ":","")
pdf.SetFontStyle('',9)
pdf.MultiCell(155,5, issue.description.to_s,"BR")
pdf.Line(pdf.GetX, y0, pdf.GetX, pdf.GetY)
pdf.Line(pdf.GetX, pdf.GetY, 170, pdf.GetY)
pdf.MultiCell(155,5, issue.description,"R")
pdf.Line(x,y,x,pdf.GetY)
i = 0
issue_list(issue.descendants.sort_by(&:lft)) do |child, level|
if i == 0
pdf.SetFontStyle('B',9)
pdf.Cell(35,5, l(:label_subtask_plural) + ":", "LT")
pdf.SetFontStyle('', 9)
pdf.Cell(125,5,(level>=1?" " * level + ">":"") + "#{child.project} - #{child.tracker} # #{child.id}: #{child.subject}".first(80)+"...", "T")
pdf.SetFontStyle('B',9)
pdf.Cell(30,5, "#{child.status.to_s}", "RT",0,"L",true)
pdf.Ln
else
pdf.SetFontStyle('B',9)
pdf.Cell(35,5, "", "L")
pdf.SetFontStyle('', 9)
pdf.Cell(125,5,(level>=1?" " * level + ">":"") + "#{child.project} - #{child.tracker} # #{child.id}: #{child.subject}".first(80)+"...", "0")
pdf.SetFontStyle('B',9)
pdf.Cell(30,5, "#{child.status.to_s}", "R",0,"L",true)
pdf.Ln
end
i += 1
end
i = 0
issue.relations.select { |r| r.other_issue(issue).visible? }.each do |relation|
if i == 0
pdf.SetFontStyle('B',9)
pdf.Cell(35,5, l(relation.label_for(issue)) + ":", "LT")
pdf.SetFontStyle('', 9)
pdf.Cell(125,5, "#{relation.other_issue(issue).project} - #{relation.other_issue(issue).tracker} # #{relation.other_issue(issue).id}: #{relation.other_issue(issue).subject}".first(80) + "...", "T")
pdf.SetFontStyle('B',9)
pdf.Cell(30,5, "#{relation.other_issue(issue).status.to_s}", "RT",0,"L",true)
pdf.Ln
else
pdf.SetFontStyle('B',9)
pdf.Cell(35,5, l(relation.label_for(issue)) + ":", "L")
pdf.SetFontStyle('', 9)
pdf.Cell(125,5, "#{relation.other_issue(issue).project} - #{relation.other_issue(issue).tracker} # #{relation.other_issue(issue).id}: #{relation.other_issue(issue).subject}".first(80) + "...", "0")
pdf.SetFontStyle('B',9)
pdf.Cell(30,5, "#{relation.other_issue(issue).status.to_s}", "R",0,"L",true)
pdf.Ln
end
i += 1
end
pdf.Cell(190,5, "", "T",0)
pdf.Ln
if issue.changesets.any? && User.current.allowed_to?(:view_changesets, issue.project)
(2-2/6)