Add "position" column to issue filter

pull/6827/head
friflaj 15 years ago
parent d3733963a2
commit 160946649a
  1. 3
      app/controllers/backlogs_controller.rb
  2. 1
      init.rb
  3. 2
      lib/query_patch.rb

@ -126,16 +126,17 @@ class BacklogsController < ApplicationController
def select_issues
@query = Query.new(:name => "_")
@query.project = @project
@query.sort_criteria = [['parent_id', 'desc']]
if params[:sprint_id]
@query.add_filter("status_id", '*', ['']) # All statuses
@query.add_filter("fixed_version_id", '=', [params[:sprint_id]])
@query.add_filter("backlogs_issue_type", '=', ['any'])
@query.sort_criteria = [['parent_id', 'desc']]
else
@query.add_filter("status_id", 'o', ['']) # only open
@query.add_filter("fixed_version_id", '!*', ['']) # only unassigned
@query.add_filter("backlogs_issue_type", '=', ['story'])
@query.sort_criteria = [['position', 'asc']]
end
session[:query] = {:project_id => @query.project_id, :filters => @query.filters}

@ -15,6 +15,7 @@ Dispatcher.to_prepare do
Issue::SAFE_ATTRIBUTES << "story_points" if Issue.const_defined? "SAFE_ATTRIBUTES"
Issue::SAFE_ATTRIBUTES << "remaining_hours" if Issue.const_defined? "SAFE_ATTRIBUTES"
Issue::SAFE_ATTRIBUTES << "position" if Issue.const_defined? "SAFE_ATTRIBUTES"
Query.send(:include, QueryPatch) unless Query.included_modules.include? QueryPatch
Issue.send(:include, IssuePatch) unless Issue.included_modules.include? IssuePatch

@ -10,6 +10,7 @@ module QueryPatch
unloadable # Send unloadable so it will not be unloaded in development
base.add_available_column(QueryColumn.new(:story_points, :sortable => "#{Issue.table_name}.story_points"))
base.add_available_column(QueryColumn.new(:remaining_hours, :sortable => "#{Issue.table_name}.remaining_hours"))
base.add_available_column(QueryColumn.new(:position, :sortable => "#{Issue.table_name}.position"))
base.add_available_column(QueryColumn.new(:velocity_based_estimate))
alias_method_chain :available_filters, :backlogs_issue_type
@ -45,6 +46,7 @@ module QueryPatch
[ [:parent, :before, (self.filters["backlogs_issue_type"][:values] == ['any'])],
[:story_points, :after, true],
[:position, :after, true],
[:estimated_hours, :after, true]]. each {|col, pos, use|
next if !use

Loading…
Cancel
Save