Feature #16195 » group.patch
redmine/app/models/issue.rb 2014-06-23 13:12:05.046658189 +0200 | ||
---|---|---|
117 | 117 |
when 'own' |
118 | 118 |
user_ids = [user.id] + user.groups.map(&:id).compact |
119 | 119 |
"(#{table_name}.author_id = #{user.id} OR #{table_name}.assigned_to_id IN (#{user_ids.join(',')}))" |
120 |
when 'group' |
|
121 |
user_ids = ([user.id] + user.groups.map(&:id).compact + user.groups.map(&:users).flatten.map(&:id)).uniq |
|
122 |
"(#{table_name}.author_id in (#{user_ids.join(',')}) OR #{table_name}.assigned_to_id IN (#{user_ids.join(',')}))" |
|
120 | 123 |
else |
121 | 124 |
'1=0' |
122 | 125 |
end |
... | ... | |
137 | 140 |
!self.is_private? || (self.author == user || user.is_or_belongs_to?(assigned_to)) |
138 | 141 |
when 'own' |
139 | 142 |
self.author == user || user.is_or_belongs_to?(assigned_to) |
143 |
when 'group' |
|
144 |
user.groups.map(&:users).flatten.uniq.inject(false) { |p, u| p ||= (self.author == u || u.is_or_belongs_to?(assigned_to)) } |
|
140 | 145 |
else |
141 | 146 |
false |
142 | 147 |
end |
redmine/app/models/role.rb 2014-06-20 09:43:24.768383152 +0200 | ||
---|---|---|
36 | 36 |
ISSUES_VISIBILITY_OPTIONS = [ |
37 | 37 |
['all', :label_issues_visibility_all], |
38 | 38 |
['default', :label_issues_visibility_public], |
39 |
['own', :label_issues_visibility_own] |
|
39 |
['own', :label_issues_visibility_own], |
|
40 |
['group', :label_issues_visibility_group] |
|
40 | 41 |
] |
41 | 42 | |
42 | 43 |
scope :sorted, lambda { order("#{table_name}.builtin ASC, #{table_name}.position ASC") } |
redmine/config/locales/en.yml 2014-06-23 13:00:57.057703829 +0200 | ||
---|---|---|
875 | 875 |
label_issues_visibility_all: All issues |
876 | 876 |
label_issues_visibility_public: All non private issues |
877 | 877 |
label_issues_visibility_own: Issues created by or assigned to the user |
878 |
label_issues_visibility_group: Issues created by or assigned to the user's group(s) |
|
878 | 879 |
label_git_report_last_commit: Report last commit for files and directories |
879 | 880 |
label_parent_revision: Parent |
880 | 881 |
label_child_revision: Child |
redmine/config/locales/fr.yml 2014-06-23 13:02:20.152697782 +0200 | ||
---|---|---|
855 | 855 |
label_issues_visibility_all: Toutes les demandes |
856 | 856 |
label_issues_visibility_public: Toutes les demandes non privées |
857 | 857 |
label_issues_visibility_own: Demandes créées par ou assignées à l'utilisateur |
858 |
label_issues_visibility_group: Demandes créées par ou assignées au(x) groupe(s) de l'utilisateur |
|
858 | 859 |
label_export_options: Options d'exportation %{export_format} |
859 | 860 |
label_copy_attachments: Copier les fichiers |
860 | 861 |
label_copy_subtasks: Copier les sous-tâches |