mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-19 15:01:14 +00:00
remove general_pdf_encoding from lib/redmine/export/pdf.rb (#17570)
git-svn-id: http://svn.redmine.org/redmine/trunk@13359 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
4a9210d86f
commit
3d15ec3c96
@ -34,7 +34,6 @@ module Redmine
|
|||||||
@@k_path_cache = Rails.root.join('tmp', 'pdf')
|
@@k_path_cache = Rails.root.join('tmp', 'pdf')
|
||||||
FileUtils.mkdir_p @@k_path_cache unless File::exist?(@@k_path_cache)
|
FileUtils.mkdir_p @@k_path_cache unless File::exist?(@@k_path_cache)
|
||||||
set_language_if_valid lang
|
set_language_if_valid lang
|
||||||
pdf_encoding = l(:general_pdf_encoding).upcase
|
|
||||||
super(orientation, 'mm', 'A4')
|
super(orientation, 'mm', 'A4')
|
||||||
set_print_header(false)
|
set_print_header(false)
|
||||||
set_rtl(l(:direction) == 'rtl')
|
set_rtl(l(:direction) == 'rtl')
|
||||||
@ -60,14 +59,8 @@ module Redmine
|
|||||||
@font_for_content = 'freeserif'
|
@font_for_content = 'freeserif'
|
||||||
@font_for_footer = 'freeserif'
|
@font_for_footer = 'freeserif'
|
||||||
else
|
else
|
||||||
case pdf_encoding
|
@font_for_content = 'freesans'
|
||||||
when 'UTF-8'
|
@font_for_footer = 'freesans'
|
||||||
@font_for_content = 'freesans'
|
|
||||||
@font_for_footer = 'freesans'
|
|
||||||
else
|
|
||||||
@font_for_content = 'helvetica'
|
|
||||||
@font_for_footer = 'helvetica'
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
set_creator(Redmine::Info.app_name)
|
set_creator(Redmine::Info.app_name)
|
||||||
set_font(@font_for_content)
|
set_font(@font_for_content)
|
||||||
@ -83,7 +76,7 @@ module Redmine
|
|||||||
end
|
end
|
||||||
|
|
||||||
def fix_text_encoding(txt)
|
def fix_text_encoding(txt)
|
||||||
RDMPdfEncoding::rdm_from_utf8(txt, l(:general_pdf_encoding))
|
RDMPdfEncoding::rdm_from_utf8(txt, "UTF-8")
|
||||||
end
|
end
|
||||||
|
|
||||||
def formatted_text(text)
|
def formatted_text(text)
|
||||||
@ -120,7 +113,6 @@ module Redmine
|
|||||||
end
|
end
|
||||||
|
|
||||||
def get_image_filename(attrname)
|
def get_image_filename(attrname)
|
||||||
# attrname: general_pdf_encoding string file/uri name
|
|
||||||
atta = RDMPdfEncoding.attach(@attachments, attrname, "UTF-8")
|
atta = RDMPdfEncoding.attach(@attachments, attrname, "UTF-8")
|
||||||
if atta
|
if atta
|
||||||
return atta.diskfile
|
return atta.diskfile
|
||||||
@ -150,6 +142,15 @@ module Redmine
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def is_cjk?
|
||||||
|
case current_language.to_s.downcase
|
||||||
|
when 'ja', 'zh-tw', 'zh', 'ko'
|
||||||
|
true
|
||||||
|
else
|
||||||
|
false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# fetch row values
|
# fetch row values
|
||||||
def fetch_row_values(issue, query, level)
|
def fetch_row_values(issue, query, level)
|
||||||
query.inline_columns.collect do |column|
|
query.inline_columns.collect do |column|
|
||||||
@ -519,8 +520,7 @@ module Redmine
|
|||||||
issue.description.to_s, issue.attachments, "LRB")
|
issue.description.to_s, issue.attachments, "LRB")
|
||||||
|
|
||||||
unless issue.leaf?
|
unless issue.leaf?
|
||||||
# for CJK
|
truncate_length = (!is_cjk? ? 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
|
||||||
@ -538,8 +538,7 @@ module Redmine
|
|||||||
|
|
||||||
relations = issue.relations.select { |r| r.other_issue(issue).visible? }
|
relations = issue.relations.select { |r| r.other_issue(issue).visible? }
|
||||||
unless relations.empty?
|
unless relations.empty?
|
||||||
# for CJK
|
truncate_length = (!is_cjk? ? 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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user