mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-27 19:01:14 +00:00
Ability to set default value for "I don't want to be notified of changes that I make myself" (#34787).
Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@20771 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
7152e5b9df
commit
34310eece6
@ -52,7 +52,7 @@ class UserPreference < ActiveRecord::Base
|
||||
self.time_zone = Setting.default_users_time_zone
|
||||
end
|
||||
unless attributes && attributes.key?(:no_self_notified)
|
||||
self.no_self_notified = true
|
||||
self.no_self_notified = Setting.default_users_no_self_notified
|
||||
end
|
||||
end
|
||||
self.others ||= {}
|
||||
|
||||
@ -19,6 +19,8 @@
|
||||
|
||||
<p><%= setting_select(:default_notification_option, User.valid_notification_options.collect {|o| [l(o.last), o.first.to_s]}) %></p>
|
||||
|
||||
<p><%= setting_check_box :default_users_no_self_notified, :label => :label_user_mail_no_self_notified %></p>
|
||||
|
||||
<p><%= setting_select :default_users_time_zone, ActiveSupport::TimeZone.all.collect {|z| [ z.to_s, z.name ]}, :label => :field_time_zone, :blank => :label_none %></p>
|
||||
</fieldset>
|
||||
|
||||
|
||||
@ -277,6 +277,8 @@ sequential_project_identifiers:
|
||||
default: 0
|
||||
default_users_hide_mail:
|
||||
default: 1
|
||||
default_users_no_self_notified:
|
||||
default: 1
|
||||
default_users_time_zone:
|
||||
default: ""
|
||||
# encodings used to convert files content to UTF-8
|
||||
|
||||
@ -50,6 +50,13 @@ class UserPreferenceTest < ActiveSupport::TestCase
|
||||
assert_equal true, preference.no_self_notified
|
||||
end
|
||||
|
||||
def test_no_self_notified_should_default_to_setting
|
||||
with_settings :default_users_no_self_notified => '0' do
|
||||
preference = UserPreference.new
|
||||
assert_equal false, preference.no_self_notified
|
||||
end
|
||||
end
|
||||
|
||||
def test_create
|
||||
user = User.new(:firstname => "new", :lastname => "user", :mail => "newuser@somenet.foo")
|
||||
user.login = "newuser"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user