diff --git a/config/locales/en.yml b/config/locales/en.yml index d6ad08b..38a22ee 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2,3 +2,4 @@ en: overhead_field_billing_status: Billing Status overhead_field_billable_value: Billable Value overhead_field_overhead_value: Overhead Value + overhead_field_billable: Billable diff --git a/init.rb b/init.rb index 8940541..2d2a84d 100644 --- a/init.rb +++ b/init.rb @@ -9,6 +9,8 @@ Dispatcher.to_prepare do TimeEntryActivity.send(:include, OverheadTimeEntryActivityPatch) end +require 'overhead_timesheet_hook' + Redmine::Plugin.register :redmine_overhead do name 'Overhead plugin' author 'Eric Davis' diff --git a/lib/overhead_timesheet_hook.rb b/lib/overhead_timesheet_hook.rb new file mode 100644 index 0000000..22f5e67 --- /dev/null +++ b/lib/overhead_timesheet_hook.rb @@ -0,0 +1,6 @@ +class OverheadTimesheetHook < Redmine::Hook::ViewListener + + def plugin_timesheet_views_timesheet_group_header(context={}) + return content_tag(:th, l(:overhead_field_billable)) + end +end diff --git a/spec/lib/overhead_timesheet_hook_spec.rb b/spec/lib/overhead_timesheet_hook_spec.rb new file mode 100644 index 0000000..39b097a --- /dev/null +++ b/spec/lib/overhead_timesheet_hook_spec.rb @@ -0,0 +1,7 @@ +require File.dirname(__FILE__) + '/../spec_helper' + +describe OverheadTimesheetHook, "#plugin_timesheet_views_timesheet_group_header" do + it 'should add a Billable column to the table' do + OverheadTimesheetHook.instance.plugin_timesheet_views_timesheet_group_header.should eql('Billable') + end +end