Project

General

Profile

Actions

Defect #6968

closed

Sorting of issues in Gantt

Added by alexis coudeyras almost 14 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Gantt
Target version:
-
Start date:
2010-11-24
Due date:
% Done:

0%

Estimated time:
Resolution:
Duplicate
Affected version:

Description

I've got a problem with the sorting of issues in the Gantt. Some issues are not affected to their parent but to another parent.
I don't think it's possible to sort the list of issues correctly with a comparer like it's done in gantt.rb, so i've modified the gantt.rb in lib/redmine/helpers. I have added a private function :

def gantt_issue_sort(all)
def get_sorted_childs(id, issues)
childs = issues.select {| i|
i.parent_id == id
}.sort {|x, y|
gantt_start_compare(x, y)
}
childs
end
def sort(id, issues, result)
childs = get_sorted_childs(id, issues)
childs.each do |c|
result << c
sort(c.id, issues, result)
end
end
result = []
issues = all.select {|i| i.is_a?(Issue)}
others = all.select {|i| not i.is_a?(Issue)}
sort(nil, issues, result)
result += others
result
end

and i have modified the def events=(e), just before the reject i have added :
@events = gantt_issue_sort(@events)

It's just a quick and dirty fix by somebody who has no experience in ruby programming, but i thought it might help to send you my code.


Related issues

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

Actions
Is duplicate of Redmine - Defect #7335: Sorting issues in gantt by date, not by idClosedToshi MARUYAMA2011-01-15

Actions
Actions

Also available in: Atom PDF