]> source.dussan.org Git - redmine.git/commitdiff
Code cleanup.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 3 Jan 2013 13:59:15 +0000 (13:59 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 3 Jan 2013 13:59:15 +0000 (13:59 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11108 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/helpers/time_report.rb

index 181598af2c1a227bcd2852a17d387e03f71d56e2..20a3798d84564d59f1c1f8ccca7152eff8babce5 100644 (file)
@@ -129,23 +129,12 @@ module Redmine
 
         # Add list and boolean custom fields as available criteria
         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
-        TimeEntryCustomField.all.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
-
+        custom_fields += TimeEntryCustomField.all
         # 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",
                                                  :joins => cf.join_for_order_statement,
                                                  :format => cf.field_format,