Removed translated email templates attachments_added and document_added (no longer usefull).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@834 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
0682b8cfc4
commit
dead6a28f8
|
@ -52,7 +52,7 @@ class DocumentsController < ApplicationController
|
||||||
a = Attachment.create(:container => @document, :file => file, :author => logged_in_user)
|
a = Attachment.create(:container => @document, :file => file, :author => logged_in_user)
|
||||||
@attachments << a unless a.new_record?
|
@attachments << a unless a.new_record?
|
||||||
} if params[:attachments] and params[:attachments].is_a? Array
|
} if params[:attachments] and params[:attachments].is_a? Array
|
||||||
Mailer.deliver_attachments_add(@attachments) if !@attachments.empty? && Setting.notified_events.include?('document_added')
|
Mailer.deliver_attachments_added(@attachments) if !@attachments.empty? && Setting.notified_events.include?('document_added')
|
||||||
redirect_to :action => 'show', :id => @document
|
redirect_to :action => 'show', :id => @document
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -182,7 +182,7 @@ class ProjectsController < ApplicationController
|
||||||
Attachment.create(:container => @document, :file => a, :author => logged_in_user) unless a.size == 0
|
Attachment.create(:container => @document, :file => a, :author => logged_in_user) unless a.size == 0
|
||||||
} if params[:attachments] and params[:attachments].is_a? Array
|
} if params[:attachments] and params[:attachments].is_a? Array
|
||||||
flash[:notice] = l(:notice_successful_create)
|
flash[:notice] = l(:notice_successful_create)
|
||||||
Mailer.deliver_document_add(@document) if Setting.notified_events.include?('document_added')
|
Mailer.deliver_document_added(@document) if Setting.notified_events.include?('document_added')
|
||||||
redirect_to :action => 'list_documents', :id => @project
|
redirect_to :action => 'list_documents', :id => @project
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -449,7 +449,7 @@ class ProjectsController < ApplicationController
|
||||||
a = Attachment.create(:container => @version, :file => file, :author => logged_in_user)
|
a = Attachment.create(:container => @version, :file => file, :author => logged_in_user)
|
||||||
@attachments << a unless a.new_record?
|
@attachments << a unless a.new_record?
|
||||||
} if params[:attachments] and params[:attachments].is_a? Array
|
} if params[:attachments] and params[:attachments].is_a? Array
|
||||||
Mailer.deliver_attachments_add(@attachments) if !@attachments.empty? && Setting.notified_events.include?('file_added')
|
Mailer.deliver_attachments_added(@attachments) if !@attachments.empty? && Setting.notified_events.include?('file_added')
|
||||||
redirect_to :controller => 'projects', :action => 'list_files', :id => @project
|
redirect_to :controller => 'projects', :action => 'list_files', :id => @project
|
||||||
end
|
end
|
||||||
@versions = @project.versions.sort
|
@versions = @project.versions.sort
|
||||||
|
|
|
@ -60,7 +60,7 @@ class Mailer < ActionMailer::Base
|
||||||
@body['journal']= journal
|
@body['journal']= journal
|
||||||
end
|
end
|
||||||
|
|
||||||
def document_add(document)
|
def document_added(document)
|
||||||
set_language_if_valid(Setting.default_language)
|
set_language_if_valid(Setting.default_language)
|
||||||
@recipients = document.project.users.collect { |u| u.mail if u.mail_notification }.compact
|
@recipients = document.project.users.collect { |u| u.mail if u.mail_notification }.compact
|
||||||
@from = Setting.mail_from
|
@from = Setting.mail_from
|
||||||
|
@ -68,21 +68,18 @@ class Mailer < ActionMailer::Base
|
||||||
@body['document'] = document
|
@body['document'] = document
|
||||||
end
|
end
|
||||||
|
|
||||||
def attachments_add(attachments)
|
def attachments_added(attachments)
|
||||||
set_language_if_valid(Setting.default_language)
|
set_language_if_valid(Setting.default_language)
|
||||||
container = attachments.first.container
|
container = attachments.first.container
|
||||||
url = ''
|
url = ''
|
||||||
added_to = ''
|
added_to = ''
|
||||||
case container.class.name
|
case container.class.name
|
||||||
when 'Version'
|
when 'Version'
|
||||||
url = url_for(:only_path => false, :host => Setting.host_name, :controller => 'projects', :action => 'list_files', :id => container.project_id)
|
url = {:only_path => false, :host => Setting.host_name, :controller => 'projects', :action => 'list_files', :id => container.project_id}
|
||||||
added_to = "#{l(:label_version)}: #{container.name}"
|
added_to = "#{l(:label_version)}: #{container.name}"
|
||||||
when 'Document'
|
when 'Document'
|
||||||
url = url_for(:only_path => false, :host => Setting.host_name, :controller => 'documents', :action => 'show', :id => container.id)
|
url = {:only_path => false, :host => Setting.host_name, :controller => 'documents', :action => 'show', :id => container.id}
|
||||||
added_to = "#{l(:label_document)}: #{container.title}"
|
added_to = "#{l(:label_document)}: #{container.title}"
|
||||||
when 'Issue'
|
|
||||||
url = url = url_for(:only_path => false, :host => Setting.host_name, :controller => 'issues', :action => 'show', :id => container.id)
|
|
||||||
added_to = "#{container.tracker.name} ##{container.id}: #{container.subject}"
|
|
||||||
end
|
end
|
||||||
@recipients = container.project.users.collect { |u| u.mail if u.mail_notification }.compact
|
@recipients = container.project.users.collect { |u| u.mail if u.mail_notification }.compact
|
||||||
@from = Setting.mail_from
|
@from = Setting.mail_from
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
<%= @added_to %>
|
|
||||||
<%= @attachments.size %> files(s) added.
|
|
||||||
<% @attachments.each do |attachment | %>
|
|
||||||
- <%= attachment.filename %><% end %>
|
|
||||||
|
|
||||||
<%= @url %>
|
|
|
@ -1,6 +0,0 @@
|
||||||
<%= @added_to %>
|
|
||||||
<%= @attachments.size %> файл(а) добавени.
|
|
||||||
<% @attachments.each do |attachment | %>
|
|
||||||
- <%= attachment.filename %><% end %>
|
|
||||||
|
|
||||||
<%= @url %>
|
|
|
@ -1,6 +0,0 @@
|
||||||
<%= @added_to %>
|
|
||||||
<%= @attachments.size %> files(s) added.
|
|
||||||
<% @attachments.each do |attachment | %>
|
|
||||||
- <%= attachment.filename %><% end %>
|
|
||||||
|
|
||||||
<%= @url %>
|
|
|
@ -1,6 +0,0 @@
|
||||||
<%= @added_to %>
|
|
||||||
<%= @attachments.size %> fichier(s) ajouté(s).
|
|
||||||
<% @attachments.each do |attachment | %>
|
|
||||||
- <%= attachment.filename %><% end %>
|
|
||||||
|
|
||||||
<%= @url %>
|
|
|
@ -1,6 +0,0 @@
|
||||||
<%= @added_to %>
|
|
||||||
<%= @attachments.size %> file aggiunti.
|
|
||||||
<% @attachments.each do |attachment | %>
|
|
||||||
- <%= attachment.filename %><% end %>
|
|
||||||
|
|
||||||
<%= @url %>
|
|
|
@ -1,6 +0,0 @@
|
||||||
<%= @added_to %>
|
|
||||||
<%= @attachments.size %> ファイルが追加されました。
|
|
||||||
<% @attachments.each do |attachment | %>
|
|
||||||
- <%= attachment.filename %><% end %>
|
|
||||||
|
|
||||||
<%= @url %>
|
|
|
@ -1,6 +0,0 @@
|
||||||
<%= @added_to %>
|
|
||||||
<%= @attachments.size %> bestand(en) toegevoegd.
|
|
||||||
<% @attachments.each do |attachment | %>
|
|
||||||
- <%= attachment.filename %><% end %>
|
|
||||||
|
|
||||||
<%= @url %>
|
|
|
@ -1,6 +0,0 @@
|
||||||
<%= @added_to %>
|
|
||||||
<%= @attachments.size %> plik(ów) dodane.
|
|
||||||
<% @attachments.each do |attachment | %>
|
|
||||||
- <%= attachment.filename %><% end %>
|
|
||||||
|
|
||||||
<%= @url %>
|
|
|
@ -1,6 +0,0 @@
|
||||||
<%= @added_to %>
|
|
||||||
<%= @attachments.size %> arquivo(s) adicionado.
|
|
||||||
<% @attachments.each do |attachment | %>
|
|
||||||
- <%= attachment.filename %><% end %>
|
|
||||||
|
|
||||||
<%= @url %>
|
|
|
@ -1,6 +0,0 @@
|
||||||
<%= @added_to %>
|
|
||||||
<%= @attachments.size %> arquivo(s) adicionado.
|
|
||||||
<% @attachments.each do |attachment | %>
|
|
||||||
- <%= attachment.filename %><% end %>
|
|
||||||
|
|
||||||
<%= @url %>
|
|
|
@ -1,6 +0,0 @@
|
||||||
<%= @added_to %>
|
|
||||||
<%= @attachments.size %> fil(er) tillagda.
|
|
||||||
<% @attachments.each do |attachment | %>
|
|
||||||
- <%= attachment.filename %><% end %>
|
|
||||||
|
|
||||||
<%= @url %>
|
|
|
@ -1,6 +0,0 @@
|
||||||
<%= @added_to %>
|
|
||||||
已添加<%= @attachments.size %> 个文件.
|
|
||||||
<% @attachments.each do |attachment | %>
|
|
||||||
- <%= attachment.filename %><% end %>
|
|
||||||
|
|
||||||
<%= @url %>
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
<%= link_to @added_to, @url %><br />
|
||||||
|
|
||||||
|
<ul><% @attachments.each do |attachment | %>
|
||||||
|
<li><%= attachment.filename %></li>
|
||||||
|
<% end %></ul>
|
|
@ -0,0 +1,4 @@
|
||||||
|
<%= @added_to %><% @attachments.each do |attachment | %>
|
||||||
|
- <%= attachment.filename %><% end %>
|
||||||
|
|
||||||
|
<%= url_for @url %>
|
|
@ -1,4 +0,0 @@
|
||||||
A document has been added to <%= @document.project.name %> (<%= @document.category.name %>):
|
|
||||||
<%= l(:field_title) %>: <%= @document.title %>
|
|
||||||
|
|
||||||
<%= url_for :only_path => false, :host => Setting.host_name, :controller => 'documents', :action => 'show', :id => @document %>
|
|
|
@ -1,4 +0,0 @@
|
||||||
Добавен е документ в <%= @document.project.name %> (<%= @document.category.name %>):
|
|
||||||
<%= l(:field_title) %>: <%= @document.title %>
|
|
||||||
|
|
||||||
<%= url_for :only_path => false, :host => Setting.host_name, :controller => 'documents', :action => 'show', :id => @document %>
|
|
|
@ -1,4 +0,0 @@
|
||||||
Ein Dokument wurde hinzugefügt: <%= @document.project.name %> (<%= @document.category.name %>):
|
|
||||||
<%= l(:field_title) %>: <%= @document.title %>
|
|
||||||
|
|
||||||
<%= url_for :only_path => false, :host => Setting.host_name, :controller => 'documents', :action => 'show', :id => @document %>
|
|
|
@ -1,4 +0,0 @@
|
||||||
Un document a été ajouté à <%= @document.project.name %> (<%= @document.category.name %>):
|
|
||||||
<%= l(:field_title) %>: <%= @document.title %>
|
|
||||||
|
|
||||||
<%= url_for :only_path => false, :host => Setting.host_name, :controller => 'documents', :action => 'show', :id => @document %>
|
|
|
@ -1,4 +0,0 @@
|
||||||
Un documento e' stato aggiunto a <%= @document.project.name %> (<%= @document.category.name %>):
|
|
||||||
<%= l(:field_title) %>: <%= @document.title %>
|
|
||||||
|
|
||||||
<%= url_for :only_path => false, :host => Setting.host_name, :controller => 'documents', :action => 'show', :id => @document %>
|
|
|
@ -1,4 +0,0 @@
|
||||||
文書が <%= @document.project.name %> (<%= @document.category.name %>) に追加されました:
|
|
||||||
<%= l(:field_title) %>: <%= @document.title %>
|
|
||||||
|
|
||||||
<%= url_for :only_path => false, :host => Setting.host_name, :controller => 'documents', :action => 'show', :id => @document %>
|
|
|
@ -1,4 +0,0 @@
|
||||||
Een document is toegevoegd aan <%= @document.project.name %> (<%= @document.category.name %>):
|
|
||||||
<%= l(:field_title) %>: <%= @document.title %>
|
|
||||||
|
|
||||||
<%= url_for :only_path => false, :host => Setting.host_name, :controller => 'documents', :action => 'show', :id => @document %>
|
|
|
@ -1,4 +0,0 @@
|
||||||
Dokument został dodany do <%= @document.project.name %> (<%= @document.category.name %>):
|
|
||||||
<%= l(:field_title) %>: <%= @document.title %>
|
|
||||||
|
|
||||||
http://<%= Setting.host_name %>/documents/show/<%= @document.id %>
|
|
|
@ -1,4 +0,0 @@
|
||||||
Um documento foi adicionado no projeto <%= @document.project.name %> (<%= @document.category.name %>):
|
|
||||||
<%= l(:field_title) %>: <%= @document.title %>
|
|
||||||
|
|
||||||
<%= url_for :only_path => false, :host => Setting.host_name, :controller => 'documents', :action => 'show', :id => @document %>
|
|
|
@ -1,4 +0,0 @@
|
||||||
Um documento foi adicionado no projeto <%= @document.project.name %> (<%= @document.category.name %>):
|
|
||||||
<%= l(:field_title) %>: <%= @document.title %>
|
|
||||||
|
|
||||||
<%= url_for :only_path => false, :host => Setting.host_name, :controller => 'documents', :action => 'show', :id => @document %>
|
|
|
@ -1,4 +0,0 @@
|
||||||
Ett dokument har lagts till i <%= @document.project.name %> (<%= @document.category.name %>):
|
|
||||||
<%= l(:field_title) %>: <%= @document.title %>
|
|
||||||
|
|
||||||
<%= url_for :only_path => false, :host => Setting.host_name, :controller => 'documents', :action => 'show', :id => @document %>
|
|
|
@ -1,4 +0,0 @@
|
||||||
<EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD><EFBFBD>ѱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>뵽<EFBFBD><EFBFBD>Ŀ<EFBFBD><EFBFBD> <%= @document.project.name %> (<%= @document.category.name %>):
|
|
||||||
<%= l(:field_title) %>: <%= @document.title %>
|
|
||||||
|
|
||||||
<%= url_for :only_path => false, :host => Setting.host_name, :controller => 'documents', :action => 'show', :id => @document %>
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
<%= link_to @document.title, :only_path => false, :host => Setting.host_name, :controller => 'documents', :action => 'show', :id => @document %>
|
||||||
|
(<%= @document.category.name %>)<br />
|
||||||
|
<br />
|
||||||
|
<%= textilizable(@document.description) %>
|
|
@ -0,0 +1,4 @@
|
||||||
|
<%= @document.title %> (<%= @document.category.name %>)
|
||||||
|
<%= url_for :only_path => false, :host => Setting.host_name, :controller => 'documents', :action => 'show', :id => @document %>
|
||||||
|
|
||||||
|
<%= @document.description %>
|
|
@ -41,7 +41,7 @@ class MailerTest < Test::Unit::TestCase
|
||||||
document = Document.find(1)
|
document = Document.find(1)
|
||||||
GLoc.valid_languages.each do |lang|
|
GLoc.valid_languages.each do |lang|
|
||||||
Setting.default_language = lang.to_s
|
Setting.default_language = lang.to_s
|
||||||
assert Mailer.deliver_document_add(document)
|
assert Mailer.deliver_document_added(document)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue