From fa76ec5c0196a309d541edcc5fda6022e19aefe2 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Sun, 1 Apr 2018 00:29:22 +0000 Subject: Adds issue category filter to spent time queries (#28391). Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@17249 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/time_entry_query.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'app/models') diff --git a/app/models/time_entry_query.rb b/app/models/time_entry_query.rb index 706c6b234..ea32cb939 100644 --- a/app/models/time_entry_query.rb +++ b/app/models/time_entry_query.rb @@ -65,6 +65,10 @@ class TimeEntryQuery < Query :type => :list, :name => l("label_attribute_of_issue", :name => l(:field_fixed_version)), :values => lambda { fixed_version_values }) + add_available_filter "issue.category_id", + :type => :list_optional, + :name => l("label_attribute_of_issue", :name => l(:field_category)), + :values => lambda { project.issue_categories.collect{|s| [s.name, s.id.to_s] } } if project add_available_filter("user_id", :type => :list_optional, :values => lambda { author_values } @@ -197,6 +201,10 @@ class TimeEntryQuery < Query sql_for_field("status_id", operator, value, Issue.table_name, "status_id") end + def sql_for_issue_category_id_field(field, operator, value) + sql_for_field("category_id", operator, value, Issue.table_name, "category_id") + end + # Accepts :from/:to params as shortcut filters def build_from_params(params, defaults={}) super -- cgit v1.2.3