0001-Fix-missing-subject-and-tracker-name-in-CSV-export-o.patch

Marius BALTEANU, 2020-03-03 00:22

Download (2 KB)

View differences:

app/helpers/timelog_helper.rb
68 68
      "[#{l(:label_none)}]"
69 69
    elsif k = criteria_options[:klass]
70 70
      obj = k.find_by_id(value.to_i)
71
      format_object(obj, html)
71
      if obj.is_a?(Issue)
72
        if obj.visible?
73
          html ? link_to_issue(obj) : "#{obj.tracker} ##{obj.id}: #{obj.subject}"
74
        else
75
          "##{obj.id}"
76
        end
77
      else
78
        format_object(obj, html)
79
      end
72 80
    elsif cf = criteria_options[:custom_field]
73 81
      format_value(value, cf)
74 82
    else
test/functional/timelog_report_test.rb
259 259
    assert_equal 'Total time,"","",154.25,8.65,162.90', lines.last
260 260
  end
261 261

  
262
  def test_report_csv_should_fill_issue_criteria_with_tracker_id_and_subject
263
    get :report, :params => {
264
      :project_id => 1,
265
      :columns => 'month',
266
      :from => "2007-01-01",
267
      :to => "2007-06-30",
268
      :criteria => ["issue"],
269
      :format => "csv"
270
    }
271

  
272
    assert_response :success
273
    lines = @response.body.chomp.split("\n")
274
    assert lines.detect {|line| line.include?('Bug #1: Cannot print recipes')}
275
  end
276

  
262 277
  def test_csv_big_5
263 278
    str_big5  = (+"\xa4@\xa4\xeb").force_encoding('Big5')
264 279
    user = User.find_by_id(3)
265
-