Allow issue grouping by custom field (#2679).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3071 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -23,6 +23,9 @@ class QueryColumn
|
||||
self.name = name
|
||||
self.sortable = options[:sortable]
|
||||
self.groupable = options[:groupable] || false
|
||||
if groupable == true
|
||||
self.groupable = name.to_s
|
||||
end
|
||||
self.default_order = options[:default_order]
|
||||
end
|
||||
|
||||
@@ -41,6 +44,10 @@ class QueryCustomFieldColumn < QueryColumn
|
||||
def initialize(custom_field)
|
||||
self.name = "cf_#{custom_field.id}".to_sym
|
||||
self.sortable = custom_field.order_statement || false
|
||||
if %w(list date bool int).include?(custom_field.field_format)
|
||||
self.groupable = custom_field.order_statement
|
||||
end
|
||||
self.groupable ||= false
|
||||
@cf = custom_field
|
||||
end
|
||||
|
||||
@@ -312,6 +319,10 @@ class Query < ActiveRecord::Base
|
||||
groupable_columns.detect {|c| c.name.to_s == group_by}
|
||||
end
|
||||
|
||||
def group_by_statement
|
||||
group_by_column.groupable
|
||||
end
|
||||
|
||||
def project_statement
|
||||
project_clauses = []
|
||||
if project && !@project.descendants.active.empty?
|
||||
|
||||
Reference in New Issue
Block a user