Include both last and first name when sorting issues by assignee (#1841).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2351 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
ab5e07e83e
commit
2a220a9e42
|
@ -84,7 +84,7 @@ module SortHelper
|
||||||
session[@sort_name] = sort
|
session[@sort_name] = sort
|
||||||
|
|
||||||
sort_column = (sort_keys.is_a?(Hash) ? sort_keys[sort[:key]] : sort[:key])
|
sort_column = (sort_keys.is_a?(Hash) ? sort_keys[sort[:key]] : sort[:key])
|
||||||
@sort_clause = (sort_column.blank? ? nil : "#{sort_column} #{sort[:order]}")
|
@sort_clause = (sort_column.blank? ? nil : [sort_column].flatten.collect {|s| "#{s} #{sort[:order]}"}.join(','))
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns an SQL sort clause corresponding to the current sort state.
|
# Returns an SQL sort clause corresponding to the current sort state.
|
||||||
|
|
|
@ -98,7 +98,7 @@ class Query < ActiveRecord::Base
|
||||||
QueryColumn.new(:priority, :sortable => "#{Enumeration.table_name}.position", :default_order => 'desc'),
|
QueryColumn.new(:priority, :sortable => "#{Enumeration.table_name}.position", :default_order => 'desc'),
|
||||||
QueryColumn.new(:subject, :sortable => "#{Issue.table_name}.subject"),
|
QueryColumn.new(:subject, :sortable => "#{Issue.table_name}.subject"),
|
||||||
QueryColumn.new(:author),
|
QueryColumn.new(:author),
|
||||||
QueryColumn.new(:assigned_to, :sortable => "#{User.table_name}.lastname"),
|
QueryColumn.new(:assigned_to, :sortable => ["#{User.table_name}.lastname", "#{User.table_name}.firstname"]),
|
||||||
QueryColumn.new(:updated_on, :sortable => "#{Issue.table_name}.updated_on", :default_order => 'desc'),
|
QueryColumn.new(:updated_on, :sortable => "#{Issue.table_name}.updated_on", :default_order => 'desc'),
|
||||||
QueryColumn.new(:category, :sortable => "#{IssueCategory.table_name}.name"),
|
QueryColumn.new(:category, :sortable => "#{IssueCategory.table_name}.name"),
|
||||||
QueryColumn.new(:fixed_version, :sortable => "#{Version.table_name}.effective_date", :default_order => 'desc'),
|
QueryColumn.new(:fixed_version, :sortable => "#{Version.table_name}.effective_date", :default_order => 'desc'),
|
||||||
|
|
Loading…
Reference in New Issue