]> source.dussan.org Git - redmine.git/commitdiff
Merged r19554 from trunk to 4.0-stable (#33052).
authorGo MAEDA <maeda@farend.jp>
Wed, 4 Mar 2020 07:47:30 +0000 (07:47 +0000)
committerGo MAEDA <maeda@farend.jp>
Wed, 4 Mar 2020 07:47:30 +0000 (07:47 +0000)
git-svn-id: http://svn.redmine.org/redmine/branches/4.0-stable@19558 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/timelog_helper.rb
test/functional/timelog_report_test.rb

index c3dd631153b7dda6e75174d9296ee021593b4dd5..5c6ca220a55a5e63e117188b5666babab27549b7 100644 (file)
@@ -63,7 +63,15 @@ module TimelogHelper
       "[#{l(:label_none)}]"
     elsif k = criteria_options[:klass]
       obj = k.find_by_id(value.to_i)
-      format_object(obj, html)
+      if obj.is_a?(Issue)
+        if obj.visible?
+          html ? link_to_issue(obj) : "#{obj.tracker} ##{obj.id}: #{obj.subject}"
+        else
+          "##{obj.id}"
+        end
+      else
+        format_object(obj, html)
+      end
     elsif cf = criteria_options[:custom_field]
       format_value(value, cf)
     else
index 73814b54762cae4e5372e452d7e534b54b3fe875..0bf7b9a63136a51f60b4f33f0e681c5929544be9 100644 (file)
@@ -258,6 +258,21 @@ class TimelogReportTest < Redmine::ControllerTest
     assert_equal 'Total time,"","",154.25,8.65,162.90', lines.last
   end
 
+  def test_report_csv_should_fill_issue_criteria_with_tracker_id_and_subject
+    get :report, :params => {
+      :project_id => 1,
+      :columns => 'month',
+      :from => "2007-01-01",
+      :to => "2007-06-30",
+      :criteria => ["issue"],
+      :format => "csv"
+    }
+
+    assert_response :success
+    lines = @response.body.chomp.split("\n")
+    assert lines.detect {|line| line.include?('Bug #1: Cannot print recipes')}
+  end
+
   def test_csv_big_5
     str_utf8  = "\xe4\xb8\x80\xe6\x9c\x88".force_encoding('UTF-8')
     str_big5  = "\xa4@\xa4\xeb".force_encoding('Big5')