@@ -48,8 +48,9 class AdminController < ApplicationController | |||||
48 | def mail_options |
|
48 | def mail_options | |
49 | @notifiables = %w(issue_added issue_updated news_added document_added file_added message_posted) |
|
49 | @notifiables = %w(issue_added issue_updated news_added document_added file_added message_posted) | |
50 | if request.post? |
|
50 | if request.post? | |
51 |
|
|
51 | settings = (params[:settings] || {}).dup | |
52 | Setting.emails_footer = params[:emails_footer] if params[:emails_footer] |
|
52 | settings[:notified_events] ||= [] | |
|
53 | settings.each { |name, value| Setting[name] = value } | |||
53 | flash[:notice] = l(:notice_successful_update) |
|
54 | flash[:notice] = l(:notice_successful_update) | |
54 | redirect_to :controller => 'admin', :action => 'mail_options' |
|
55 | redirect_to :controller => 'admin', :action => 'mail_options' | |
55 | end |
|
56 | end |
@@ -129,11 +129,20 class Mailer < ActionMailer::Base | |||||
129 | default_url_options[:protocol] = Setting.protocol |
|
129 | default_url_options[:protocol] = Setting.protocol | |
130 | end |
|
130 | end | |
131 |
|
131 | |||
132 | # Overrides the create_mail method to remove the current user from the recipients and cc |
|
132 | # Overrides the create_mail method | |
133 | # if he doesn't want to receive notifications about what he does |
|
|||
134 | def create_mail |
|
133 | def create_mail | |
135 | recipients.delete(User.current.mail) if recipients && User.current.pref[:no_self_notified] |
|
134 | # Removes the current user from the recipients and cc | |
136 | cc.delete(User.current.mail) if cc && User.current.pref[:no_self_notified] |
|
135 | # if he doesn't want to receive notifications about what he does | |
|
136 | if User.current.pref[:no_self_notified] | |||
|
137 | recipients.delete(User.current.mail) if recipients | |||
|
138 | cc.delete(User.current.mail) if cc | |||
|
139 | end | |||
|
140 | # Blind carbon copy recipients | |||
|
141 | if Setting.bcc_recipients? | |||
|
142 | bcc([recipients, cc].flatten.compact.uniq) | |||
|
143 | recipients [] | |||
|
144 | cc [] | |||
|
145 | end | |||
137 | super |
|
146 | super | |
138 | end |
|
147 | end | |
139 |
|
148 |
@@ -6,16 +6,25 | |||||
6 |
|
6 | |||
7 | <% form_tag({:action => 'mail_options'}, :id => 'mail-options-form') do %> |
|
7 | <% form_tag({:action => 'mail_options'}, :id => 'mail-options-form') do %> | |
8 |
|
8 | |||
|
9 | <fieldset class="box tabular settings"><legend><%=l(:label_settings)%></legend> | |||
|
10 | <p><label><%= l(:setting_mail_from) %></label> | |||
|
11 | <%= text_field_tag 'settings[mail_from]', Setting.mail_from, :size => 60 %></p> | |||
|
12 | ||||
|
13 | <p><label><%= l(:setting_bcc_recipients) %></label> | |||
|
14 | <%= check_box_tag 'settings[bcc_recipients]', 1, Setting.bcc_recipients? %> | |||
|
15 | <%= hidden_field_tag 'settings[bcc_recipients]', 0 %></p> | |||
|
16 | </fieldset> | |||
|
17 | ||||
9 | <fieldset class="box"><legend><%=l(:text_select_mail_notifications)%></legend> |
|
18 | <fieldset class="box"><legend><%=l(:text_select_mail_notifications)%></legend> | |
10 | <% @notifiables.each do |notifiable| %> |
|
19 | <% @notifiables.each do |notifiable| %> | |
11 |
<label><%= check_box_tag |
|
20 | <label><%= check_box_tag 'settings[notified_events][]', notifiable, Setting.notified_events.include?(notifiable) %> | |
12 | <%= notifiable.humanize %></label><br /> |
|
21 | <%= notifiable.humanize %></label><br /> | |
13 | <% end %> |
|
22 | <% end %> | |
14 | <p><%= check_all_links('mail-options-form') %></p> |
|
23 | <p><%= check_all_links('mail-options-form') %></p> | |
15 | </fieldset> |
|
24 | </fieldset> | |
16 |
|
25 | |||
17 | <fieldset class="box"><legend><%= l(:setting_emails_footer) %></legend> |
|
26 | <fieldset class="box"><legend><%= l(:setting_emails_footer) %></legend> | |
18 | <%= text_area_tag 'emails_footer', Setting.emails_footer, :class => 'wiki-edit', :rows => 5 %> |
|
27 | <%= text_area_tag 'settings[emails_footer]', Setting.emails_footer, :class => 'wiki-edit', :rows => 5 %> | |
19 | </fieldset> |
|
28 | </fieldset> | |
20 |
|
29 | |||
21 | <%= submit_tag l(:button_save) %> |
|
30 | <%= submit_tag l(:button_save) %> |
@@ -1,8 +1,7 | |||||
1 | <h2><%= l(:label_settings) %></h2> |
|
1 | <h2><%= l(:label_settings) %></h2> | |
2 |
|
2 | |||
3 | <div id="settings"> |
|
|||
4 | <% form_tag({:action => 'edit'}) do %> |
|
3 | <% form_tag({:action => 'edit'}) do %> | |
5 | <div class="box tabular"> |
|
4 | <div class="box tabular settings"> | |
6 | <p><label><%= l(:setting_app_title) %></label> |
|
5 | <p><label><%= l(:setting_app_title) %></label> | |
7 | <%= text_field_tag 'settings[app_title]', Setting.app_title, :size => 30 %></p> |
|
6 | <%= text_field_tag 'settings[app_title]', Setting.app_title, :size => 30 %></p> | |
8 |
|
7 | |||
@@ -34,9 +33,6 | |||||
34 | <p><label><%= l(:setting_cross_project_issue_relations) %></label> |
|
33 | <p><label><%= l(:setting_cross_project_issue_relations) %></label> | |
35 | <%= check_box_tag 'settings[cross_project_issue_relations]', 1, Setting.cross_project_issue_relations? %><%= hidden_field_tag 'settings[cross_project_issue_relations]', 0 %></p> |
|
34 | <%= check_box_tag 'settings[cross_project_issue_relations]', 1, Setting.cross_project_issue_relations? %><%= hidden_field_tag 'settings[cross_project_issue_relations]', 0 %></p> | |
36 |
|
35 | |||
37 | <p><label><%= l(:setting_mail_from) %></label> |
|
|||
38 | <%= text_field_tag 'settings[mail_from]', Setting.mail_from, :size => 60 %></p> |
|
|||
39 |
|
||||
40 | <p><label><%= l(:setting_host_name) %></label> |
|
36 | <p><label><%= l(:setting_host_name) %></label> | |
41 | <%= text_field_tag 'settings[host_name]', Setting.host_name, :size => 60 %></p> |
|
37 | <%= text_field_tag 'settings[host_name]', Setting.host_name, :size => 60 %></p> | |
42 |
|
38 | |||
@@ -101,5 +97,4 | |||||
101 | </fieldset> |
|
97 | </fieldset> | |
102 |
|
98 | |||
103 | <%= submit_tag l(:button_save) %> |
|
99 | <%= submit_tag l(:button_save) %> | |
104 | </div> |
|
|||
105 | <% end %> |
|
100 | <% end %> |
@@ -39,6 +39,8 issues_export_limit: | |||||
39 | default: 500 |
|
39 | default: 500 | |
40 | mail_from: |
|
40 | mail_from: | |
41 | default: redmine@somenet.foo |
|
41 | default: redmine@somenet.foo | |
|
42 | bcc_recipients: | |||
|
43 | default: 1 | |||
42 | text_formatting: |
|
44 | text_formatting: | |
43 | default: textile |
|
45 | default: textile | |
44 | wiki_compression: |
|
46 | wiki_compression: |
@@ -546,3 +546,4 label_registration_manual_activation: manual account activation | |||||
546 | notice_account_pending: "Your account was created and is now pending administrator approval." |
|
546 | notice_account_pending: "Your account was created and is now pending administrator approval." | |
547 | field_time_zone: Time zone |
|
547 | field_time_zone: Time zone | |
548 | text_caracters_minimum: Must be at least %d characters long. |
|
548 | text_caracters_minimum: Must be at least %d characters long. | |
|
549 | setting_bcc_recipients: Blind carbon copy recipients (bcc) |
@@ -546,3 +546,4 label_registration_manual_activation: manual account activation | |||||
546 | notice_account_pending: "Your account was created and is now pending administrator approval." |
|
546 | notice_account_pending: "Your account was created and is now pending administrator approval." | |
547 | field_time_zone: Time zone |
|
547 | field_time_zone: Time zone | |
548 | text_caracters_minimum: Must be at least %d characters long. |
|
548 | text_caracters_minimum: Must be at least %d characters long. | |
|
549 | setting_bcc_recipients: Blind carbon copy recipients (bcc) |
@@ -546,3 +546,4 label_registration_manual_activation: Manuelle Kontoaktivierung | |||||
546 | notice_account_pending: "Ihr Konto wurde erstellt und wartet jetzt auf die Genehmigung des Administrators." |
|
546 | notice_account_pending: "Ihr Konto wurde erstellt und wartet jetzt auf die Genehmigung des Administrators." | |
547 | field_time_zone: Zeitzone |
|
547 | field_time_zone: Zeitzone | |
548 | text_caracters_minimum: Muss mindestens %d Zeichen lang sein. |
|
548 | text_caracters_minimum: Muss mindestens %d Zeichen lang sein. | |
|
549 | setting_bcc_recipients: Blind carbon copy recipients (bcc) |
@@ -180,6 +180,7 setting_self_registration: Self-registration | |||||
180 | setting_attachment_max_size: Attachment max. size |
|
180 | setting_attachment_max_size: Attachment max. size | |
181 | setting_issues_export_limit: Issues export limit |
|
181 | setting_issues_export_limit: Issues export limit | |
182 | setting_mail_from: Emission email address |
|
182 | setting_mail_from: Emission email address | |
|
183 | setting_bcc_recipients: Blind carbon copy recipients (bcc) | |||
183 | setting_host_name: Host name |
|
184 | setting_host_name: Host name | |
184 | setting_text_formatting: Text formatting |
|
185 | setting_text_formatting: Text formatting | |
185 | setting_wiki_compression: Wiki history compression |
|
186 | setting_wiki_compression: Wiki history compression |
@@ -549,3 +549,4 label_registration_automatic_activation: activación automática de cuenta | |||||
549 | label_registration_manual_activation: activación manual de cuenta |
|
549 | label_registration_manual_activation: activación manual de cuenta | |
550 | notice_account_pending: "Su cuenta ha sido creada y está pendiende de la aprobación por parte de administrador" |
|
550 | notice_account_pending: "Su cuenta ha sido creada y está pendiende de la aprobación por parte de administrador" | |
551 | setting_time_format: Formato de hora |
|
551 | setting_time_format: Formato de hora | |
|
552 | setting_bcc_recipients: Blind carbon copy recipients (bcc) |
@@ -180,6 +180,7 setting_self_registration: Inscription des nouveaux utilisateurs | |||||
180 | setting_attachment_max_size: Taille max des fichiers |
|
180 | setting_attachment_max_size: Taille max des fichiers | |
181 | setting_issues_export_limit: Limite export demandes |
|
181 | setting_issues_export_limit: Limite export demandes | |
182 | setting_mail_from: Adresse d'émission |
|
182 | setting_mail_from: Adresse d'émission | |
|
183 | setting_bcc_recipients: Destinataires en copie cachée (cci) | |||
183 | setting_host_name: Nom d'hôte |
|
184 | setting_host_name: Nom d'hôte | |
184 | setting_text_formatting: Formatage du texte |
|
185 | setting_text_formatting: Formatage du texte | |
185 | setting_wiki_compression: Compression historique wiki |
|
186 | setting_wiki_compression: Compression historique wiki |
@@ -546,3 +546,4 label_registration_manual_activation: manual account activation | |||||
546 | notice_account_pending: "Your account was created and is now pending administrator approval." |
|
546 | notice_account_pending: "Your account was created and is now pending administrator approval." | |
547 | field_time_zone: Time zone |
|
547 | field_time_zone: Time zone | |
548 | text_caracters_minimum: Must be at least %d characters long. |
|
548 | text_caracters_minimum: Must be at least %d characters long. | |
|
549 | setting_bcc_recipients: Blind carbon copy recipients (bcc) |
@@ -546,3 +546,4 label_registration_manual_activation: manual account activation | |||||
546 | notice_account_pending: "Your account was created and is now pending administrator approval." |
|
546 | notice_account_pending: "Your account was created and is now pending administrator approval." | |
547 | field_time_zone: Time zone |
|
547 | field_time_zone: Time zone | |
548 | text_caracters_minimum: Must be at least %d characters long. |
|
548 | text_caracters_minimum: Must be at least %d characters long. | |
|
549 | setting_bcc_recipients: Blind carbon copy recipients (bcc) |
@@ -547,3 +547,4 label_registration_manual_activation: manual account activation | |||||
547 | notice_account_pending: "Your account was created and is now pending administrator approval." |
|
547 | notice_account_pending: "Your account was created and is now pending administrator approval." | |
548 | field_time_zone: Time zone |
|
548 | field_time_zone: Time zone | |
549 | text_caracters_minimum: Must be at least %d characters long. |
|
549 | text_caracters_minimum: Must be at least %d characters long. | |
|
550 | setting_bcc_recipients: Blind carbon copy recipients (bcc) |
@@ -546,3 +546,4 label_registration_manual_activation: manual account activation | |||||
546 | notice_account_pending: "Your account was created and is now pending administrator approval." |
|
546 | notice_account_pending: "Your account was created and is now pending administrator approval." | |
547 | field_time_zone: Time zone |
|
547 | field_time_zone: Time zone | |
548 | text_caracters_minimum: Must be at least %d characters long. |
|
548 | text_caracters_minimum: Must be at least %d characters long. | |
|
549 | setting_bcc_recipients: Blind carbon copy recipients (bcc) |
@@ -547,3 +547,4 label_registration_manual_activation: manual account activation | |||||
547 | notice_account_pending: "Your account was created and is now pending administrator approval." |
|
547 | notice_account_pending: "Your account was created and is now pending administrator approval." | |
548 | field_time_zone: Time zone |
|
548 | field_time_zone: Time zone | |
549 | text_caracters_minimum: Must be at least %d characters long. |
|
549 | text_caracters_minimum: Must be at least %d characters long. | |
|
550 | setting_bcc_recipients: Blind carbon copy recipients (bcc) |
@@ -546,3 +546,4 label_registration_manual_activation: manualna aktywacja kont | |||||
546 | notice_account_pending: "Twoje konto zostało utworzone i oczekuje na zatwierdzenie administratora." |
|
546 | notice_account_pending: "Twoje konto zostało utworzone i oczekuje na zatwierdzenie administratora." | |
547 | field_time_zone: Strefa czasowa |
|
547 | field_time_zone: Strefa czasowa | |
548 | text_caracters_minimum: Must be at least %d characters long. |
|
548 | text_caracters_minimum: Must be at least %d characters long. | |
|
549 | setting_bcc_recipients: Blind carbon copy recipients (bcc) |
@@ -546,3 +546,4 label_registration_manual_activation: manual account activation | |||||
546 | notice_account_pending: "Your account was created and is now pending administrator approval." |
|
546 | notice_account_pending: "Your account was created and is now pending administrator approval." | |
547 | field_time_zone: Time zone |
|
547 | field_time_zone: Time zone | |
548 | text_caracters_minimum: Must be at least %d characters long. |
|
548 | text_caracters_minimum: Must be at least %d characters long. | |
|
549 | setting_bcc_recipients: Blind carbon copy recipients (bcc) |
@@ -546,3 +546,4 label_registration_manual_activation: manual account activation | |||||
546 | notice_account_pending: "Your account was created and is now pending administrator approval." |
|
546 | notice_account_pending: "Your account was created and is now pending administrator approval." | |
547 | field_time_zone: Time zone |
|
547 | field_time_zone: Time zone | |
548 | text_caracters_minimum: Must be at least %d characters long. |
|
548 | text_caracters_minimum: Must be at least %d characters long. | |
|
549 | setting_bcc_recipients: Blind carbon copy recipients (bcc) |
@@ -546,3 +546,4 label_registration_manual_activation: manual account activation | |||||
546 | notice_account_pending: "Your account was created and is now pending administrator approval." |
|
546 | notice_account_pending: "Your account was created and is now pending administrator approval." | |
547 | field_time_zone: Time zone |
|
547 | field_time_zone: Time zone | |
548 | text_caracters_minimum: Must be at least %d characters long. |
|
548 | text_caracters_minimum: Must be at least %d characters long. | |
|
549 | setting_bcc_recipients: Blind carbon copy recipients (bcc) |
@@ -546,3 +546,4 label_registration_manual_activation: активировать аккаунты | |||||
546 | notice_account_pending: "Ваш аккаунт уже создан и ожидает подтверждения администратора." |
|
546 | notice_account_pending: "Ваш аккаунт уже создан и ожидает подтверждения администратора." | |
547 | field_time_zone: Часовой пояс |
|
547 | field_time_zone: Часовой пояс | |
548 | text_caracters_minimum: Must be at least %d characters long. |
|
548 | text_caracters_minimum: Must be at least %d characters long. | |
|
549 | setting_bcc_recipients: Blind carbon copy recipients (bcc) |
@@ -547,3 +547,4 label_registration_manual_activation: manual account activation | |||||
547 | notice_account_pending: "Your account was created and is now pending administrator approval." |
|
547 | notice_account_pending: "Your account was created and is now pending administrator approval." | |
548 | field_time_zone: Time zone |
|
548 | field_time_zone: Time zone | |
549 | text_caracters_minimum: Must be at least %d characters long. |
|
549 | text_caracters_minimum: Must be at least %d characters long. | |
|
550 | setting_bcc_recipients: Blind carbon copy recipients (bcc) |
@@ -547,3 +547,4 label_registration_manual_activation: manual account activation | |||||
547 | notice_account_pending: "Your account was created and is now pending administrator approval." |
|
547 | notice_account_pending: "Your account was created and is now pending administrator approval." | |
548 | field_time_zone: Time zone |
|
548 | field_time_zone: Time zone | |
549 | text_caracters_minimum: Must be at least %d characters long. |
|
549 | text_caracters_minimum: Must be at least %d characters long. | |
|
550 | setting_bcc_recipients: Blind carbon copy recipients (bcc) |
@@ -549,3 +549,4 label_registration_manual_activation: manual account activation | |||||
549 | notice_account_pending: "Your account was created and is now pending administrator approval." |
|
549 | notice_account_pending: "Your account was created and is now pending administrator approval." | |
550 | field_time_zone: Time zone |
|
550 | field_time_zone: Time zone | |
551 | text_caracters_minimum: Must be at least %d characters long. |
|
551 | text_caracters_minimum: Must be at least %d characters long. | |
|
552 | setting_bcc_recipients: Blind carbon copy recipients (bcc) |
@@ -153,8 +153,8 width: 200px; | |||||
153 |
|
153 | |||
154 | #preview fieldset {margin-top: 1em; background: url(../images/draft.png)} |
|
154 | #preview fieldset {margin-top: 1em; background: url(../images/draft.png)} | |
155 |
|
155 | |||
156 |
|
|
156 | .tabular.settings p{ padding-left: 300px; } | |
157 |
|
|
157 | .tabular.settings label{ margin-left: -300px; width: 295px; } | |
158 |
|
158 | |||
159 | .required {color: #bb0000;} |
|
159 | .required {color: #bb0000;} | |
160 | .summary {font-style: italic;} |
|
160 | .summary {font-style: italic;} |
General Comments 0
You need to be logged in to leave comments.
Login now