diff options
author | Go MAEDA <maeda@farend.jp> | 2020-02-06 08:19:13 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2020-02-06 08:19:13 +0000 |
commit | b995014c495b36102f36ec80618f50f3763bcd6f (patch) | |
tree | 85c230cf16c300f51f9716299ff7bc48d300c4cf /app/helpers/issues_helper.rb | |
parent | 29433771b45319a0b50f182f0dcaf72db1275a30 (diff) | |
download | redmine-b995014c495b36102f36ec80618f50f3763bcd6f.tar.gz redmine-b995014c495b36102f36ec80618f50f3763bcd6f.zip |
Allow adding user groups as watchers for issues (#4511).
Patch by Yuichi HARADA.
git-svn-id: http://svn.redmine.org/redmine/trunk@19498 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers/issues_helper.rb')
-rw-r--r-- | app/helpers/issues_helper.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 2ea81d566..0f327b77e 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -365,8 +365,11 @@ module IssuesHelper # on the new issue form def users_for_new_issue_watchers(issue) users = issue.watcher_users.select{|u| u.status == User::STATUS_ACTIVE} - if issue.project.users.count <= 20 - users = (users + issue.project.users.sort).uniq + project = issue.project + scope_users = project.users + scope_groups = project.principals.merge(Group.givable) + if scope_users.count + scope_groups.count <= 20 + users = (users + scope_users.sort + scope_groups.sort).uniq end users end |