diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-07-11 19:35:40 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-07-11 19:35:40 +0000 |
commit | 80b1a73ccf5b536db55ffe4e88833e1d4c78bccb (patch) | |
tree | 6f9b2b4abf5d03298df469836732141dc5afe13c /app | |
parent | f3d1aa53599a01a3a9f47169d626339d912c774c (diff) | |
download | redmine-80b1a73ccf5b536db55ffe4e88833e1d4c78bccb.tar.gz redmine-80b1a73ccf5b536db55ffe4e88833e1d4c78bccb.zip |
Adds 'assigned-to-my-group' css class to issues that are assigned to a user's group (#12681).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@12006 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r-- | app/models/issue.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb index e68dc02f7..ccedcfd4c 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -1041,15 +1041,18 @@ class Issue < ActiveRecord::Base end # Returns a string of css classes that apply to the issue - def css_classes + def css_classes(user=User.current) s = "issue tracker-#{tracker_id} status-#{status_id} #{priority.try(:css_classes)}" s << ' closed' if closed? s << ' overdue' if overdue? s << ' child' if child? s << ' parent' unless leaf? s << ' private' if is_private? - s << ' created-by-me' if User.current.logged? && author_id == User.current.id - s << ' assigned-to-me' if User.current.logged? && assigned_to_id == User.current.id + if user.logged? + s << ' created-by-me' if author_id == user.id + s << ' assigned-to-me' if assigned_to_id == user.id + s << ' assigned-to-my-group' if user.groups.any? {|g| g.id = assigned_to_id} + end s end |