diff options
author | Eric Davis <edavis@littlestreamsoftware.com> | 2009-10-21 22:34:57 +0000 |
---|---|---|
committer | Eric Davis <edavis@littlestreamsoftware.com> | 2009-10-21 22:34:57 +0000 |
commit | 2e0cbd2840ffb9fdb355ed0afd6b8684f2549bc7 (patch) | |
tree | bef4e4f9d68845c8294940cc697eb7280641d2a3 /app | |
parent | 37d401ac58c36fc060ba795d1f3a3f36fa1dc4dc (diff) | |
download | redmine-2e0cbd2840ffb9fdb355ed0afd6b8684f2549bc7.tar.gz redmine-2e0cbd2840ffb9fdb355ed0afd6b8684f2549bc7.zip |
Added all list and boolean custom data fields to the Time Report. #4077
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2951 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/timelog_controller.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/app/controllers/timelog_controller.rb b/app/controllers/timelog_controller.rb index ca3774bc9..f53ea72fa 100644 --- a/app/controllers/timelog_controller.rb +++ b/app/controllers/timelog_controller.rb @@ -67,7 +67,14 @@ class TimelogController < ApplicationController :format => cf.field_format, :label => cf.name} end - + + # Add list and boolean time entry activity custom fields + TimeEntryActivityCustomField.find(:all).select {|cf| %w(list bool).include? cf.field_format }.each do |cf| + @available_criterias["cf_#{cf.id}"] = {:sql => "(SELECT c.value FROM #{CustomValue.table_name} c WHERE c.custom_field_id = #{cf.id} AND c.customized_type = 'Enumeration' AND c.customized_id = #{TimeEntry.table_name}.activity_id)", + :format => cf.field_format, + :label => cf.name} + end + @criterias = params[:criterias] || [] @criterias = @criterias.select{|criteria| @available_criterias.has_key? criteria} @criterias.uniq! |