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.done_ratio = (params[:issue][:done_ratio])
#@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
if @issue.update_attributes(params[:issue])
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
end
rescue ActiveRecord::StaleObjectError

View File

@ -17,6 +17,8 @@
class Mailer < ActionMailer::Base
helper IssuesHelper
def issue_add(issue)
# Sends to all project members
@recipients = issue.project.members.collect { |m| m.user.mail if m.user.mail_notification }

View File

@ -1,7 +1,7 @@
Issue #<%= @issue.id %> has been updated.
<%= @journal.user.name %>
<% for detail in @journal.details %>
<%= show_detail(detail) %>
<%= show_detail(detail, true) %>
<% end %>
<%= @journal.notes if @journal.notes? %>
----------------------------------------

View File

@ -1,7 +1,7 @@
Issue #<%= @issue.id %> has been updated.
<%= @journal.user.name %>
<% for detail in @journal.details %>
<%= show_detail(detail) %>
<%= show_detail(detail, true) %>
<% end %>
<%= @journal.notes if @journal.notes? %>
----------------------------------------

View File

@ -1,7 +1,7 @@
Issue #<%= @issue.id %> has been updated.
<%= @journal.user.name %>
<% for detail in @journal.details %>
<%= show_detail(detail) %>
<%= show_detail(detail, true) %>
<% end %>
<%= @journal.notes if @journal.notes? %>
----------------------------------------

View File

@ -1,7 +1,7 @@
La demande #<%= @issue.id %> a été mise à jour.
<%= @journal.user.name %> - <%= format_date(@journal.created_on) %>
<% for detail in @journal.details %>
<%= show_detail(detail) %>
<%= show_detail(detail, true) %>
<% end %>
<%= journal.notes if journal.notes? %>
----------------------------------------