gantt: change sort method to class method (#7335)

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11855 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2013-05-17 22:59:39 +00:00
parent c90bf645f5
commit 6aa63659aa
1 changed files with 4 additions and 4 deletions

View File

@ -214,7 +214,7 @@ module Redmine
@number_of_rows += 1
return if abort?
issues = project_issues(project).select {|i| i.fixed_version.nil?}
sort_issues!(issues)
self.class.sort_issues!(issues)
if issues
render_issues(issues, options)
return if abort?
@ -248,7 +248,7 @@ module Redmine
return if abort?
issues = version_issues(project, version)
if issues
sort_issues!(issues)
self.class.sort_issues!(issues)
# Indent issues
options[:indent] += options[:indent_increment]
render_issues(issues, options)
@ -676,12 +676,12 @@ module Redmine
end
# TODO: Sorts a collection of issues by start_date, due_date, id for gantt rendering
def sort_issues!(issues)
def self.sort_issues!(issues)
issues.sort! { |a, b| gantt_issue_compare(a, b) }
end
# TODO: top level issues should be sorted by start date
def gantt_issue_compare(x, y)
def self.gantt_issue_compare(x, y)
if x.root_id == y.root_id
x.lft <=> y.lft
else