Feature #11253 » Feature11253-0.patch
| app/helpers/queries_helper.rb (working copy) | ||
|---|---|---|
|
when 'Fixnum', 'Float'
|
||
|
if column.name == :done_ratio
|
||
|
progress_bar(value, :width => '80px')
|
||
|
elsif column.name == :spent_hours
|
||
|
elsif column.name == :spent_hours || column.name == :total_spent_hours
|
||
|
sprintf "%.2f", value
|
||
|
else
|
||
|
h(value.to_s)
|
||
| app/models/query.rb (working copy) | ||
|---|---|---|
|
@available_columns.each_with_index {|column, i| index = i if column.name == :estimated_hours}
|
||
|
index = (index ? index + 1 : -1)
|
||
|
# insert the column after estimated_hours or at the end
|
||
|
@available_columns.insert index, QueryColumn.new(:spent_hours,
|
||
|
:sortable => "(SELECT COALESCE(SUM(hours), 0) FROM #{TimeEntry.table_name} WHERE #{TimeEntry.table_name}.issue_id = #{Issue.table_name}.id)",
|
||
|
@available_columns.insert index, QueryColumn.new(:total_spent_hours,
|
||
|
:sortable => "(SELECT COALESCE(SUM(hours), 0) FROM #{TimeEntry.table_name} time_entry LEFT JOIN #{Issue.table_name} child_issue ON time_entry.issue_id = child_issue.id WHERE #{TimeEntry.table_name}.issue_id = #{Issue.table_name}.id OR child_issue.parent_id IS NOT NULL)",
|
||
|
:default_order => 'desc',
|
||
|
:caption => :label_spent_time
|
||
|
)
|
||