Display project names in cross-project gantt PNG (#5904).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3885 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2010-07-25 11:43:19 +00:00
parent bdad35a736
commit 701d2eaeac
2 changed files with 11 additions and 4 deletions
+10 -3
View File
@@ -91,12 +91,12 @@ module Redmine
# Generates a gantt image
# Only defined if RMagick is avalaible
def to_image(format='PNG')
def to_image(project, format='PNG')
date_to = (@date_from >> @months)-1
show_weeks = @zoom > 1
show_days = @zoom > 2
subject_width = 320
subject_width = 400
header_heigth = 18
# width of one day in pixels
zoom = @zoom*2
@@ -115,7 +115,14 @@ module Redmine
gc.stroke('transparent')
gc.stroke_width(1)
events.each do |i|
gc.text(4, top + 2, (i.is_a?(Issue) ? i.subject : i.name))
text = ""
if i.is_a? Issue
text = "#{i.tracker} #{i.id}: #{i.subject}"
else
text = i.name
end
text = "#{i.project} - #{text}" unless project && project == i.project
gc.text(4, top + 2, text)
top = top + 20
end