diff --git a/lib/overhead_time_entry_activity_patch.rb b/lib/overhead_time_entry_activity_patch.rb index 2fa454d..7a912f9 100644 --- a/lib/overhead_time_entry_activity_patch.rb +++ b/lib/overhead_time_entry_activity_patch.rb @@ -39,6 +39,7 @@ module OverheadTimeEntryActivityPatch return false unless field custom_value = self.custom_value_for(field) + return false unless custom_value if field.field_format == 'bool' # Map string values to proper booleans diff --git a/lib/overhead_timesheet_hook.rb b/lib/overhead_timesheet_hook.rb index 22f5e67..12481af 100644 --- a/lib/overhead_timesheet_hook.rb +++ b/lib/overhead_timesheet_hook.rb @@ -3,4 +3,13 @@ class OverheadTimesheetHook < Redmine::Hook::ViewListener def plugin_timesheet_views_timesheet_group_header(context={}) return content_tag(:th, l(:overhead_field_billable)) end + + def plugin_timesheet_views_timesheet_time_entry(context={}) + time_entry = context[:time_entry] + if time_entry && time_entry.billable? + content_tag(:td, image_tag('true.png')) + else + content_tag(:td,'') + end + end end diff --git a/spec/lib/overhead_timesheet_hook_spec.rb b/spec/lib/overhead_timesheet_hook_spec.rb index 39b097a..d23aa67 100644 --- a/spec/lib/overhead_timesheet_hook_spec.rb +++ b/spec/lib/overhead_timesheet_hook_spec.rb @@ -5,3 +5,32 @@ describe OverheadTimesheetHook, "#plugin_timesheet_views_timesheet_group_header" OverheadTimesheetHook.instance.plugin_timesheet_views_timesheet_group_header.should eql('