Project

General

Profile

Actions

Defect #7335

closed

Sorting issues in gantt by date, not by id

Added by Eli Stevens over 13 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Toshi MARUYAMA
Category:
Gantt
Target version:
Start date:
2011-01-15
Due date:
% Done:

90%

Estimated time:
Resolution:
Fixed
Affected version:

Description

I can't tell if the prior issues (see below) related to gantt chart issue sorting are about new- or old-style gantt charts. I do know that the default 1.1.0 isn't very useful, since they're sorted by root_id (ie. parent issue id). That has little relation to the order that the issues need to be worked on in. I made a one-line change that worked for me:

  1. TODO: top level issues should be sorted by start date
    def gantt_issue_compare(x, y, issues)
    [(x.root.start_date or x.start_date or Date.new()), (x.start_date or Date.new()), x.root_id, x.lft] <=> [(y.root.start_date or y.start_date or Date.new()), (y.start_date or Date.new()), y.root_id, y.lft]
    #if x.root_id == y.root_id # x.lft <=> y.lft
    #else # #x.root_id <=> y.root_id
    #end
    end

I'm not 100% certain if it works in all cases, but for my DB (multi-project, multi-version, single nesting level issues), it works fine.


Files

sort_issues_from_start_date.diff (1.55 KB) sort_issues_from_start_date.diff Felipe Ribeiro, 2011-12-05 20:03
sort_issues.rb (782 Bytes) sort_issues.rb Felipe Ribeiro, 2011-12-05 20:03
redmine-trunk-r10713.png (21.5 KB) redmine-trunk-r10713.png Toshi MARUYAMA, 2012-10-24 15:32
redmine-trunk-r10713-patch.png (39.6 KB) redmine-trunk-r10713-patch.png Toshi MARUYAMA, 2012-10-24 15:32
gantt-sort-r10713.diff (1.16 KB) gantt-sort-r10713.diff Toshi MARUYAMA, 2012-10-24 15:32
gantt-sort-trunk-r11692.diff (1.78 KB) gantt-sort-trunk-r11692.diff Toshi MARUYAMA, 2013-03-31 08:51
gantt-sort-trunk-r11692.png (20 KB) gantt-sort-trunk-r11692.png Toshi MARUYAMA, 2013-03-31 08:51
gantt-sort-trunk-r11723.diff (3.12 KB) gantt-sort-trunk-r11723.diff Toshi MARUYAMA, 2013-04-19 07:02
gantt.jpg (65.4 KB) gantt.jpg Yuhki ISHIGURO, 2013-04-22 02:55
gantt-sort-trunk-r11740.diff (3.09 KB) gantt-sort-trunk-r11740.diff Toshi MARUYAMA, 2013-04-22 09:34
gantt-sort-trunk-r11744.diff (4.04 KB) gantt-sort-trunk-r11744.diff Toshi MARUYAMA, 2013-04-23 17:44
gantt-sort-trunk-r11856.diff (2.34 KB) gantt-sort-trunk-r11856.diff Toshi MARUYAMA, 2013-05-18 01:36
gantt-sort-version-trunk-r11898.diff (438 Bytes) gantt-sort-version-trunk-r11898.diff Filou Centrinov, 2013-07-15 19:06

Related issues

Related to Redmine - Patch #5438: Patch repairing rendering of subtasks in gantt diagram Closed2010-05-042010-05-04

Actions
Related to Redmine - Patch #7456: Gantt filtersNew2011-01-26

Actions
Related to Redmine - Feature #6276: Gantt Chart rewriteClosedEric Davis2010-09-03

Actions
Related to Redmine - Patch #12730: Fix sorting and PDF output of Gantt diagram & start date calculation and groupingNewJean-Philippe Lang

Actions
Related to Redmine - Defect #7128: New gantt chart does not render subtasks under parent taskClosed2010-12-18

Actions
Related to Redmine - Feature #8897: Be able to reorder tasks/issues in the Gantt chartNew2011-07-25

Actions
Related to Redmine - Defect #7579: Gantt tab gives internal error.Closed2011-02-08

Actions
Related to Redmine - Feature #14397: Gantt sorting as a configurable settingNew

Actions
Has duplicate Redmine - Feature #7968: Order tasks by time on GanntClosed

Actions
Has duplicate Redmine - Defect #8480: gantt sorting in redmine 1.2Closed2011-05-31

Actions
Has duplicate Redmine - Feature #13238: Sorting in GanttClosed

Actions
Has duplicate Redmine - Defect #6968: Sorting of issues in GanttClosed2010-11-24

Actions
Has duplicate Redmine - Defect #8366: Gantt Version OrderingClosed2011-05-13

Actions
Actions

Also available in: Atom PDF