##// END OF EJS Templates
Display project names in cross-project gantt PNG (#5904)....
Jean-Philippe Lang -
r3771:701d2eaeacdf
parent child
Show More
@@ -37,7 +37,7 class GanttsController < ApplicationController
37 37
38 38 respond_to do |format|
39 39 format.html { render :action => "show", :layout => !request.xhr? }
40 format.png { send_data(@gantt.to_image, :disposition => 'inline', :type => 'image/png', :filename => "#{basename}.png") } if @gantt.respond_to?('to_image')
40 format.png { send_data(@gantt.to_image(@project), :disposition => 'inline', :type => 'image/png', :filename => "#{basename}.png") } if @gantt.respond_to?('to_image')
41 41 format.pdf { send_data(gantt_to_pdf(@gantt, @project), :type => 'application/pdf', :filename => "#{basename}.pdf") }
42 42 end
43 43 end
@@ -91,12 +91,12 module Redmine
91 91
92 92 # Generates a gantt image
93 93 # Only defined if RMagick is avalaible
94 def to_image(format='PNG')
94 def to_image(project, format='PNG')
95 95 date_to = (@date_from >> @months)-1
96 96 show_weeks = @zoom > 1
97 97 show_days = @zoom > 2
98 98
99 subject_width = 320
99 subject_width = 400
100 100 header_heigth = 18
101 101 # width of one day in pixels
102 102 zoom = @zoom*2
@@ -115,7 +115,14 module Redmine
115 115 gc.stroke('transparent')
116 116 gc.stroke_width(1)
117 117 events.each do |i|
118 gc.text(4, top + 2, (i.is_a?(Issue) ? i.subject : i.name))
118 text = ""
119 if i.is_a? Issue
120 text = "#{i.tracker} #{i.id}: #{i.subject}"
121 else
122 text = i.name
123 end
124 text = "#{i.project} - #{text}" unless project && project == i.project
125 gc.text(4, top + 2, text)
119 126 top = top + 20
120 127 end
121 128
General Comments 0
You need to be logged in to leave comments. Login now