]> source.dussan.org Git - redmine.git/commitdiff
gantt: change sort method to class method (#7335)
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 17 May 2013 22:59:39 +0000 (22:59 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 17 May 2013 22:59:39 +0000 (22:59 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11855 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/helpers/gantt.rb

index f4c5d8ac07f853b1faa4e2598bb11fde2121ad2b..7538c48dcfa2aded4a095d548640061006b9faf7 100644 (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