Subprojects inherits parent projects members (can be disabled in Admin -> Settings -> Projects).
Eg. if B is a subproject of A, a user with a role on A will automatically have the same role on B. It can be overridden by assigning a different role manually to this user on B. git-svn-id: http://redmine.rubyforge.org/svn/branches/work@1054 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
1 parent
2a2a31d148
commit
d82334dd78
5 files changed
+17
-2
No files matched your search
@@ -19,6 +19,7 @@ module SettingsHelper
|
|||||||
def administration_settings_tabs
|
def administration_settings_tabs
|
||||||
tabs = [{:name => 'general', :partial => 'settings/general', :label => :label_general},
|
tabs = [{:name => 'general', :partial => 'settings/general', :label => :label_general},
|
||||||
{:name => 'authentication', :partial => 'settings/authentication', :label => :label_authentication},
|
{:name => 'authentication', :partial => 'settings/authentication', :label => :label_authentication},
|
||||||
|
{:name => 'projects', :partial => 'settings/projects', :label => :label_project_plural},
|
||||||
{:name => 'issues', :partial => 'settings/issues', :label => :label_issue_tracking},
|
{:name => 'issues', :partial => 'settings/issues', :label => :label_issue_tracking},
|
||||||
{:name => 'notifications', :partial => 'settings/notifications', :label => l(:field_mail_notification)},
|
{:name => 'notifications', :partial => 'settings/notifications', :label => l(:field_mail_notification)},
|
||||||
{:name => 'repositories', :partial => 'settings/repositories', :label => :label_repository_plural}
|
{:name => 'repositories', :partial => 'settings/repositories', :label => :label_repository_plural}
|
||||||
|
|||||||
@@ -153,7 +153,9 @@ class Project < ActiveRecord::Base
|
|||||||
|
|
||||||
# Users issues can be assigned to
|
# Users issues can be assigned to
|
||||||
def assignable_users
|
def assignable_users
|
||||||
members.select {|m| m.role.assignable?}.collect {|m| m.user}.sort
|
m = members
|
||||||
|
m += parent.members if Setting.subprojects_inherit_members? && parent
|
||||||
|
m.select {|m| m.role.assignable?}.collect {|m| m.user}.uniq.sort
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns the mail adresses of users that should be always notified on project events
|
# Returns the mail adresses of users that should be always notified on project events
|
||||||
|
|||||||
@@ -182,6 +182,7 @@ class User < ActiveRecord::Base
|
|||||||
if logged?
|
if logged?
|
||||||
# Find project membership
|
# Find project membership
|
||||||
membership = memberships.detect {|m| m.project_id == project.id}
|
membership = memberships.detect {|m| m.project_id == project.id}
|
||||||
|
membership ||= memberships.detect {|m| m.project_id == project.parent_id} if Setting.subprojects_inherit_members?
|
||||||
if membership
|
if membership
|
||||||
membership.role
|
membership.role
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
<% form_tag({:action => 'edit'}) do %>
|
||||||
|
|
||||||
|
<div class="box tabular settings">
|
||||||
|
<p><label><%= l(:setting_subprojects_inherit_members) %></label>
|
||||||
|
<%= check_box_tag 'settings[subprojects_inherit_members]', 1, Setting.subprojects_inherit_members? %>
|
||||||
|
<%= hidden_field_tag 'settings[subprojects_inherit_members]', 0 %></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<%= submit_tag l(:button_save) %>
|
||||||
|
<% end %>
|
||||||
@@ -105,4 +105,5 @@ emails_footer:
|
|||||||
default: |-
|
default: |-
|
||||||
You have received this notification because you have either subscribed to it, or are involved in.
|
You have received this notification because you have either subscribed to it, or are involved in.
|
||||||
To change your notification preferences, please click here: http://hostname/my/account
|
To change your notification preferences, please click here: http://hostname/my/account
|
||||||
|
subprojects_inherit_members:
|
||||||
|
default: 1
|
||||||
Reference in new issue
Block a user