Commit 5e6547e9 authored by jplang's avatar jplang

Include inactive activities in time entries filter (#20117).

git-svn-id: https://svn.redmine.org/redmine/trunk@14626 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent c20a2824
......@@ -76,7 +76,7 @@ class TimeEntryQuery < Query
:type => :list_optional, :values => users_values
) unless users_values.empty?
activities = (project ? project.activities : TimeEntryActivity.shared.active)
activities = (project ? project.activities : TimeEntryActivity.shared)
add_available_filter("activity_id",
:type => :list, :values => activities.map {|a| [a.name, a.id.to_s]}
) unless activities.empty?
......
......@@ -27,6 +27,16 @@ class TimeEntryQueryTest < ActiveSupport::TestCase
:groups_users,
:enabled_modules
def test_cross_project_activity_filter_should_propose_non_active_activities
activity = TimeEntryActivity.create!(:name => 'Disabled', :active => false)
assert !activity.active?
query = TimeEntryQuery.new(:name => '_')
assert options = query.available_filters['activity_id']
assert values = options[:values]
assert_include ["Disabled", activity.id.to_s], values
end
def test_activity_filter_should_consider_system_and_project_activities
TimeEntry.delete_all
system = TimeEntryActivity.create!(:name => 'Foo')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment