diff --git a/lib/redmine/helpers/gantt.rb b/lib/redmine/helpers/gantt.rb index ae10439..6ce98f7 100644 --- a/lib/redmine/helpers/gantt.rb +++ b/lib/redmine/helpers/gantt.rb @@ -257,37 +257,15 @@ module Redmine def subject_for_project(project, options) case options[:format] when :html - output = '' - - output << "
" - @subjects << output - output + subject = "" + subject << view.link_to_project(project) + subject << '' + html_subject(options, subject, :css => "project-name") when :image - - options[:image].fill('black') - options[:image].stroke('transparent') - options[:image].stroke_width(1) - options[:image].text(options[:indent], options[:top] + 2, project.name) + image_subject(options, project.name) when :pdf pdf_new_page?(options) - options[:pdf].SetY(options[:top]) - options[:pdf].SetX(15) - - char_limit = PDF::MaxCharactorsForSubject - options[:indent] - options[:pdf].Cell(options[:subject_width]-15, 5, (" " * options[:indent]) +"#{project.name}".sub(/^(.{#{char_limit}}[^\s]*\s).*$/, '\1 (...)'), "LR") - - options[:pdf].SetY(options[:top]) - options[:pdf].SetX(options[:subject_width]) - options[:pdf].Cell(options[:g_width], 5, "", "LR") + pdf_subject(options, project.name) end end @@ -317,35 +295,15 @@ module Redmine def subject_for_version(version, options) case options[:format] when :html - output = '' - output << " " - @subjects << output - output + subject = "" + subject << view.link_to_version(version) + subject << '' + html_subject(options, subject, :css => "version-name") when :image - options[:image].fill('black') - options[:image].stroke('transparent') - options[:image].stroke_width(1) - options[:image].text(options[:indent], options[:top] + 2, version.to_s_with_project) + image_subject(options, version.to_s_with_project) when :pdf pdf_new_page?(options) - options[:pdf].SetY(options[:top]) - options[:pdf].SetX(15) - - char_limit = PDF::MaxCharactorsForSubject - options[:indent] - options[:pdf].Cell(options[:subject_width]-15, 5, (" " * options[:indent]) +"#{version.to_s_with_project}".sub(/^(.{#{char_limit}}[^\s]*\s).*$/, '\1 (...)'), "LR") - - options[:pdf].SetY(options[:top]) - options[:pdf].SetX(options[:subject_width]) - options[:pdf].Cell(options[:g_width], 5, "", "LR") + pdf_subject(options, version.to_s_with_project) end end @@ -376,54 +334,24 @@ module Redmine def subject_for_issue(issue, options) case options[:format] when :html - output = '' - output << "