Project

General

Profile

Actions

Defect #6968

closed

Sorting of issues in Gantt

Added by alexis coudeyras over 13 years ago. Updated about 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 #1

Updated by Sepp _ over 13 years ago

What is the difference to the solution in #5438ß

Actions #2

Updated by alexis coudeyras over 13 years ago

I've tried the patch in #5438, it seems to work (and his patch is better than mine). My datas have changed a lot, so it's difficult to tell if patch #5438 really solve my problem. I keep it and check if it's ok.

Actions #3

Updated by Toshi MARUYAMA about 11 years ago

  • Status changed from New to Closed
  • Resolution set to Duplicate

I close this issue as duplicate with #7335 because #7335 has more discussion.

Actions

Also available in: Atom PDF