def mail_options
@notifiables = %w(issue_added issue_updated news_added document_added file_added message_posted)
if request.post?
- Setting.notified_events = (params[:notified_events] || [])
- Setting.emails_footer = params[:emails_footer] if params[:emails_footer]
+ settings = (params[:settings] || {}).dup
+ settings[:notified_events] ||= []
+ settings.each { |name, value| Setting[name] = value }
flash[:notice] = l(:notice_successful_update)
redirect_to :controller => 'admin', :action => 'mail_options'
end
default_url_options[:protocol] = Setting.protocol
end
- # Overrides the create_mail method to remove the current user from the recipients and cc
- # if he doesn't want to receive notifications about what he does
+ # Overrides the create_mail method
def create_mail
- recipients.delete(User.current.mail) if recipients && User.current.pref[:no_self_notified]
- cc.delete(User.current.mail) if cc && User.current.pref[:no_self_notified]
+ # Removes the current user from the recipients and cc
+ # if he doesn't want to receive notifications about what he does
+ if User.current.pref[:no_self_notified]
+ recipients.delete(User.current.mail) if recipients
+ cc.delete(User.current.mail) if cc
+ end
+ # Blind carbon copy recipients
+ if Setting.bcc_recipients?
+ bcc([recipients, cc].flatten.compact.uniq)
+ recipients []
+ cc []
+ end
super
end
<% form_tag({:action => 'mail_options'}, :id => 'mail-options-form') do %>
+<fieldset class="box tabular settings"><legend><%=l(:label_settings)%></legend>
+<p><label><%= l(:setting_mail_from) %></label>
+<%= text_field_tag 'settings[mail_from]', Setting.mail_from, :size => 60 %></p>
+
+<p><label><%= l(:setting_bcc_recipients) %></label>
+<%= check_box_tag 'settings[bcc_recipients]', 1, Setting.bcc_recipients? %>
+<%= hidden_field_tag 'settings[bcc_recipients]', 0 %></p>
+</fieldset>
+
<fieldset class="box"><legend><%=l(:text_select_mail_notifications)%></legend>
<% @notifiables.each do |notifiable| %>
- <label><%= check_box_tag "notified_events[]", notifiable, Setting.notified_events.include?(notifiable) %>
+ <label><%= check_box_tag 'settings[notified_events][]', notifiable, Setting.notified_events.include?(notifiable) %>
<%= notifiable.humanize %></label><br />
<% end %>
<p><%= check_all_links('mail-options-form') %></p>
</fieldset>
<fieldset class="box"><legend><%= l(:setting_emails_footer) %></legend>
-<%= text_area_tag 'emails_footer', Setting.emails_footer, :class => 'wiki-edit', :rows => 5 %>
+<%= text_area_tag 'settings[emails_footer]', Setting.emails_footer, :class => 'wiki-edit', :rows => 5 %>
</fieldset>
<%= submit_tag l(:button_save) %>
<h2><%= l(:label_settings) %></h2>
-<div id="settings">
<% form_tag({:action => 'edit'}) do %>
-<div class="box tabular">
+<div class="box tabular settings">
<p><label><%= l(:setting_app_title) %></label>
<%= text_field_tag 'settings[app_title]', Setting.app_title, :size => 30 %></p>
<p><label><%= l(:setting_cross_project_issue_relations) %></label>
<%= check_box_tag 'settings[cross_project_issue_relations]', 1, Setting.cross_project_issue_relations? %><%= hidden_field_tag 'settings[cross_project_issue_relations]', 0 %></p>
-<p><label><%= l(:setting_mail_from) %></label>
-<%= text_field_tag 'settings[mail_from]', Setting.mail_from, :size => 60 %></p>
-
<p><label><%= l(:setting_host_name) %></label>
<%= text_field_tag 'settings[host_name]', Setting.host_name, :size => 60 %></p>
</fieldset>
<%= submit_tag l(:button_save) %>
-</div>
<% end %>
default: 500
mail_from:
default: redmine@somenet.foo
+bcc_recipients:
+ default: 1
text_formatting:
default: textile
wiki_compression:
notice_account_pending: "Your account was created and is now pending administrator approval."
field_time_zone: Time zone
text_caracters_minimum: Must be at least %d characters long.
+setting_bcc_recipients: Blind carbon copy recipients (bcc)
notice_account_pending: "Your account was created and is now pending administrator approval."
field_time_zone: Time zone
text_caracters_minimum: Must be at least %d characters long.
+setting_bcc_recipients: Blind carbon copy recipients (bcc)
notice_account_pending: "Ihr Konto wurde erstellt und wartet jetzt auf die Genehmigung des Administrators."
field_time_zone: Zeitzone
text_caracters_minimum: Muss mindestens %d Zeichen lang sein.
+setting_bcc_recipients: Blind carbon copy recipients (bcc)
setting_attachment_max_size: Attachment max. size
setting_issues_export_limit: Issues export limit
setting_mail_from: Emission email address
+setting_bcc_recipients: Blind carbon copy recipients (bcc)
setting_host_name: Host name
setting_text_formatting: Text formatting
setting_wiki_compression: Wiki history compression
label_registration_manual_activation: activación manual de cuenta
notice_account_pending: "Su cuenta ha sido creada y está pendiende de la aprobación por parte de administrador"
setting_time_format: Formato de hora
+setting_bcc_recipients: Blind carbon copy recipients (bcc)
setting_attachment_max_size: Taille max des fichiers
setting_issues_export_limit: Limite export demandes
setting_mail_from: Adresse d'émission
+setting_bcc_recipients: Destinataires en copie cachée (cci)
setting_host_name: Nom d'hôte
setting_text_formatting: Formatage du texte
setting_wiki_compression: Compression historique wiki
notice_account_pending: "Your account was created and is now pending administrator approval."
field_time_zone: Time zone
text_caracters_minimum: Must be at least %d characters long.
+setting_bcc_recipients: Blind carbon copy recipients (bcc)
notice_account_pending: "Your account was created and is now pending administrator approval."
field_time_zone: Time zone
text_caracters_minimum: Must be at least %d characters long.
+setting_bcc_recipients: Blind carbon copy recipients (bcc)
notice_account_pending: "Your account was created and is now pending administrator approval."
field_time_zone: Time zone
text_caracters_minimum: Must be at least %d characters long.
+setting_bcc_recipients: Blind carbon copy recipients (bcc)
notice_account_pending: "Your account was created and is now pending administrator approval."
field_time_zone: Time zone
text_caracters_minimum: Must be at least %d characters long.
+setting_bcc_recipients: Blind carbon copy recipients (bcc)
notice_account_pending: "Your account was created and is now pending administrator approval."
field_time_zone: Time zone
text_caracters_minimum: Must be at least %d characters long.
+setting_bcc_recipients: Blind carbon copy recipients (bcc)
notice_account_pending: "Twoje konto zostało utworzone i oczekuje na zatwierdzenie administratora."
field_time_zone: Strefa czasowa
text_caracters_minimum: Must be at least %d characters long.
+setting_bcc_recipients: Blind carbon copy recipients (bcc)
notice_account_pending: "Your account was created and is now pending administrator approval."\r
field_time_zone: Time zone\r
text_caracters_minimum: Must be at least %d characters long.\r
+setting_bcc_recipients: Blind carbon copy recipients (bcc)\r
notice_account_pending: "Your account was created and is now pending administrator approval."
field_time_zone: Time zone
text_caracters_minimum: Must be at least %d characters long.
+setting_bcc_recipients: Blind carbon copy recipients (bcc)
notice_account_pending: "Your account was created and is now pending administrator approval."
field_time_zone: Time zone
text_caracters_minimum: Must be at least %d characters long.
+setting_bcc_recipients: Blind carbon copy recipients (bcc)
notice_account_pending: "Ваш аккаунт уже создан и ожидает подтверждения администратора."
field_time_zone: Часовой пояс
text_caracters_minimum: Must be at least %d characters long.
+setting_bcc_recipients: Blind carbon copy recipients (bcc)
notice_account_pending: "Your account was created and is now pending administrator approval."
field_time_zone: Time zone
text_caracters_minimum: Must be at least %d characters long.
+setting_bcc_recipients: Blind carbon copy recipients (bcc)
notice_account_pending: "Your account was created and is now pending administrator approval."
field_time_zone: Time zone
text_caracters_minimum: Must be at least %d characters long.
+setting_bcc_recipients: Blind carbon copy recipients (bcc)
notice_account_pending: "Your account was created and is now pending administrator approval."
field_time_zone: Time zone
text_caracters_minimum: Must be at least %d characters long.
+setting_bcc_recipients: Blind carbon copy recipients (bcc)
#preview fieldset {margin-top: 1em; background: url(../images/draft.png)}
-#settings .tabular p{ padding-left: 300px; }
-#settings .tabular label{ margin-left: -300px; width: 295px; }
+.tabular.settings p{ padding-left: 300px; }
+.tabular.settings label{ margin-left: -300px; width: 295px; }
.required {color: #bb0000;}
.summary {font-style: italic;}