summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2018-10-29 04:05:18 +0000
committerGo MAEDA <maeda@farend.jp>2018-10-29 04:05:18 +0000
commita0479c768ef80cbdaaf858b7550793fd327fc04c (patch)
treeac6c30827f117d9175af9747d88f8da9ec9f9c7f /app
parent21034c5628d980bd18c6ef3f3ef898969745c390 (diff)
downloadredmine-a0479c768ef80cbdaaf858b7550793fd327fc04c.tar.gz
redmine-a0479c768ef80cbdaaf858b7550793fd327fc04c.zip
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
Diffstat (limited to 'app')
-rw-r--r--app/models/time_entry_query.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/models/time_entry_query.rb b/app/models/time_entry_query.rb
index 260800078..a612ba7c5 100644
--- a/app/models/time_entry_query.rb
+++ b/app/models/time_entry_query.rb
@@ -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