mirror of
https://github.com/redmine/redmine.git
synced 2025-11-17 18:50:53 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user