diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-03-13 19:17:59 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-03-13 19:17:59 +0000 |
commit | 71d88e55352a51b20dd5e2a4a44aa695834a36b9 (patch) | |
tree | 8d5708333c51b7da7319a5c182350758b00dc535 /app/controllers/issues_controller.rb | |
parent | b91489ce6bb0943cff50946af6e64be65d3ccd80 (diff) | |
download | redmine-71d88e55352a51b20dd5e2a4a44aa695834a36b9.tar.gz redmine-71d88e55352a51b20dd5e2a4a44aa695834a36b9.zip |
Get rid of sort_helper when using queries.
git-svn-id: http://svn.redmine.org/redmine/trunk@16390 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/issues_controller.rb')
-rw-r--r-- | app/controllers/issues_controller.rb | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index a04c1a6b0..2b9512fc7 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -37,15 +37,10 @@ class IssuesController < ApplicationController helper :queries include QueriesHelper helper :repositories - helper :sort - include SortHelper helper :timelog def index retrieve_query - sort_init(@query.sort_criteria.empty? ? [['id', 'desc']] : @query.sort_criteria) - sort_update(@query.sortable_columns) - @query.sort_criteria = sort_criteria.to_a if @query.valid? case params[:format] @@ -66,9 +61,7 @@ class IssuesController < ApplicationController @issue_count = @query.issue_count @issue_pages = Paginator.new @issue_count, @limit, params['page'] @offset ||= @issue_pages.offset - @issues = @query.issues(:order => sort_clause, - :offset => @offset, - :limit => @limit) + @issues = @query.issues(:offset => @offset, :limit => @limit) respond_to do |format| format.html { render :template => 'issues/index', :layout => !request.xhr? } @@ -421,10 +414,8 @@ class IssuesController < ApplicationController else retrieve_query_from_session if @query - sort_init(@query.sort_criteria.empty? ? [['id', 'desc']] : @query.sort_criteria) - sort_update(@query.sortable_columns, 'issues_index_sort') limit = 500 - issue_ids = @query.issue_ids(:order => sort_clause, :limit => (limit + 1)) + issue_ids = @query.issue_ids(:limit => (limit + 1)) if (idx = issue_ids.index(@issue.id)) && idx < limit if issue_ids.size < 500 @issue_position = idx + 1 |