1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-02-01 03:57:15 +00:00

"Issue's subject" filter for spent time (#27821).

Patch by Go MAEDA.


git-svn-id: https://svn.redmine.org/redmine/trunk@22173 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA 2023-04-09 01:38:36 +00:00
parent 544af76dda
commit 565d13d654
2 changed files with 22 additions and 0 deletions

View File

@ -77,6 +77,11 @@ class TimeEntryQuery < Query
: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(
"issue.subject",
:type => :text,
:name => l("label_attribute_of_issue", :name => l(:field_subject))
)
add_available_filter(
"user_id",
:type => :list_optional, :values => lambda {author_values}
@ -222,6 +227,10 @@ class TimeEntryQuery < Query
sql_for_field("category_id", operator, value, Issue.table_name, "category_id")
end
def sql_for_issue_subject_field(field, operator, value)
sql_for_field("subject", operator, value, Issue.table_name, "subject")
end
def sql_for_project_status_field(field, operator, value, options={})
sql_for_field(field, operator, value, Project.table_name, "status")
end

View File

@ -1258,6 +1258,19 @@ class TimelogControllerTest < Redmine::ControllerTest
assert_equal [entry].map(&:id).map(&:to_s), css_select('input[name="ids[]"]').map {|e| e.attr(:value)}
end
def text_index_with_issue_subject_filter
get(
:index,
:params => {
:f => ['issue.subject'],
:op => {'issue.subject' => '~'},
:v => {'issue.subject' => ['"updating a recipe"']}
}
)
assert_response :success
assert_equal [3], css_select('input[name="ids[]"]').map {|e| e.attr(:value)}
end
def test_index_with_project_status_filter
project = Project.find(3)
project.close