Project

General

Profile

Actions

Patch #10970

open

Sort issues in roadmap by IssueStatus.position

Added by Александр Гурьянов almost 12 years ago. Updated about 5 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Roadmap
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Sort issues in the roadmap by their statuses. With this patch you can move open issues to top and closed to bottom of the list according their statuses.

Related to feature request: http://www.redmine.org/issues/10969


Files

roadmap_issues_sort.diff (1.21 KB) roadmap_issues_sort.diff Александр Гурьянов, 2012-05-19 13:54

Related issues

Related to Redmine - Feature #10969: Sort issue in roadmap by statusNew

Actions
Actions #1

Updated by Александр Гурьянов almost 12 years ago

Revision: trunk(9701)

Actions #2

Updated by Sunding Wei about 5 years ago

Thanks for the patch, I fixed for Redmine v3.4.4

Hope this feature can be merged into redmine master.

--- versions_controller.rb.old    2019-03-06 13:43:41.068549228 +0800
+++ versions_controller.rb    2019-03-06 14:32:04.942060762 +0800
@@ -49,10 +49,10 @@
         @issues_by_version = {}
         if @selected_tracker_ids.any? && @versions.any?
           issues = Issue.visible.
-            includes(:project, :tracker).
+            includes(:project, :tracker, :status).
             preload(:status, :priority, :fixed_version).
             where(:tracker_id => @selected_tracker_ids, :project_id => project_ids, :fixed_version_id => @versions.map(&:id)).
-            order("#{Project.table_name}.lft, #{Tracker.table_name}.position, #{Issue.table_name}.id")
+            order("#{Project.table_name}.lft, #{Tracker.table_name}.position, #{IssueStatus.table_name}.position,  #{Issue.table_name}.id")
           @issues_by_version = issues.group_by(&:fixed_version)
         end
         @versions.reject! {|version| !project_ids.include?(version.project_id) && @issues_by_version[version].blank?}
@@ -69,7 +69,7 @@
         @issues = @version.fixed_issues.visible.
           includes(:status, :tracker, :priority).
           preload(:project).
-          reorder("#{Tracker.table_name}.position, #{Issue.table_name}.id").
+          reorder("#{Tracker.table_name}.position, #{IssueStatus.table_name}.position, #{Issue.table_name}.id").
           to_a
       }
       format.api
Actions

Also available in: Atom PDF