]> source.dussan.org Git - redmine.git/commitdiff
Merged r19458 from trunk to 4.1-stable (#32858).
authorGo MAEDA <maeda@farend.jp>
Sat, 25 Jan 2020 03:08:22 +0000 (03:08 +0000)
committerGo MAEDA <maeda@farend.jp>
Sat, 25 Jan 2020 03:08:22 +0000 (03:08 +0000)
git-svn-id: http://svn.redmine.org/redmine/branches/4.1-stable@19459 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/export/pdf/issues_pdf_helper.rb
test/functional/issues_controller_test.rb

index 15c0b43ccb5f593a12c2c6e67405a5f1e605c32d..81f1a817496c3ee8876f3d39c8a50f18568fffff 100644 (file)
@@ -212,7 +212,7 @@ module Redmine
             assoc[:journals].each do |journal|
               pdf.SetFontStyle('B',8)
               title = "##{journal.indice} - #{format_time(journal.created_on)} - #{journal.user}"
-              title << " (#{l(:field_private_notes)})" if journal.private_notes?
+              title += " (#{l(:field_private_notes)})" if journal.private_notes?
               pdf.RDMCell(190,5, title)
               pdf.ln
               pdf.SetFontStyle('I',8)
index 617af0053bb887cbaa2a4ee859f3c6c8a287318b..c4f1b5f4776935a5d7520d956de6af834a0d6b04 100644 (file)
@@ -2437,6 +2437,26 @@ class IssuesControllerTest < Redmine::ControllerTest
     assert @response.body.starts_with?('%PDF')
   end
 
+  def test_show_export_to_pdf_with_private_journal
+    Journal.create!(
+      :journalized => Issue.find(1),
+      :notes => 'Private notes',
+      :private_notes => true,
+      :user_id => 3
+    )
+    @request.session[:user_id] = 3
+    get(
+      :show,
+      :params => {
+        :id => 1,
+        :format => 'pdf'
+      }
+    )
+    assert_response :success
+    assert_equal 'application/pdf', @response.content_type
+    assert @response.body.starts_with?('%PDF')
+  end
+
   def test_show_export_to_pdf_with_changesets
     [[100], [100, 101], [100, 101, 102]].each do |cs|
       issue1 = Issue.find(3)