The easiest and safest way to achieve this is to render the column content only when the spent time or total spent time is > 0:
diff --git a/app/helpers/queries_helper.rb b/app/helpers/queries_helper.rb
index 9b223f84a..401b8d776 100644
--- a/app/helpers/queries_helper.rb
+++ b/app/helpers/queries_helper.rb
@@ -268,9 +268,13 @@ module QueriesHelper
when :hours, :estimated_hours, :total_estimated_hours
format_hours(value)
when :spent_hours
- link_to_if(value > 0, format_hours(value), project_time_entries_path(item.project, :issue_id => "#{item.id}"))
+ if value > 0
+ link_to(format_hours(value), project_time_entries_path(item.project, :issue_id => "#{item.id}"))
+ end
when :total_spent_hours
- link_to_if(value > 0, format_hours(value), project_time_entries_path(item.project, :issue_id => "~#{item.id}"))
+ if value > 0
+ link_to(format_hours(value), project_time_entries_path(item.project, :issue_id => "~#{item.id}"))
+ end
when :attachments
value.to_a.map {|a| format_object(a)}.join(" ").html_safe
The current issue where an issue with spent time added with 0 hours cannot be distinguish from an issue with no spent times will remain.
I'm in favour of this change because the view will be cleaner and consistent with estimated time columns.