mailer bug fix

git-svn-id: http://redmine.rubyforge.org/svn/trunk@55 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2006-11-27 22:45:10 +00:00
parent 42181112ff
commit 418b8d861a
6 changed files with 9 additions and 7 deletions

View File

@ -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

View File

@ -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

View File

@ -1,7 +1,7 @@
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? %>
---------------------------------------- ----------------------------------------

View File

@ -1,7 +1,7 @@
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? %>
---------------------------------------- ----------------------------------------

View File

@ -1,7 +1,7 @@
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? %>
---------------------------------------- ----------------------------------------

View File

@ -1,7 +1,7 @@
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? %>
---------------------------------------- ----------------------------------------