'Assigned to' drop down list is now sorted by user's lastname.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@939 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
db002edabd
commit
81ada666bb
|
@ -132,7 +132,7 @@ class Project < ActiveRecord::Base
|
|||
|
||||
# Users issues can be assigned to
|
||||
def assignable_users
|
||||
members.select {|m| m.role.assignable?}.collect {|m| m.user}
|
||||
members.select {|m| m.role.assignable?}.collect {|m| m.user}.sort
|
||||
end
|
||||
|
||||
# Returns the mail adresses of users that should be always notified on project events
|
||||
|
|
|
@ -147,7 +147,7 @@ class Query < ActiveRecord::Base
|
|||
user_values = []
|
||||
user_values << ["<< #{l(:label_me)} >>", "me"] if executed_by
|
||||
if project
|
||||
user_values += project.users.collect{|s| [s.name, s.id.to_s] }
|
||||
user_values += project.users.sort.collect{|s| [s.name, s.id.to_s] }
|
||||
elsif executed_by
|
||||
# members of the user's projects
|
||||
user_values += executed_by.projects.collect(&:users).flatten.uniq.sort.collect{|s| [s.name, s.id.to_s] }
|
||||
|
|
|
@ -163,7 +163,7 @@ class User < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def <=>(user)
|
||||
lastname == user.lastname ? firstname <=> user.firstname : lastname <=> user.lastname
|
||||
user.nil? ? -1 : (lastname == user.lastname ? firstname <=> user.firstname : lastname <=> user.lastname)
|
||||
end
|
||||
|
||||
def to_s
|
||||
|
|
Loading…
Reference in New Issue