Code cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11108 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
03329b5d4d
commit
902d4bcf1c
|
@ -129,23 +129,12 @@ module Redmine
|
||||||
|
|
||||||
# Add list and boolean custom fields as available criteria
|
# Add list and boolean custom fields as available criteria
|
||||||
custom_fields = (@project.nil? ? IssueCustomField.for_all : @project.all_issue_custom_fields)
|
custom_fields = (@project.nil? ? IssueCustomField.for_all : @project.all_issue_custom_fields)
|
||||||
custom_fields.select {|cf| %w(list bool).include? cf.field_format }.each do |cf|
|
|
||||||
@available_criteria["cf_#{cf.id}"] = {:sql => "#{cf.join_alias}.value",
|
|
||||||
:joins => cf.join_for_order_statement,
|
|
||||||
:format => cf.field_format,
|
|
||||||
:label => cf.name}
|
|
||||||
end if @project
|
|
||||||
|
|
||||||
# Add list and boolean time entry custom fields
|
# Add list and boolean time entry custom fields
|
||||||
TimeEntryCustomField.all.select {|cf| %w(list bool).include? cf.field_format }.each do |cf|
|
custom_fields += TimeEntryCustomField.all
|
||||||
@available_criteria["cf_#{cf.id}"] = {:sql => "#{cf.join_alias}.value",
|
|
||||||
:joins => cf.join_for_order_statement,
|
|
||||||
:format => cf.field_format,
|
|
||||||
:label => cf.name}
|
|
||||||
end
|
|
||||||
|
|
||||||
# Add list and boolean time entry activity custom fields
|
# Add list and boolean time entry activity custom fields
|
||||||
TimeEntryActivityCustomField.all.select {|cf| %w(list bool).include? cf.field_format }.each do |cf|
|
custom_fields += TimeEntryActivityCustomField.all
|
||||||
|
|
||||||
|
custom_fields.select {|cf| %w(list bool).include? cf.field_format }.each do |cf|
|
||||||
@available_criteria["cf_#{cf.id}"] = {:sql => "#{cf.join_alias}.value",
|
@available_criteria["cf_#{cf.id}"] = {:sql => "#{cf.join_alias}.value",
|
||||||
:joins => cf.join_for_order_statement,
|
:joins => cf.join_for_order_statement,
|
||||||
:format => cf.field_format,
|
:format => cf.field_format,
|
||||||
|
|
Loading…
Reference in New Issue