summaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2018-04-01 00:29:22 +0000
committerGo MAEDA <maeda@farend.jp>2018-04-01 00:29:22 +0000
commitfa76ec5c0196a309d541edcc5fda6022e19aefe2 (patch)
tree2c5998add4166fffd3d91439683d6702aaf0d8e3 /app/models
parent07ce80f9b29b5878ddffe7a19bb167cb05dca463 (diff)
downloadredmine-fa76ec5c0196a309d541edcc5fda6022e19aefe2.tar.gz
redmine-fa76ec5c0196a309d541edcc5fda6022e19aefe2.zip
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
Diffstat (limited to 'app/models')
-rw-r--r--app/models/time_entry_query.rb8
1 files changed, 8 insertions, 0 deletions
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