Defect #32858 ยป fix-issue-with-private-jorunal-pdf-export.diff
| lib/redmine/export/pdf/issues_pdf_helper.rb | ||
|---|---|---|
| 212 | 212 |
assoc[:journals].each do |journal| |
| 213 | 213 |
pdf.SetFontStyle('B',8)
|
| 214 | 214 |
title = "##{journal.indice} - #{format_time(journal.created_on)} - #{journal.user}"
|
| 215 |
title << " (#{l(:field_private_notes)})" if journal.private_notes?
|
|
| 215 |
title += " (#{l(:field_private_notes)})" if journal.private_notes?
|
|
| 216 | 216 |
pdf.RDMCell(190,5, title) |
| 217 | 217 |
pdf.ln |
| 218 | 218 |
pdf.SetFontStyle('I',8)
|
| test/functional/issues_controller_test.rb | ||
|---|---|---|
| 2738 | 2738 |
assert @response.body.starts_with?('%PDF')
|
| 2739 | 2739 |
end |
| 2740 | 2740 | |
| 2741 |
def test_show_export_to_pdf_with_private_journal |
|
| 2742 |
Journal.create!( |
|
| 2743 |
:journalized => Issue.find(1), |
|
| 2744 |
:notes => 'Private notes', |
|
| 2745 |
:private_notes => true, |
|
| 2746 |
:user_id => 3 |
|
| 2747 |
) |
|
| 2748 |
@request.session[:user_id] = 3 |
|
| 2749 |
get( |
|
| 2750 |
:show, |
|
| 2751 |
:params => {
|
|
| 2752 |
:id => 1, |
|
| 2753 |
:format => 'pdf' |
|
| 2754 |
} |
|
| 2755 |
) |
|
| 2756 |
assert_response :success |
|
| 2757 |
assert_equal 'application/pdf', @response.content_type |
|
| 2758 |
assert @response.body.starts_with?('%PDF')
|
|
| 2759 |
end |
|
| 2760 | ||
| 2741 | 2761 |
def test_show_export_to_pdf_with_changesets |
| 2742 | 2762 |
[[100], [100, 101], [100, 101, 102]].each do |cs| |
| 2743 | 2763 |
issue1 = Issue.find(3) |