Rails4: replace ActionView::Helpers::TextHelper#truncate by String#truncate at lib/redmine/export/pdf.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@12832 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
3e38bd0654
commit
fd6fea5713
|
@ -604,13 +604,12 @@ module Redmine
|
||||||
unless issue.leaf?
|
unless issue.leaf?
|
||||||
# for CJK
|
# for CJK
|
||||||
truncate_length = ( l(:general_pdf_encoding).upcase == "UTF-8" ? 90 : 65 )
|
truncate_length = ( l(:general_pdf_encoding).upcase == "UTF-8" ? 90 : 65 )
|
||||||
|
|
||||||
pdf.SetFontStyle('B',9)
|
pdf.SetFontStyle('B',9)
|
||||||
pdf.RDMCell(35+155,5, l(:label_subtask_plural) + ":", "LTR")
|
pdf.RDMCell(35+155,5, l(:label_subtask_plural) + ":", "LTR")
|
||||||
pdf.Ln
|
pdf.Ln
|
||||||
issue_list(issue.descendants.visible.sort_by(&:lft)) do |child, level|
|
issue_list(issue.descendants.visible.sort_by(&:lft)) do |child, level|
|
||||||
buf = truncate("#{child.tracker} # #{child.id}: #{child.subject}",
|
buf = "#{child.tracker} # #{child.id}: #{child.subject}".
|
||||||
:length => truncate_length)
|
truncate(truncate_length)
|
||||||
level = 10 if level >= 10
|
level = 10 if level >= 10
|
||||||
pdf.SetFontStyle('',8)
|
pdf.SetFontStyle('',8)
|
||||||
pdf.RDMCell(35+135,5, (level >=1 ? " " * level : "") + buf, "L")
|
pdf.RDMCell(35+135,5, (level >=1 ? " " * level : "") + buf, "L")
|
||||||
|
@ -624,7 +623,6 @@ module Redmine
|
||||||
unless relations.empty?
|
unless relations.empty?
|
||||||
# for CJK
|
# for CJK
|
||||||
truncate_length = ( l(:general_pdf_encoding).upcase == "UTF-8" ? 80 : 60 )
|
truncate_length = ( l(:general_pdf_encoding).upcase == "UTF-8" ? 80 : 60 )
|
||||||
|
|
||||||
pdf.SetFontStyle('B',9)
|
pdf.SetFontStyle('B',9)
|
||||||
pdf.RDMCell(35+155,5, l(:label_related_issues) + ":", "LTR")
|
pdf.RDMCell(35+155,5, l(:label_related_issues) + ":", "LTR")
|
||||||
pdf.Ln
|
pdf.Ln
|
||||||
|
@ -639,7 +637,7 @@ module Redmine
|
||||||
end
|
end
|
||||||
buf += "#{relation.other_issue(issue).tracker}" +
|
buf += "#{relation.other_issue(issue).tracker}" +
|
||||||
" # #{relation.other_issue(issue).id}: #{relation.other_issue(issue).subject}"
|
" # #{relation.other_issue(issue).id}: #{relation.other_issue(issue).subject}"
|
||||||
buf = truncate(buf, :length => truncate_length)
|
buf = buf.truncate(truncate_length)
|
||||||
pdf.SetFontStyle('', 8)
|
pdf.SetFontStyle('', 8)
|
||||||
pdf.RDMCell(35+155-60, 5, buf, "L")
|
pdf.RDMCell(35+155-60, 5, buf, "L")
|
||||||
pdf.SetFontStyle('B',8)
|
pdf.SetFontStyle('B',8)
|
||||||
|
|
Loading…
Reference in New Issue