diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-07-22 19:06:13 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-07-22 19:06:13 +0000 |
commit | d84d38983ac7a5f56fcfd25f01fbf5b3d6d498c1 (patch) | |
tree | bb4d3a938394b446b4edb28c21ac1658d81bdb2c /app/controllers | |
parent | f54c2d812d4d9d06827d3f5e08650f1dfd46f09e (diff) | |
download | redmine-d84d38983ac7a5f56fcfd25f01fbf5b3d6d498c1.tar.gz redmine-d84d38983ac7a5f56fcfd25f01fbf5b3d6d498c1.zip |
Adds boolean and list custom fields for time entries as criteria on timelog report.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1691 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/timelog_controller.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/controllers/timelog_controller.rb b/app/controllers/timelog_controller.rb index 9f539d459..605e7e61e 100644 --- a/app/controllers/timelog_controller.rb +++ b/app/controllers/timelog_controller.rb @@ -60,6 +60,13 @@ class TimelogController < ApplicationController :label => cf.name} end + # Add list and boolean time entry custom fields + TimeEntryCustomField.find(:all).select {|cf| %w(list bool).include? cf.field_format }.each do |cf| + @available_criterias["cf_#{cf.id}"] = {:sql => "(SELECT c.value FROM custom_values c WHERE c.custom_field_id = #{cf.id} AND c.customized_type = 'TimeEntry' AND c.customized_id = time_entries.id)", + :format => cf.field_format, + :label => cf.name} + end + @criterias = params[:criterias] || [] @criterias = @criterias.select{|criteria| @available_criterias.has_key? criteria} @criterias.uniq! |