Commit 418b8d86 authored by Jean-Philippe Lang's avatar Jean-Philippe Lang

mailer bug fix

git-svn-id: http://redmine.rubyforge.org/svn/trunk@55 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 42181112
...@@ -93,11 +93,11 @@ class IssuesController < ApplicationController ...@@ -93,11 +93,11 @@ class IssuesController < ApplicationController
#@issue.assigned_to_id = (params[:issue][:assigned_to_id]) #@issue.assigned_to_id = (params[:issue][:assigned_to_id])
#@issue.done_ratio = (params[:issue][:done_ratio]) #@issue.done_ratio = (params[:issue][:done_ratio])
#@issue.lock_version = (params[:issue][:lock_version]) #@issue.lock_version = (params[:issue][:lock_version])
@issue.init_journal(self.logged_in_user, params[:notes]) journal = @issue.init_journal(self.logged_in_user, params[:notes])
@issue.status = @new_status @issue.status = @new_status
if @issue.update_attributes(params[:issue]) if @issue.update_attributes(params[:issue])
flash[:notice] = l(:notice_successful_update) flash[:notice] = l(:notice_successful_update)
Mailer.deliver_issue_change_status(@issue) if Permission.find_by_controller_and_action(@params[:controller], @params[:action]).mail_enabled? Mailer.deliver_issue_edit(journal) if Permission.find_by_controller_and_action(@params[:controller], @params[:action]).mail_enabled?
redirect_to :action => 'show', :id => @issue redirect_to :action => 'show', :id => @issue
end end
rescue ActiveRecord::StaleObjectError rescue ActiveRecord::StaleObjectError
......
...@@ -15,7 +15,9 @@ ...@@ -15,7 +15,9 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class Mailer < ActionMailer::Base class Mailer < ActionMailer::Base
helper IssuesHelper
def issue_add(issue) def issue_add(issue)
# Sends to all project members # Sends to all project members
......
Issue #<%= @issue.id %> has been updated. Issue #<%= @issue.id %> has been updated.
<%= @journal.user.name %> <%= @journal.user.name %>
<% for detail in @journal.details %> <% for detail in @journal.details %>
<%= show_detail(detail) %> <%= show_detail(detail, true) %>
<% end %> <% end %>
<%= @journal.notes if @journal.notes? %> <%= @journal.notes if @journal.notes? %>
---------------------------------------- ----------------------------------------
......
Issue #<%= @issue.id %> has been updated. Issue #<%= @issue.id %> has been updated.
<%= @journal.user.name %> <%= @journal.user.name %>
<% for detail in @journal.details %> <% for detail in @journal.details %>
<%= show_detail(detail) %> <%= show_detail(detail, true) %>
<% end %> <% end %>
<%= @journal.notes if @journal.notes? %> <%= @journal.notes if @journal.notes? %>
---------------------------------------- ----------------------------------------
......
Issue #<%= @issue.id %> has been updated. Issue #<%= @issue.id %> has been updated.
<%= @journal.user.name %> <%= @journal.user.name %>
<% for detail in @journal.details %> <% for detail in @journal.details %>
<%= show_detail(detail) %> <%= show_detail(detail, true) %>
<% end %> <% end %>
<%= @journal.notes if @journal.notes? %> <%= @journal.notes if @journal.notes? %>
---------------------------------------- ----------------------------------------
......
La demande #<%= @issue.id %> a été mise à jour. La demande #<%= @issue.id %> a été mise à jour.
<%= @journal.user.name %> - <%= format_date(@journal.created_on) %> <%= @journal.user.name %> - <%= format_date(@journal.created_on) %>
<% for detail in @journal.details %> <% for detail in @journal.details %>
<%= show_detail(detail) %> <%= show_detail(detail, true) %>
<% end %> <% end %>
<%= journal.notes if journal.notes? %> <%= journal.notes if journal.notes? %>
---------------------------------------- ----------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment