end
def show
- @status_options = @issue.status.find_new_statuses_allowed_to(logged_in_user.role_for_project(@project), @issue.tracker) if logged_in_user
@custom_values = @issue.custom_values.find(:all, :include => :custom_field)
@journals = @issue.journals.find(:all, :include => [:user, :details], :order => "#{Journal.table_name}.created_on ASC")
- end
-
- def export_pdf
- @custom_values = @issue.custom_values.find(:all, :include => :custom_field)
- @options_for_rfpdf ||= {}
- @options_for_rfpdf[:file_name] = "#{@project.name}_#{@issue.id}.pdf"
+
+ if params[:format]=='pdf'
+ @options_for_rfpdf ||= {}
+ @options_for_rfpdf[:file_name] = "#{@project.identifier}-#{@issue.id}.pdf"
+ render :template => 'issues/show.rfpdf', :layout => false
+ else
+ @status_options = @issue.status.find_new_statuses_allowed_to(logged_in_user.role_for_project(@project), @issue.tracker) if logged_in_user
+ render :template => 'issues/show.rhtml'
+ end
end
def edit
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, :order => "journals.created_on desc")\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.Ln\r
end\r
\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
+ 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
-%>
\ No newline at end of file
+%>\r
map.permission :manage_categories, {:projects => [:settings, :add_issue_category], :issue_categories => [:edit, :destroy]}, :require => :member
# Issues
map.permission :view_issues, {:projects => [:list_issues, :export_issues_csv, :export_issues_pdf, :changelog, :roadmap],
- :issues => [:show, :export_pdf],
+ :issues => :show,
:queries => :index,
:reports => :issue_report}, :public => true
map.permission :add_issues, {:projects => :add_issue}, :require => :loggedin