OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openproject/app/controllers/rb_application_controller.rb

35 lines
1.0 KiB

# Base class of all controllers in Redmine Backlogs
class RbApplicationController < ApplicationController
unloadable
before_filter :load_project, :authorize, :check_if_plugin_is_configured
private
# Loads the project to be used by the authorize filter to
# determine if User.current has permission to invoke the method in question.
def load_project
14 years ago
@project = if params[:sprint_id]
load_sprint
@sprint.project
elsif params[:project_id]
Project.find(params[:project_id])
14 years ago
else
14 years ago
raise "Cannot determine project (#{params.inspect})"
end
end
def check_if_plugin_is_configured
settings = Setting.plugin_redmine_backlogs
if settings[:story_trackers].blank? || settings[:task_tracker].blank?
respond_to do |format|
format.html { render :file => "rb_common/not_configured" }
end
end
end
def load_sprint
14 years ago
@sprint = Sprint.find(params[:sprint_id])
end
end