Omit subtasks/related issues sections when empty on PDF export (#5634).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7845 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2011-11-19 13:36:30 +00:00
parent b019875819
commit 886310055b
1 changed files with 43 additions and 38 deletions

View File

@ -362,6 +362,7 @@ module Redmine
Redmine::WikiFormatting.to_html( Redmine::WikiFormatting.to_html(
Setting.text_formatting, issue.description.to_s),"LRB") Setting.text_formatting, issue.description.to_s),"LRB")
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 )
@ -378,14 +379,17 @@ module Redmine
pdf.RDMCell(20,5, child.status.to_s, "R") pdf.RDMCell(20,5, child.status.to_s, "R")
pdf.Ln pdf.Ln
end end
pdf.SetFontStyle('B',9) end
pdf.RDMCell(35+155,5, l(:label_related_issues) + ":", "LTR")
pdf.Ln
relations = issue.relations.select { |r| r.other_issue(issue).visible? }
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 )
issue.relations.select { |r| r.other_issue(issue).visible? }.each do |relation| pdf.SetFontStyle('B',9)
pdf.RDMCell(35+155,5, l(:label_related_issues) + ":", "LTR")
pdf.Ln
relations.each do |relation|
buf = "" buf = ""
buf += "#{l(relation.label_for(issue))} " buf += "#{l(relation.label_for(issue))} "
if relation.delay && relation.delay != 0 if relation.delay && relation.delay != 0
@ -405,6 +409,7 @@ module Redmine
pdf.RDMCell(20,5, format_date(relation.other_issue(issue).due_date), "R") pdf.RDMCell(20,5, format_date(relation.other_issue(issue).due_date), "R")
pdf.Ln pdf.Ln
end end
end
pdf.RDMCell(190,5, "", "T") pdf.RDMCell(190,5, "", "T")
pdf.Ln pdf.Ln