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_queries_controller.rb

24 lines
997 B

class RbQueriesController < RbApplicationController
unloadable
def show
@query = Query.new(:name => "_")
@query.project = @project
if params[:sprint_id]
@query.add_filter("status_id", '*', ['']) # All statuses
@query.add_filter("fixed_version_id", '=', [params[:sprint_id]])
@query.add_filter("backlogs_work_package_type", '=', ['any'])
else
@query.add_filter("status_id", 'o', ['']) # only open
@query.add_filter("fixed_version_id", '!*', ['']) # only unassigned
@query.add_filter("backlogs_work_package_type", '=', ['story'])
end
column_names = @query.columns.collect{|col| col.name}
column_names = column_names + ['position'] unless column_names.include?('position')
session[:query] = {:project_id => @query.project_id, :filters => @query.filters, :column_names => column_names}
redirect_to :controller => '/work_packages', :action => 'index', :project_id => @project.id, :sort => 'position'
end
end