To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Tag: | Revision:

root / app / controllers / gantts_controller.rb @ 422:19549b0c417a

History | View | Annotate | Download (1019 Bytes)

1
class GanttsController < ApplicationController
2
  menu_item :gantt
3
  before_filter :find_optional_project
4

    
5
  rescue_from Query::StatementInvalid, :with => :query_statement_invalid
6

    
7
  helper :gantt
8
  helper :issues
9
  helper :projects
10
  helper :queries
11
  include QueriesHelper
12
  helper :sort
13
  include SortHelper
14
  include Redmine::Export::PDF
15
  
16
  def show
17
    @gantt = Redmine::Helpers::Gantt.new(params)
18
    @gantt.project = @project
19
    retrieve_query
20
    @query.group_by = nil
21
    @gantt.query = @query if @query.valid?
22
    
23
    basename = (@project ? "#{@project.identifier}-" : '') + 'gantt'
24
    
25
    respond_to do |format|
26
      format.html { render :action => "show", :layout => !request.xhr? }
27
      format.png  { send_data(@gantt.to_image, :disposition => 'inline', :type => 'image/png', :filename => "#{basename}.png") } if @gantt.respond_to?('to_image')
28
      format.pdf  { send_data(@gantt.to_pdf, :type => 'application/pdf', :filename => "#{basename}.pdf") }
29
    end
30
  end
31

    
32
  def update
33
    show
34
  end
35

    
36
end