Host setting should contain the path prefix (Redmine base URL) to properly generate links in emails that are sent offline (#2122).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@1989 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2008-11-07 15:37:17 +00:00
parent 4581baa5c0
commit 006337fb0e
5 changed files with 36 additions and 29 deletions

View File

@ -39,6 +39,9 @@ class SettingsController < ApplicationController
@options = {}
@options[:user_format] = User::USER_FORMATS.keys.collect {|f| [User.current.name(f), f.to_s] }
@deliveries = ActionMailer::Base.perform_deliveries
@guessed_host_and_path = request.host_with_port
@guessed_host_and_path << ('/'+ request.relative_url_root.gsub(%r{^\/}, '')) unless request.relative_url_root.blank?
end
def plugin

View File

@ -185,6 +185,7 @@ class Mailer < ActionMailer::Base
from Setting.mail_from
default_url_options[:host] = Setting.host_name
default_url_options[:protocol] = Setting.protocol
default_url_options[:skip_relative_url_root] = true
# Common headers
headers 'X-Mailer' => 'Redmine',
'X-Redmine-Host' => Setting.host_name,

View File

@ -33,7 +33,8 @@
<%= text_field_tag 'settings[activity_days_default]', Setting.activity_days_default, :size => 6 %> <%= l(:label_day_plural) %></p>
<p><label><%= l(:setting_host_name) %></label>
<%= text_field_tag 'settings[host_name]', Setting.host_name, :size => 60 %></p>
<%= text_field_tag 'settings[host_name]', Setting.host_name, :size => 60 %><br />
<em><%= l(:label_example) %>: <%= @guessed_host_and_path %></em></p>
<p><label><%= l(:setting_protocol) %></label>
<%= select_tag 'settings[protocol]', options_for_select(['http', 'https'], Setting.protocol) %></p>

View File

@ -196,7 +196,7 @@ setting_issues_export_limit: Issues export limit
setting_mail_from: Emission email address
setting_bcc_recipients: Blind carbon copy recipients (bcc)
setting_plain_text_mail: plain text mail (no HTML)
setting_host_name: Host name
setting_host_name: Host name and path
setting_text_formatting: Text formatting
setting_wiki_compression: Wiki history compression
setting_feeds_limit: Feed content limit
@ -576,6 +576,7 @@ label_planning: Planning
label_incoming_emails: Incoming emails
label_generate_key: Generate a key
label_issue_watchers: Watchers
label_example: Example
button_login: Login
button_submit: Submit

View File

@ -197,7 +197,7 @@ setting_issues_export_limit: Limite export demandes
setting_mail_from: Adresse d'émission
setting_bcc_recipients: Destinataires en copie cachée (cci)
setting_plain_text_mail: Mail texte brut (non HTML)
setting_host_name: Nom d'hôte
setting_host_name: Nom d'hôte et chemin
setting_text_formatting: Formatage du texte
setting_wiki_compression: Compression historique wiki
setting_feeds_limit: Limite du contenu des flux RSS
@ -576,6 +576,7 @@ label_planning: Planning
label_incoming_emails: Emails entrants
label_generate_key: Générer une clé
label_issue_watchers: Utilisateurs surveillant cette demande
label_example: Exemple
button_login: Connexion
button_submit: Soumettre