]> source.dussan.org Git - redmine.git/commitdiff
Do not use partial in PDF templates (not supported when using rfpdf with Rails 2...
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 10 Jul 2008 16:23:42 +0000 (16:23 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 10 Jul 2008 16:23:42 +0000 (16:23 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1651 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/views/issues/_pdf.rfpdf [deleted file]
app/views/issues/show.rfpdf

diff --git a/app/views/issues/_pdf.rfpdf b/app/views/issues/_pdf.rfpdf
deleted file mode 100644 (file)
index 6830506..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-<%     pdf.SetFontStyle('B',11)        \r
-       pdf.Cell(190,10, "#{issue.project.name} - #{issue.tracker.name} # #{issue.id}: #{issue.subject}")\r
-    pdf.Ln\r
-    \r
-    y0 = pdf.GetY\r
-    \r
-    pdf.SetFontStyle('B',9)\r
-    pdf.Cell(35,5, l(:field_status) + ":","LT")\r
-    pdf.SetFontStyle('',9)\r
-    pdf.Cell(60,5, issue.status.name,"RT")\r
-    pdf.SetFontStyle('B',9)\r
-    pdf.Cell(35,5, l(:field_priority) + ":","LT")\r
-    pdf.SetFontStyle('',9)\r
-    pdf.Cell(60,5, issue.priority.name,"RT")        \r
-    pdf.Ln\r
-    \r
-    pdf.SetFontStyle('B',9)\r
-    pdf.Cell(35,5, l(:field_author) + ":","L")\r
-    pdf.SetFontStyle('',9)\r
-    pdf.Cell(60,5, issue.author.name,"R")\r
-    pdf.SetFontStyle('B',9)\r
-    pdf.Cell(35,5, l(:field_category) + ":","L")\r
-    pdf.SetFontStyle('',9)\r
-    pdf.Cell(60,5, (issue.category ? issue.category.name : "-"),"R")\r
-    pdf.Ln   \r
-    \r
-    pdf.SetFontStyle('B',9)\r
-    pdf.Cell(35,5, l(:field_created_on) + ":","L")\r
-    pdf.SetFontStyle('',9)\r
-    pdf.Cell(60,5, format_date(issue.created_on),"R")\r
-    pdf.SetFontStyle('B',9)\r
-    pdf.Cell(35,5, l(:field_assigned_to) + ":","L")\r
-    pdf.SetFontStyle('',9)\r
-    pdf.Cell(60,5, (issue.assigned_to ? issue.assigned_to.name : "-"),"R")\r
-    pdf.Ln\r
-    \r
-    pdf.SetFontStyle('B',9)\r
-    pdf.Cell(35,5, l(:field_updated_on) + ":","LB")\r
-    pdf.SetFontStyle('',9)\r
-    pdf.Cell(60,5, format_date(issue.updated_on),"RB")\r
-    pdf.SetFontStyle('B',9)\r
-    pdf.Cell(35,5, l(:field_due_date) + ":","LB")\r
-    pdf.SetFontStyle('',9)\r
-    pdf.Cell(60,5, format_date(issue.due_date),"RB")\r
-    pdf.Ln\r
-    \r
-       for custom_value in issue.custom_values\r
-           pdf.SetFontStyle('B',9)\r
-           pdf.Cell(35,5, custom_value.custom_field.name + ":","L")\r
-           pdf.SetFontStyle('',9)\r
-           pdf.MultiCell(155,5, (show_value custom_value),"R")\r
-       end\r
-    \r
-    pdf.SetFontStyle('B',9)\r
-    pdf.Cell(35,5, l(:field_subject) + ":","LTB")\r
-    pdf.SetFontStyle('',9)\r
-    pdf.Cell(155,5, issue.subject,"RTB")\r
-    pdf.Ln    \r
-    \r
-    pdf.SetFontStyle('B',9)\r
-    pdf.Cell(35,5, l(:field_description) + ":")\r
-    pdf.SetFontStyle('',9)\r
-    pdf.MultiCell(155,5, issue.description,"BR")\r
-    \r
-    pdf.Line(pdf.GetX, y0, pdf.GetX, pdf.GetY)\r
-       pdf.Line(pdf.GetX, pdf.GetY, 170, pdf.GetY)\r
-\r
-    pdf.Ln\r
-    \r
-    if @issue.changesets.any? && User.current.allowed_to?(:view_changesets, issue.project)\r
-       pdf.SetFontStyle('B',9)\r
-           pdf.Cell(190,5, l(:label_associated_revisions), "B")\r
-           pdf.Ln      \r
-               for changeset in @issue.changesets\r
-                       pdf.SetFontStyle('B',8)\r
-                   pdf.Cell(190,5, format_time(changeset.committed_on) + " - " + changeset.committer)\r
-                   pdf.Ln\r
-                       unless changeset.comments.blank?\r
-                               pdf.SetFontStyle('',8)\r
-                               pdf.MultiCell(190,5, changeset.comments)\r
-                       end             \r
-                       pdf.Ln\r
-               end\r
-       end\r
-       \r
-       pdf.SetFontStyle('B',9)\r
-    pdf.Cell(190,5, l(:label_history), "B")\r
-    pdf.Ln     \r
-       for journal in issue.journals.find(:all, :include => [:user, :details], :order => "#{Journal.table_name}.created_on ASC")\r
-               pdf.SetFontStyle('B',8)\r
-           pdf.Cell(190,5, format_time(journal.created_on) + " - " + journal.user.name)\r
-           pdf.Ln\r
-               pdf.SetFontStyle('I',8)\r
-               for detail in journal.details\r
-                       pdf.Cell(190,5, "- " + show_detail(detail, true))\r
-                       pdf.Ln\r
-               end\r
-               if journal.notes?\r
-                       pdf.SetFontStyle('',8)\r
-                       pdf.MultiCell(190,5, journal.notes)\r
-               end             \r
-               pdf.Ln\r
-       end\r
-       \r
-       if issue.attachments.any?\r
-           pdf.SetFontStyle('B',9)\r
-           pdf.Cell(190,5, l(:label_attachment_plural), "B")\r
-               pdf.Ln\r
-               for attachment in issue.attachments\r
-                       pdf.SetFontStyle('',8)\r
-                   pdf.Cell(80,5, attachment.filename)\r
-                       pdf.Cell(20,5, number_to_human_size(attachment.filesize),0,0,"R")\r
-                       pdf.Cell(25,5, format_date(attachment.created_on),0,0,"R")\r
-                       pdf.Cell(65,5, attachment.author.name,0,0,"R")\r
-                       pdf.Ln\r
-               end\r
-       end\r
-%>\r
index 08f2cb92dd6d9bfd6eda3df7d4858521ef29f787..73d9d66b565522b58fc62ec349fc002d58cfc209 100644 (file)
@@ -4,7 +4,123 @@
        pdf.footer_date = format_date(Date.today)\r
        pdf.AddPage\r
        \r
-       render :partial => 'issues/pdf', :locals => { :pdf => pdf, :issue => @issue }\r
+       pdf.SetFontStyle('B',11)        \r
+       pdf.Cell(190,10, "#{@issue.project} - #{@issue.tracker} # #{@issue.id}: #{@issue.subject}")\r
+    pdf.Ln\r
+    \r
+    y0 = pdf.GetY\r
+    \r
+    pdf.SetFontStyle('B',9)\r
+    pdf.Cell(35,5, l(:field_status) + ":","LT")\r
+    pdf.SetFontStyle('',9)\r
+    pdf.Cell(60,5, @issue.status.name,"RT")\r
+    pdf.SetFontStyle('B',9)\r
+    pdf.Cell(35,5, l(:field_priority) + ":","LT")\r
+    pdf.SetFontStyle('',9)\r
+    pdf.Cell(60,5, @issue.priority.name,"RT")        \r
+    pdf.Ln\r
+    \r
+    pdf.SetFontStyle('B',9)\r
+    pdf.Cell(35,5, l(:field_author) + ":","L")\r
+    pdf.SetFontStyle('',9)\r
+    pdf.Cell(60,5, @issue.author.name,"R")\r
+    pdf.SetFontStyle('B',9)\r
+    pdf.Cell(35,5, l(:field_category) + ":","L")\r
+    pdf.SetFontStyle('',9)\r
+    pdf.Cell(60,5, (@issue.category ? @issue.category.name : "-"),"R")\r
+    pdf.Ln   \r
+    \r
+    pdf.SetFontStyle('B',9)\r
+    pdf.Cell(35,5, l(:field_created_on) + ":","L")\r
+    pdf.SetFontStyle('',9)\r
+    pdf.Cell(60,5, format_date(@issue.created_on),"R")\r
+    pdf.SetFontStyle('B',9)\r
+    pdf.Cell(35,5, l(:field_assigned_to) + ":","L")\r
+    pdf.SetFontStyle('',9)\r
+    pdf.Cell(60,5, (@issue.assigned_to ? @issue.assigned_to.name : "-"),"R")\r
+    pdf.Ln\r
+    \r
+    pdf.SetFontStyle('B',9)\r
+    pdf.Cell(35,5, l(:field_updated_on) + ":","LB")\r
+    pdf.SetFontStyle('',9)\r
+    pdf.Cell(60,5, format_date(@issue.updated_on),"RB")\r
+    pdf.SetFontStyle('B',9)\r
+    pdf.Cell(35,5, l(:field_due_date) + ":","LB")\r
+    pdf.SetFontStyle('',9)\r
+    pdf.Cell(60,5, format_date(@issue.due_date),"RB")\r
+    pdf.Ln\r
+    \r
+       for custom_value in @issue.custom_values\r
+           pdf.SetFontStyle('B',9)\r
+           pdf.Cell(35,5, custom_value.custom_field.name + ":","L")\r
+           pdf.SetFontStyle('',9)\r
+           pdf.MultiCell(155,5, (show_value custom_value),"R")\r
+       end\r
+    \r
+    pdf.SetFontStyle('B',9)\r
+    pdf.Cell(35,5, l(:field_subject) + ":","LTB")\r
+    pdf.SetFontStyle('',9)\r
+    pdf.Cell(155,5, @issue.subject,"RTB")\r
+    pdf.Ln    \r
+    \r
+    pdf.SetFontStyle('B',9)\r
+    pdf.Cell(35,5, l(:field_description) + ":")\r
+    pdf.SetFontStyle('',9)\r
+    pdf.MultiCell(155,5, @issue.description,"BR")\r
+    \r
+    pdf.Line(pdf.GetX, y0, pdf.GetX, pdf.GetY)\r
+       pdf.Line(pdf.GetX, pdf.GetY, 170, pdf.GetY)\r
+\r
+    pdf.Ln\r
+    \r
+    if @issue.changesets.any? && User.current.allowed_to?(:view_changesets, @issue.project)\r
+       pdf.SetFontStyle('B',9)\r
+           pdf.Cell(190,5, l(:label_associated_revisions), "B")\r
+           pdf.Ln      \r
+               for changeset in @issue.changesets\r
+                       pdf.SetFontStyle('B',8)\r
+                   pdf.Cell(190,5, format_time(changeset.committed_on) + " - " + changeset.committer)\r
+                   pdf.Ln\r
+                       unless changeset.comments.blank?\r
+                               pdf.SetFontStyle('',8)\r
+                               pdf.MultiCell(190,5, changeset.comments)\r
+                       end             \r
+                       pdf.Ln\r
+               end\r
+       end\r
+       \r
+       pdf.SetFontStyle('B',9)\r
+    pdf.Cell(190,5, l(:label_history), "B")\r
+    pdf.Ln     \r
+       for journal in @issue.journals.find(:all, :include => [:user, :details], :order => "#{Journal.table_name}.created_on ASC")\r
+               pdf.SetFontStyle('B',8)\r
+           pdf.Cell(190,5, format_time(journal.created_on) + " - " + journal.user.name)\r
+           pdf.Ln\r
+               pdf.SetFontStyle('I',8)\r
+               for detail in journal.details\r
+                       pdf.Cell(190,5, "- " + show_detail(detail, true))\r
+                       pdf.Ln\r
+               end\r
+               if journal.notes?\r
+                       pdf.SetFontStyle('',8)\r
+                       pdf.MultiCell(190,5, journal.notes)\r
+               end             \r
+               pdf.Ln\r
+       end\r
+       \r
+       if @issue.attachments.any?\r
+           pdf.SetFontStyle('B',9)\r
+           pdf.Cell(190,5, l(:label_attachment_plural), "B")\r
+               pdf.Ln\r
+               for attachment in @issue.attachments\r
+                       pdf.SetFontStyle('',8)\r
+                   pdf.Cell(80,5, attachment.filename)\r
+                       pdf.Cell(20,5, number_to_human_size(attachment.filesize),0,0,"R")\r
+                       pdf.Cell(25,5, format_date(attachment.created_on),0,0,"R")\r
+                       pdf.Cell(65,5, attachment.author.name,0,0,"R")\r
+                       pdf.Ln\r
+               end\r
+       end\r
 %>\r
 \r
 <%= pdf.Output %>\r