]> source.dussan.org Git - redmine.git/commitdiff
Merged r13562 (#18269).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 22 Nov 2014 10:35:38 +0000 (10:35 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 22 Nov 2014 10:35:38 +0000 (10:35 +0000)
git-svn-id: http://svn.redmine.org/redmine/branches/2.6-stable@13630 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/queries_helper.rb
test/functional/timelog_controller_test.rb

index c27ccf1a515187b08e47d39af306db61cd8a0caf..0ab6bad9081554258ad865d7c8bb2b2ba5ce5fe3 100644 (file)
@@ -122,16 +122,20 @@ module QueriesHelper
     end
   end
 
-  def csv_value(column, issue, value)
+  def csv_value(column, object, value)
     format_object(value, false) do |value|
       case value.class.name
       when 'Float'
         sprintf("%.2f", value).gsub('.', l(:general_csv_decimal_separator))
       when 'IssueRelation'
-        other = value.other_issue(issue)
-        l(value.label_for(issue)) + " ##{other.id}"
+        other = value.other_issue(object)
+        l(value.label_for(object)) + " ##{other.id}"
       when 'Issue'
-        value.id
+        if object.is_a?(TimeEntry)
+          "#{value.tracker} ##{value.id}: #{value.subject}"
+        else
+          value.id
+        end
       else
         value
       end
index cc76cba218aad943f1a034ffa1e2a1be4563d18f..67a141adfebb38b98aa2ed5aafb05bd88dc6430b 100644 (file)
@@ -714,4 +714,14 @@ class TimelogControllerTest < ActionController::TestCase
     assert_response :success
     assert_equal 'text/csv; header=present', response.content_type
   end
+
+  def test_index_csv_should_fill_issue_column_with_tracker_id_and_subject
+    issue = Issue.find(1)
+    entry = TimeEntry.generate!(:issue => issue, :comments => "Issue column content test")
+
+    get :index, :format => 'csv'
+    line = response.body.split("\n").detect {|l| l.include?(entry.comments)}
+    assert_not_nil line
+    assert_include "#{issue.tracker} #1: #{issue.subject}", line
+  end
 end