obsolete.ChilliProject/app/controllers/gantts_controller.rb

37 lines
1009 B
Ruby
Raw Normal View History

class GanttsController < ApplicationController
menu_item :gantt
before_filter :find_optional_project
rescue_from Query::StatementInvalid, :with => :query_statement_invalid
helper :gantt
helper :issues
helper :projects
helper :queries
include QueriesHelper
helper :sort
include SortHelper
include Redmine::Export::PDF
Merge branch 'master' into master-journalized Conflicts: app/controllers/application_controller.rb app/controllers/context_menus_controller.rb app/controllers/gantts_controller.rb app/controllers/issue_moves_controller.rb app/controllers/issues_controller.rb app/controllers/journals_controller.rb app/controllers/previews_controller.rb app/controllers/timelog_controller.rb app/helpers/issues_helper.rb app/helpers/journals_helper.rb app/models/issue.rb app/models/journal.rb app/models/journal_observer.rb app/views/admin/projects.rhtml app/views/context_menus/issues.html.erb app/views/issues/_action_menu.rhtml app/views/issues/_history.rhtml app/views/news/_news.rhtml app/views/news/index.rhtml app/views/repositories/diff.rhtml config/locales/bg.yml config/locales/bs.yml config/locales/ca.yml config/locales/cs.yml config/locales/da.yml config/locales/de.yml config/locales/el.yml config/locales/en-GB.yml config/locales/es.yml config/locales/eu.yml config/locales/fi.yml config/locales/fr.yml config/locales/gl.yml config/locales/he.yml config/locales/hr.yml config/locales/hu.yml config/locales/id.yml config/locales/it.yml config/locales/ko.yml config/locales/lt.yml config/locales/lv.yml config/locales/mn.yml config/locales/nl.yml config/locales/no.yml config/locales/pl.yml config/locales/pt-BR.yml config/locales/pt.yml config/locales/ro.yml config/locales/ru.yml config/locales/sk.yml config/locales/sl.yml config/locales/sr-YU.yml config/locales/sr.yml config/locales/sv.yml config/locales/th.yml config/locales/tr.yml config/locales/uk.yml config/locales/vi.yml config/locales/zh-TW.yml config/locales/zh.yml config/routes.rb doc/CHANGELOG lib/redmine.rb lib/redmine/export/pdf.rb lib/redmine/helpers/gantt.rb lib/redmine/version.rb public/stylesheets/application.css test/functional/context_menus_controller_test.rb test/functional/issues_controller_test.rb test/functional/journals_controller_test.rb test/functional/previews_controller_test.rb test/functional/users_controller_test.rb test/functional/wiki_controller_test.rb test/integration/routing_test.rb test/unit/issue_test.rb test/unit/mailer_test.rb test/unit/query_test.rb
2010-10-26 20:20:57 +04:00
def show
@gantt = Redmine::Helpers::Gantt.new(params)
@gantt.project = @project
retrieve_query
@query.group_by = nil
@gantt.query = @query if @query.valid?
Merge branch 'master' into master-journalized Conflicts: app/controllers/application_controller.rb app/controllers/context_menus_controller.rb app/controllers/gantts_controller.rb app/controllers/issue_moves_controller.rb app/controllers/issues_controller.rb app/controllers/journals_controller.rb app/controllers/previews_controller.rb app/controllers/timelog_controller.rb app/helpers/issues_helper.rb app/helpers/journals_helper.rb app/models/issue.rb app/models/journal.rb app/models/journal_observer.rb app/views/admin/projects.rhtml app/views/context_menus/issues.html.erb app/views/issues/_action_menu.rhtml app/views/issues/_history.rhtml app/views/news/_news.rhtml app/views/news/index.rhtml app/views/repositories/diff.rhtml config/locales/bg.yml config/locales/bs.yml config/locales/ca.yml config/locales/cs.yml config/locales/da.yml config/locales/de.yml config/locales/el.yml config/locales/en-GB.yml config/locales/es.yml config/locales/eu.yml config/locales/fi.yml config/locales/fr.yml config/locales/gl.yml config/locales/he.yml config/locales/hr.yml config/locales/hu.yml config/locales/id.yml config/locales/it.yml config/locales/ko.yml config/locales/lt.yml config/locales/lv.yml config/locales/mn.yml config/locales/nl.yml config/locales/no.yml config/locales/pl.yml config/locales/pt-BR.yml config/locales/pt.yml config/locales/ro.yml config/locales/ru.yml config/locales/sk.yml config/locales/sl.yml config/locales/sr-YU.yml config/locales/sr.yml config/locales/sv.yml config/locales/th.yml config/locales/tr.yml config/locales/uk.yml config/locales/vi.yml config/locales/zh-TW.yml config/locales/zh.yml config/routes.rb doc/CHANGELOG lib/redmine.rb lib/redmine/export/pdf.rb lib/redmine/helpers/gantt.rb lib/redmine/version.rb public/stylesheets/application.css test/functional/context_menus_controller_test.rb test/functional/issues_controller_test.rb test/functional/journals_controller_test.rb test/functional/previews_controller_test.rb test/functional/users_controller_test.rb test/functional/wiki_controller_test.rb test/integration/routing_test.rb test/unit/issue_test.rb test/unit/mailer_test.rb test/unit/query_test.rb
2010-10-26 20:20:57 +04:00
basename = (@project ? "#{@project.identifier}-" : '') + 'gantt'
Merge branch 'master' into master-journalized Conflicts: app/controllers/application_controller.rb app/controllers/context_menus_controller.rb app/controllers/gantts_controller.rb app/controllers/issue_moves_controller.rb app/controllers/issues_controller.rb app/controllers/journals_controller.rb app/controllers/previews_controller.rb app/controllers/timelog_controller.rb app/helpers/issues_helper.rb app/helpers/journals_helper.rb app/models/issue.rb app/models/journal.rb app/models/journal_observer.rb app/views/admin/projects.rhtml app/views/context_menus/issues.html.erb app/views/issues/_action_menu.rhtml app/views/issues/_history.rhtml app/views/news/_news.rhtml app/views/news/index.rhtml app/views/repositories/diff.rhtml config/locales/bg.yml config/locales/bs.yml config/locales/ca.yml config/locales/cs.yml config/locales/da.yml config/locales/de.yml config/locales/el.yml config/locales/en-GB.yml config/locales/es.yml config/locales/eu.yml config/locales/fi.yml config/locales/fr.yml config/locales/gl.yml config/locales/he.yml config/locales/hr.yml config/locales/hu.yml config/locales/id.yml config/locales/it.yml config/locales/ko.yml config/locales/lt.yml config/locales/lv.yml config/locales/mn.yml config/locales/nl.yml config/locales/no.yml config/locales/pl.yml config/locales/pt-BR.yml config/locales/pt.yml config/locales/ro.yml config/locales/ru.yml config/locales/sk.yml config/locales/sl.yml config/locales/sr-YU.yml config/locales/sr.yml config/locales/sv.yml config/locales/th.yml config/locales/tr.yml config/locales/uk.yml config/locales/vi.yml config/locales/zh-TW.yml config/locales/zh.yml config/routes.rb doc/CHANGELOG lib/redmine.rb lib/redmine/export/pdf.rb lib/redmine/helpers/gantt.rb lib/redmine/version.rb public/stylesheets/application.css test/functional/context_menus_controller_test.rb test/functional/issues_controller_test.rb test/functional/journals_controller_test.rb test/functional/previews_controller_test.rb test/functional/users_controller_test.rb test/functional/wiki_controller_test.rb test/integration/routing_test.rb test/unit/issue_test.rb test/unit/mailer_test.rb test/unit/query_test.rb
2010-10-26 20:20:57 +04:00
respond_to do |format|
format.html { render :action => "show", :layout => !request.xhr? }
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") }
end
end
def update
show
end
end