##// END OF EJS Templates
Fixes #2171: issue pdf export broken by r2006....
Jean-Philippe Lang -
r2028:243027e63a5f
parent child
Show More
@@ -1,126 +1,126
1 1 <% pdf=IfpdfHelper::IFPDF.new(current_language)
2 2 pdf.SetTitle("#{@project.name} - ##{@issue.tracker.name} #{@issue.id}")
3 3 pdf.AliasNbPages
4 4 pdf.footer_date = format_date(Date.today)
5 5 pdf.AddPage
6 6
7 7 pdf.SetFontStyle('B',11)
8 8 pdf.Cell(190,10, "#{@issue.project} - #{@issue.tracker} # #{@issue.id}: #{@issue.subject}")
9 9 pdf.Ln
10 10
11 11 y0 = pdf.GetY
12 12
13 13 pdf.SetFontStyle('B',9)
14 14 pdf.Cell(35,5, l(:field_status) + ":","LT")
15 15 pdf.SetFontStyle('',9)
16 16 pdf.Cell(60,5, @issue.status.name,"RT")
17 17 pdf.SetFontStyle('B',9)
18 18 pdf.Cell(35,5, l(:field_priority) + ":","LT")
19 19 pdf.SetFontStyle('',9)
20 20 pdf.Cell(60,5, @issue.priority.name,"RT")
21 21 pdf.Ln
22 22
23 23 pdf.SetFontStyle('B',9)
24 24 pdf.Cell(35,5, l(:field_author) + ":","L")
25 25 pdf.SetFontStyle('',9)
26 26 pdf.Cell(60,5, @issue.author.name,"R")
27 27 pdf.SetFontStyle('B',9)
28 28 pdf.Cell(35,5, l(:field_category) + ":","L")
29 29 pdf.SetFontStyle('',9)
30 30 pdf.Cell(60,5, (@issue.category ? @issue.category.name : "-"),"R")
31 31 pdf.Ln
32 32
33 33 pdf.SetFontStyle('B',9)
34 34 pdf.Cell(35,5, l(:field_created_on) + ":","L")
35 35 pdf.SetFontStyle('',9)
36 36 pdf.Cell(60,5, format_date(@issue.created_on),"R")
37 37 pdf.SetFontStyle('B',9)
38 38 pdf.Cell(35,5, l(:field_assigned_to) + ":","L")
39 39 pdf.SetFontStyle('',9)
40 40 pdf.Cell(60,5, (@issue.assigned_to ? @issue.assigned_to.name : "-"),"R")
41 41 pdf.Ln
42 42
43 43 pdf.SetFontStyle('B',9)
44 44 pdf.Cell(35,5, l(:field_updated_on) + ":","LB")
45 45 pdf.SetFontStyle('',9)
46 46 pdf.Cell(60,5, format_date(@issue.updated_on),"RB")
47 47 pdf.SetFontStyle('B',9)
48 48 pdf.Cell(35,5, l(:field_due_date) + ":","LB")
49 49 pdf.SetFontStyle('',9)
50 50 pdf.Cell(60,5, format_date(@issue.due_date),"RB")
51 51 pdf.Ln
52 52
53 53 for custom_value in @issue.custom_values
54 54 pdf.SetFontStyle('B',9)
55 55 pdf.Cell(35,5, custom_value.custom_field.name + ":","L")
56 56 pdf.SetFontStyle('',9)
57 57 pdf.MultiCell(155,5, (show_value custom_value),"R")
58 58 end
59 59
60 60 pdf.SetFontStyle('B',9)
61 61 pdf.Cell(35,5, l(:field_subject) + ":","LTB")
62 62 pdf.SetFontStyle('',9)
63 63 pdf.Cell(155,5, @issue.subject,"RTB")
64 64 pdf.Ln
65 65
66 66 pdf.SetFontStyle('B',9)
67 67 pdf.Cell(35,5, l(:field_description) + ":")
68 68 pdf.SetFontStyle('',9)
69 69 pdf.MultiCell(155,5, @issue.description,"BR")
70 70
71 71 pdf.Line(pdf.GetX, y0, pdf.GetX, pdf.GetY)
72 72 pdf.Line(pdf.GetX, pdf.GetY, 170, pdf.GetY)
73 73
74 74 pdf.Ln
75 75
76 76 if @issue.changesets.any? && User.current.allowed_to?(:view_changesets, @issue.project)
77 77 pdf.SetFontStyle('B',9)
78 78 pdf.Cell(190,5, l(:label_associated_revisions), "B")
79 79 pdf.Ln
80 80 for changeset in @issue.changesets
81 81 pdf.SetFontStyle('B',8)
82 pdf.Cell(190,5, format_time(changeset.committed_on) + " - " + changeset.author)
82 pdf.Cell(190,5, format_time(changeset.committed_on) + " - " + changeset.author.to_s)
83 83 pdf.Ln
84 84 unless changeset.comments.blank?
85 85 pdf.SetFontStyle('',8)
86 86 pdf.MultiCell(190,5, changeset.comments)
87 87 end
88 88 pdf.Ln
89 89 end
90 90 end
91 91
92 92 pdf.SetFontStyle('B',9)
93 93 pdf.Cell(190,5, l(:label_history), "B")
94 94 pdf.Ln
95 95 for journal in @issue.journals.find(:all, :include => [:user, :details], :order => "#{Journal.table_name}.created_on ASC")
96 96 pdf.SetFontStyle('B',8)
97 97 pdf.Cell(190,5, format_time(journal.created_on) + " - " + journal.user.name)
98 98 pdf.Ln
99 99 pdf.SetFontStyle('I',8)
100 100 for detail in journal.details
101 101 pdf.Cell(190,5, "- " + show_detail(detail, true))
102 102 pdf.Ln
103 103 end
104 104 if journal.notes?
105 105 pdf.SetFontStyle('',8)
106 106 pdf.MultiCell(190,5, journal.notes)
107 107 end
108 108 pdf.Ln
109 109 end
110 110
111 111 if @issue.attachments.any?
112 112 pdf.SetFontStyle('B',9)
113 113 pdf.Cell(190,5, l(:label_attachment_plural), "B")
114 114 pdf.Ln
115 115 for attachment in @issue.attachments
116 116 pdf.SetFontStyle('',8)
117 117 pdf.Cell(80,5, attachment.filename)
118 118 pdf.Cell(20,5, number_to_human_size(attachment.filesize),0,0,"R")
119 119 pdf.Cell(25,5, format_date(attachment.created_on),0,0,"R")
120 120 pdf.Cell(65,5, attachment.author.name,0,0,"R")
121 121 pdf.Ln
122 122 end
123 123 end
124 124 %>
125 125
126 126 <%= pdf.Output %>
General Comments 0
You need to be logged in to leave comments. Login now