mirror of
https://github.com/meineerde/redmine.git
synced 2026-01-31 19:47:14 +00:00
Duplicate activities in time entry report when project-specific activies exist (#20018).
Patch by Yuichi HARADA. git-svn-id: http://svn.redmine.org/redmine/trunk@21371 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
2f8e4231d0
commit
f2ae2b9936
@ -122,7 +122,7 @@ module Redmine
|
||||
'tracker' => {:sql => "#{Issue.table_name}.tracker_id",
|
||||
:klass => Tracker,
|
||||
:label => :label_tracker},
|
||||
'activity' => {:sql => "#{TimeEntry.table_name}.activity_id",
|
||||
'activity' => {:sql => "COALESCE(#{TimeEntryActivity.table_name}.parent_id, #{TimeEntryActivity.table_name}.id)",
|
||||
:klass => TimeEntryActivity,
|
||||
:label => :field_activity},
|
||||
'issue' => {:sql => "#{TimeEntry.table_name}.issue_id",
|
||||
|
||||
@ -224,6 +224,19 @@ class TimelogReportTest < Redmine::ControllerTest
|
||||
assert_select 'td', :text => 'New'
|
||||
end
|
||||
|
||||
def test_report_activity_criterion_should_aggregate_system_activity_and_project_activity
|
||||
activity = TimeEntryActivity.create!(:name => 'Design', :parent_id => 9, :project_id => 3)
|
||||
TimeEntry.generate!(:project_id => 3, :issue_id => 5, :activity_id => activity.id, :spent_on => '2007-05-23', :hours => 10.0)
|
||||
|
||||
get :report, :params => {:project_id => 1, :criteria => ['activity']}
|
||||
assert_response :success
|
||||
|
||||
assert_select 'tr.last-level:first' do
|
||||
assert_select 'td.name', :text => 'Design'
|
||||
assert_select 'td.hours:last', :text => '165:15'
|
||||
end
|
||||
end
|
||||
|
||||
def test_report_all_projects_csv_export
|
||||
get :report, :params => {
|
||||
:columns => 'month',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user