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