]> source.dussan.org Git - redmine.git/commitdiff
"Total estimated time" should be inserted after "Estimated time" (#20733).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 19 Sep 2015 07:29:08 +0000 (07:29 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 19 Sep 2015 07:29:08 +0000 (07:29 +0000)
Pätch by Go MAEDA.

git-svn-id: http://svn.redmine.org/redmine/trunk@14602 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/issue_query.rb

index e21ccf618fbad880d24bdcdccc445bfc671a5513..08e22e966e141cb285e50ba1afe6128dcb313933 100644 (file)
@@ -262,10 +262,9 @@ class IssueQuery < Query
                            ).visible.collect {|cf| QueryCustomFieldColumn.new(cf) }
 
     if User.current.allowed_to?(:view_time_entries, project, :global => true)
-      index = nil
-      @available_columns.each_with_index {|column, i| index = i if column.name == :estimated_hours}
+      index = @available_columns.find_index {|column| column.name == :total_estimated_hours}
       index = (index ? index + 1 : -1)
-      # insert the column after estimated_hours or at the end
+      # insert the column after total_estimated_hours or at the end
       @available_columns.insert index, QueryColumn.new(:spent_hours,
         :sortable => "COALESCE((SELECT SUM(hours) FROM #{TimeEntry.table_name} WHERE #{TimeEntry.table_name}.issue_id = #{Issue.table_name}.id), 0)",
         :default_order => 'desc',