diff options
author | Go MAEDA <maeda@farend.jp> | 2024-08-11 08:30:40 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2024-08-11 08:30:40 +0000 |
commit | 174c237c70527b7cb3a7ab8546ee6d238b791d74 (patch) | |
tree | c7ccc281cba6fb4df736b71910333858d6320f54 | |
parent | c96ef014dd8405e70cc30c5da0f7cffc98a153d4 (diff) | |
download | redmine-174c237c70527b7cb3a7ab8546ee6d238b791d74.tar.gz redmine-174c237c70527b7cb3a7ab8546ee6d238b791d74.zip |
Fix incorrect sorting of users grouped by status in issue filters for administrators (#41079).
Patch by Vladislav Moiseev (user:vladdy.moses).
git-svn-id: https://svn.redmine.org/redmine/trunk@22947 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/models/query.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/query.rb b/app/models/query.rb index 931abc958..d6d319443 100644 --- a/app/models/query.rb +++ b/app/models/query.rb @@ -628,7 +628,7 @@ class Query < ApplicationRecord author_values = [] author_values << ["<< #{l(:label_me)} >>", "me"] if User.current.logged? author_values += - users.sort_by(&:status). + users.sort_by{|p| [p.status, p]}. collect{|s| [s.name, s.id.to_s, l("status_#{User::LABEL_BY_STATUS[s.status]}")]} author_values << [l(:label_user_anonymous), User.anonymous.id.to_s] author_values @@ -638,7 +638,7 @@ class Query < ApplicationRecord assigned_to_values = [] assigned_to_values << ["<< #{l(:label_me)} >>", "me"] if User.current.logged? assigned_to_values += - (Setting.issue_group_assignment? ? principals : users).sort_by(&:status). + (Setting.issue_group_assignment? ? principals : users).sort_by{|p| [p.status, p]}. collect{|s| [s.name, s.id.to_s, l("status_#{User::LABEL_BY_STATUS[s.status]}")]} assigned_to_values end @@ -668,7 +668,7 @@ class Query < ApplicationRecord watcher_values = [["<< #{l(:label_me)} >>", "me"]] if User.current.allowed_to?(:view_issue_watchers, self.project, global: true) watcher_values += - principals.sort_by(&:status). + principals.sort_by{|p| [p.status, p]}. collect{|s| [s.name, s.id.to_s, l("status_#{User::LABEL_BY_STATUS[s.status]}")]} end watcher_values |