@@ -58,15 +58,17 class IssuesController < ApplicationController | |||
|
58 | 58 | end |
|
59 | 59 | |
|
60 | 60 | def show |
|
61 | @status_options = @issue.status.find_new_statuses_allowed_to(logged_in_user.role_for_project(@project), @issue.tracker) if logged_in_user | |
|
62 | 61 | @custom_values = @issue.custom_values.find(:all, :include => :custom_field) |
|
63 | 62 | @journals = @issue.journals.find(:all, :include => [:user, :details], :order => "#{Journal.table_name}.created_on ASC") |
|
64 | end | |
|
65 | ||
|
66 | def export_pdf | |
|
67 | @custom_values = @issue.custom_values.find(:all, :include => :custom_field) | |
|
68 | @options_for_rfpdf ||= {} | |
|
69 | @options_for_rfpdf[:file_name] = "#{@project.name}_#{@issue.id}.pdf" | |
|
63 | ||
|
64 | if params[:format]=='pdf' | |
|
65 | @options_for_rfpdf ||= {} | |
|
66 | @options_for_rfpdf[:file_name] = "#{@project.identifier}-#{@issue.id}.pdf" | |
|
67 | render :template => 'issues/show.rfpdf', :layout => false | |
|
68 | else | |
|
69 | @status_options = @issue.status.find_new_statuses_allowed_to(logged_in_user.role_for_project(@project), @issue.tracker) if logged_in_user | |
|
70 | render :template => 'issues/show.rhtml' | |
|
71 | end | |
|
70 | 72 | end |
|
71 | 73 | |
|
72 | 74 | def edit |
@@ -70,7 +70,7 | |||
|
70 | 70 | pdf.SetFontStyle('B',9) |
|
71 | 71 | pdf.Cell(190,5, l(:label_history), "B") |
|
72 | 72 | pdf.Ln |
|
73 |
for journal in issue.journals.find(:all, :include => :user, :order => " |
|
|
73 | for journal in issue.journals.find(:all, :include => [:user, :details], :order => "#{Journal.table_name}.created_on ASC") | |
|
74 | 74 | pdf.SetFontStyle('B',8) |
|
75 | 75 | pdf.Cell(190,5, format_time(journal.created_on) + " - " + journal.user.name) |
|
76 | 76 | pdf.Ln |
@@ -86,15 +86,17 | |||
|
86 | 86 | pdf.Ln |
|
87 | 87 | end |
|
88 | 88 | |
|
89 | pdf.SetFontStyle('B',9) | |
|
90 | pdf.Cell(190,5, l(:label_attachment_plural), "B") | |
|
91 | pdf.Ln | |
|
92 | for attachment in issue.attachments | |
|
93 | pdf.SetFontStyle('',8) | |
|
94 | pdf.Cell(80,5, attachment.filename) | |
|
95 | pdf.Cell(20,5, number_to_human_size(attachment.filesize),0,0,"R") | |
|
96 | pdf.Cell(25,5, format_date(attachment.created_on),0,0,"R") | |
|
97 | pdf.Cell(65,5, attachment.author.name,0,0,"R") | |
|
89 | if issue.attachments.any? | |
|
90 | pdf.SetFontStyle('B',9) | |
|
91 | pdf.Cell(190,5, l(:label_attachment_plural), "B") | |
|
98 | 92 | pdf.Ln |
|
93 | for attachment in issue.attachments | |
|
94 | pdf.SetFontStyle('',8) | |
|
95 | pdf.Cell(80,5, attachment.filename) | |
|
96 | pdf.Cell(20,5, number_to_human_size(attachment.filesize),0,0,"R") | |
|
97 | pdf.Cell(25,5, format_date(attachment.created_on),0,0,"R") | |
|
98 | pdf.Cell(65,5, attachment.author.name,0,0,"R") | |
|
99 | pdf.Ln | |
|
100 | end | |
|
99 | 101 | end |
|
100 | %> No newline at end of file | |
|
102 | %> |
@@ -7,4 +7,4 | |||
|
7 | 7 | render :partial => 'issues/pdf', :locals => { :pdf => pdf, :issue => @issue } |
|
8 | 8 | %> |
|
9 | 9 | |
|
10 | <%= pdf.Output %> No newline at end of file | |
|
10 | <%= pdf.Output %> |
@@ -111,7 +111,7 end %> | |||
|
111 | 111 | <% end %> |
|
112 | 112 | |
|
113 | 113 | <div class="contextual"> |
|
114 |
<%= l(:label_export_to) %><%= link_to 'PDF', {:a |
|
|
114 | <%= l(:label_export_to) %><%= link_to 'PDF', {:format => 'pdf'}, :class => 'icon icon-pdf' %> | |
|
115 | 115 | </div> |
|
116 | 116 | |
|
117 | 117 |
@@ -25,7 +25,7 Redmine::AccessControl.map do |map| | |||
|
25 | 25 | map.permission :manage_categories, {:projects => [:settings, :add_issue_category], :issue_categories => [:edit, :destroy]}, :require => :member |
|
26 | 26 | # Issues |
|
27 | 27 | map.permission :view_issues, {:projects => [:list_issues, :export_issues_csv, :export_issues_pdf, :changelog, :roadmap], |
|
28 |
:issues => |
|
|
28 | :issues => :show, | |
|
29 | 29 | :queries => :index, |
|
30 | 30 | :reports => :issue_report}, :public => true |
|
31 | 31 | map.permission :add_issues, {:projects => :add_issue}, :require => :loggedin |
General Comments 0
You need to be logged in to leave comments.
Login now