@@ -262,10 +262,9 class IssueQuery < Query | |||||
262 | ).visible.collect {|cf| QueryCustomFieldColumn.new(cf) } |
|
262 | ).visible.collect {|cf| QueryCustomFieldColumn.new(cf) } | |
263 |
|
263 | |||
264 | if User.current.allowed_to?(:view_time_entries, project, :global => true) |
|
264 | if User.current.allowed_to?(:view_time_entries, project, :global => true) | |
265 | index = nil |
|
265 | index = @available_columns.find_index {|column| column.name == :total_estimated_hours} | |
266 | @available_columns.each_with_index {|column, i| index = i if column.name == :estimated_hours} |
|
|||
267 | index = (index ? index + 1 : -1) |
|
266 | index = (index ? index + 1 : -1) | |
268 | # insert the column after estimated_hours or at the end |
|
267 | # insert the column after total_estimated_hours or at the end | |
269 | @available_columns.insert index, QueryColumn.new(:spent_hours, |
|
268 | @available_columns.insert index, QueryColumn.new(:spent_hours, | |
270 | :sortable => "COALESCE((SELECT SUM(hours) FROM #{TimeEntry.table_name} WHERE #{TimeEntry.table_name}.issue_id = #{Issue.table_name}.id), 0)", |
|
269 | :sortable => "COALESCE((SELECT SUM(hours) FROM #{TimeEntry.table_name} WHERE #{TimeEntry.table_name}.issue_id = #{Issue.table_name}.id), 0)", | |
271 | :default_order => 'desc', |
|
270 | :default_order => 'desc', |
General Comments 0
You need to be logged in to leave comments.
Login now