Filter time entries after project status (#20081).

Patch by Marius BALTEANU.


git-svn-id: http://svn.redmine.org/redmine/trunk@17608 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA
2018-10-29 04:05:18 +00:00
parent 21034c5628
commit a0479c768e
3 changed files with 44 additions and 0 deletions

View File

@@ -80,6 +80,12 @@ class TimeEntryQuery < Query
:type => :list, :values => activities.map {|a| [a.name, a.id.to_s]}
)
add_available_filter("project.status",
:type => :list,
:name => l(:label_attribute_of_project, :name => l(:field_status)),
:values => lambda { project_statuses_values }
) if project.nil? || !project.leaf?
add_available_filter "comments", :type => :text
add_available_filter "hours", :type => :float
@@ -205,6 +211,10 @@ class TimeEntryQuery < Query
sql_for_field("category_id", operator, value, Issue.table_name, "category_id")
end
def sql_for_project_status_field(field, operator, value, options={})
sql_for_field(field, operator, value, Project.table_name, "status")
end
# Accepts :from/:to params as shortcut filters
def build_from_params(params, defaults={})
super