Index: app/controllers/issues_controller.rb =================================================================== --- app/controllers/issues_controller.rb (revision 1) +++ app/controllers/issues_controller.rb (working copy) @@ -43,6 +43,10 @@ helper :timelog include Redmine::Export::PDF + verify :method => :post, + :only => :destroy, + :render => { :nothing => true, :status => :method_not_allowed } + def index retrieve_query sort_init 'id', 'desc' @@ -102,10 +106,11 @@ @edit_allowed = User.current.allowed_to?(:edit_issues, @project) @priorities = Enumeration::get_values('IPRI') @time_entry = TimeEntry.new + @show_history = params[:show_history] == 'true' respond_to do |format| format.html { render :template => 'issues/show.rhtml' } format.atom { render :action => 'changes', :layout => false, :content_type => 'application/atom+xml' } - format.pdf { send_data(issue_to_pdf(@issue), :type => 'application/pdf', :filename => "#{@project.identifier}-#{@issue.id}.pdf") } + format.pdf { send_data(issue_to_pdf(@issue, @show_history), :type => 'application/pdf', :filename => "#{@project.identifier}-#{@issue.id}.pdf") } end end @@ -147,6 +152,7 @@ attach_files(@issue, params[:attachments]) flash[:notice] = l(:notice_successful_create) Mailer.deliver_issue_add(@issue) if Setting.notified_events.include?('issue_added') + call_hook(:controller_issues_new_after_save, { :params => params, :issue => @issue}) redirect_to(params[:continue] ? { :action => 'new', :tracker_id => @issue.tracker } : { :action => 'show', :id => @issue }) return @@ -194,6 +200,7 @@ flash[:notice] = l(:notice_successful_update) Mailer.deliver_issue_edit(journal) if Setting.notified_events.include?('issue_updated') end + call_hook(:controller_issues_edit_after_save, { :params => params, :issue => @issue, :time_entry => @time_entry, :journal => journal}) redirect_to(params[:back_to] || {:action => 'show', :id => @issue}) end end Index: app/views/issues/show.rhtml =================================================================== --- app/views/issues/show.rhtml (revision 1) +++ app/views/issues/show.rhtml (working copy) @@ -5,6 +5,11 @@ <%= link_to_if_authorized l(:button_copy), {:controller => 'issues', :action => 'new', :project_id => @project, :copy_from => @issue }, :class => 'icon icon-copy' %> <%= link_to_if_authorized l(:button_move), {:controller => 'issues', :action => 'move', :id => @issue }, :class => 'icon icon-move' %> <%= link_to_if_authorized l(:button_delete), {:controller => 'issues', :action => 'destroy', :id => @issue}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %> +<% if @show_history %> +<%= link_to l(:button_hide_history), {:show_history => 'false'}, :class => 'icon icon-hide_history' %> +<% else %> +<%= link_to l(:button_show_history), {:show_history => 'true'}, :class => 'icon icon-show_history' %> +<% end %>

<%= @issue.tracker.name %> #<%= @issue.id %>

@@ -95,12 +100,15 @@ <% end %> +<% if @show_history %> <% if @journals.any? %>

<%=l(:label_history)%>

<%= render :partial => 'history', :locals => { :journals => @journals } %>
<% end %> +<% end %> +
<% if authorize_for('issues', 'edit') %> @@ -113,7 +121,7 @@

<%= l(:label_export_to) %> <%= link_to 'Atom', {:format => 'atom', :key => User.current.rss_key}, :class => 'feed' %> -<%= link_to 'PDF', {:format => 'pdf'}, :class => 'pdf' %> +<%= link_to 'PDF', {:format => 'pdf',:show_history => @show_history == true ? 'true' : 'false'}, :class => 'pdf' %>

<% html_title "#{@issue.tracker.name} ##{@issue.id}: #{@issue.subject}" %> Index: lib/redmine/export/pdf.rb =================================================================== --- lib/redmine/export/pdf.rb (revision 1) +++ lib/redmine/export/pdf.rb (working copy) @@ -153,7 +153,7 @@ end # Returns a PDF string of a single issue - def issue_to_pdf(issue) + def issue_to_pdf(issue, show_history) pdf = IFPDF.new(current_language) pdf.SetTitle("#{issue.project} - ##{issue.tracker} #{issue.id}") pdf.AliasNbPages @@ -244,23 +244,25 @@ end end - pdf.SetFontStyle('B',9) - pdf.Cell(190,5, l(:label_history), "B") - pdf.Ln - for journal in issue.journals.find(:all, :include => [:user, :details], :order => "#{Journal.table_name}.created_on ASC") - pdf.SetFontStyle('B',8) - pdf.Cell(190,5, format_time(journal.created_on) + " - " + journal.user.name) - pdf.Ln - pdf.SetFontStyle('I',8) - for detail in journal.details - pdf.Cell(190,5, "- " + show_detail(detail, true)) + if show_history + pdf.SetFontStyle('B',9) + pdf.Cell(190,5, l(:label_history), "B") + pdf.Ln + for journal in issue.journals.find(:all, :include => [:user, :details], :order => "#{Journal.table_name}.created_on ASC") + pdf.SetFontStyle('B',8) + pdf.Cell(190,5, format_time(journal.created_on) + " - " + journal.user.name) pdf.Ln + pdf.SetFontStyle('I',8) + for detail in journal.details + pdf.Cell(190,5, "- " + show_detail(detail, true)) + pdf.Ln + end + if journal.notes? + pdf.SetFontStyle('',8) + pdf.MultiCell(190,5, journal.notes) + end + pdf.Ln end - if journal.notes? - pdf.SetFontStyle('',8) - pdf.MultiCell(190,5, journal.notes) - end - pdf.Ln end if issue.attachments.any? Index: public/images/show_history.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: public/images/show_history.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: public/images/hide_history.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: public/images/hide_history.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: public/stylesheets/application.css =================================================================== --- public/stylesheets/application.css (revision 1) +++ public/stylesheets/application.css (working copy) @@ -76,7 +76,7 @@ a:hover, a:active{ color: #c61a1a; text-decoration: underline;} a img{ border: 0; } -a.issue.closed, a.issue.closed:link, a.issue.closed:visited { text-decoration: line-through; } +a.issue.closed, a.issue.closed:link, a.issue.closed:visited { color: #999; text-decoration: line-through; } /***** Tables *****/ table.list { border: 1px solid #e4e4e4; border-collapse: collapse; width: 100%; margin-bottom: 4px; } @@ -619,6 +619,8 @@ .icon-details { background-image: url(../images/zoom_in.png); } .icon-report { background-image: url(../images/report.png); } .icon-comment { background-image: url(../images/comment.png); } +.icon-show_history { background-image: url(../images/show_history.png); } +.icon-hide_history { background-image: url(../images/hide_history.png); } .icon22-projects { background-image: url(../images/22x22/projects.png); } .icon22-users { background-image: url(../images/22x22/users.png); }