Project

General

Profile

Defect #20018 » 20018.patch

Yuichi HARADA, 2021-12-06 06:45

View differences:

lib/redmine/helpers/time_report.rb
122 122
          'tracker' => {:sql => "#{Issue.table_name}.tracker_id",
123 123
                        :klass => Tracker,
124 124
                        :label => :label_tracker},
125
          'activity' => {:sql => "#{TimeEntry.table_name}.activity_id",
125
          'activity' => {:sql => "COALESCE(#{TimeEntryActivity.table_name}.parent_id, #{TimeEntryActivity.table_name}.id)",
126 126
                         :klass => TimeEntryActivity,
127 127
                         :label => :field_activity},
128 128
          'issue' => {:sql => "#{TimeEntry.table_name}.issue_id",
test/functional/timelog_report_test.rb
224 224
    assert_select 'td', :text => 'New'
225 225
  end
226 226

  
227
  def test_report_with_activity_criterion_should_aggregate_by_system_activity_ids
228
    activity = TimeEntryActivity.create!(:name => 'Design', :parent_id => 9, :project_id => 3)
229
    TimeEntry.generate!(:project_id => 3, :issue_id => 5, :activity_id => activity.id, :spent_on => '2007-05-23', :hours => 10.0)
230

  
231
    get :report, :params => {:project_id => 1, :criteria => ['activity']}
232
    assert_response :success
233

  
234
    assert_select 'tr.last-level:first' do
235
      assert_select 'td.name', :text => 'Design'
236
      assert_select 'td.hours:last', :text => '165.25'
237
    end
238
  end
239

  
227 240
  def test_report_all_projects_csv_export
228 241
    get :report, :params => {
229 242
      :columns => 'month',
(11-11/11)