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