| 
									
										
										
										
											2010-04-28 15:54:46 +00:00
										 |  |  | class GanttsController < ApplicationController | 
					
						
							| 
									
										
										
										
											2010-11-07 22:38:10 +00:00
										 |  |  |   menu_item :gantt | 
					
						
							| 
									
										
										
										
											2010-04-28 15:54:46 +00:00
										 |  |  |   before_filter :find_optional_project | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   rescue_from Query::StatementInvalid, :with => :query_statement_invalid | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-09-10 03:09:02 +00:00
										 |  |  |   helper :gantt | 
					
						
							| 
									
										
										
										
											2010-04-28 15:54:46 +00:00
										 |  |  |   helper :issues | 
					
						
							|  |  |  |   helper :projects | 
					
						
							|  |  |  |   helper :queries | 
					
						
							|  |  |  |   include QueriesHelper | 
					
						
							| 
									
										
										
										
											2010-04-29 15:19:19 +00:00
										 |  |  |   helper :sort | 
					
						
							|  |  |  |   include SortHelper | 
					
						
							| 
									
										
										
										
											2010-04-28 15:54:46 +00:00
										 |  |  |   include Redmine::Export::PDF | 
					
						
							|  |  |  |    | 
					
						
							|  |  |  |   def show | 
					
						
							|  |  |  |     @gantt = Redmine::Helpers::Gantt.new(params) | 
					
						
							| 
									
										
										
										
											2010-09-10 03:09:02 +00:00
										 |  |  |     @gantt.project = @project | 
					
						
							| 
									
										
										
										
											2010-04-28 15:54:46 +00:00
										 |  |  |     retrieve_query | 
					
						
							|  |  |  |     @query.group_by = nil | 
					
						
							| 
									
										
										
										
											2010-09-10 03:09:02 +00:00
										 |  |  |     @gantt.query = @query if @query.valid? | 
					
						
							| 
									
										
										
										
											2010-04-28 15:54:46 +00:00
										 |  |  |      | 
					
						
							|  |  |  |     basename = (@project ? "#{@project.identifier}-" : '') + 'gantt' | 
					
						
							|  |  |  |      | 
					
						
							|  |  |  |     respond_to do |format| | 
					
						
							|  |  |  |       format.html { render :action => "show", :layout => !request.xhr? } | 
					
						
							| 
									
										
										
										
											2010-09-10 03:09:02 +00:00
										 |  |  |       format.png  { send_data(@gantt.to_image, :disposition => 'inline', :type => 'image/png', :filename => "#{basename}.png") } if @gantt.respond_to?('to_image') | 
					
						
							|  |  |  |       format.pdf  { send_data(@gantt.to_pdf, :type => 'application/pdf', :filename => "#{basename}.pdf") } | 
					
						
							| 
									
										
										
										
											2010-04-28 15:54:46 +00:00
										 |  |  |     end | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-26 16:36:59 +00:00
										 |  |  |   def update | 
					
						
							|  |  |  |     show | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-04-28 15:54:46 +00:00
										 |  |  | end |