diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-09-19 07:29:08 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-09-19 07:29:08 +0000 |
commit | d1d1f81e9468e42950327fd8100e1e353a837972 (patch) | |
tree | 42e187534a32d8bee008c7fcc8c62f6e35db46aa /app/models/issue_query.rb | |
parent | d4e1f7030826829d3e21e8c9c189db07b245b8f0 (diff) | |
download | redmine-d1d1f81e9468e42950327fd8100e1e353a837972.tar.gz redmine-d1d1f81e9468e42950327fd8100e1e353a837972.zip |
"Total estimated time" should be inserted after "Estimated time" (#20733).
Pätch by Go MAEDA.
git-svn-id: http://svn.redmine.org/redmine/trunk@14602 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/issue_query.rb')
-rw-r--r-- | app/models/issue_query.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/app/models/issue_query.rb b/app/models/issue_query.rb index e21ccf618..08e22e966 100644 --- a/app/models/issue_query.rb +++ b/app/models/issue_query.rb @@ -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', |