From 256627d2a36bb0019f3f6067bb01ce53d7fbbee3 Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Wed, 21 Jan 2009 11:23:15 -0800 Subject: [PATCH] Ported the table header from the Budget plugin hook. #1923 --- init.rb | 2 ++ lib/rate_project_hook.rb | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 lib/rate_project_hook.rb diff --git a/init.rb b/init.rb index ac43e65..7330fd7 100644 --- a/init.rb +++ b/init.rb @@ -3,6 +3,8 @@ require 'redmine' require 'rate_users_helper_patch' require 'rate_sort_helper_patch' +require 'rate_project_hook' + Redmine::Plugin.register :redmine_rate do name 'Rate Plugin' author 'Eric Davis' diff --git a/lib/rate_project_hook.rb b/lib/rate_project_hook.rb new file mode 100644 index 0000000..874af57 --- /dev/null +++ b/lib/rate_project_hook.rb @@ -0,0 +1,18 @@ +# Hooks to attach to the Redmine Projects. +class RateProjectHook < Redmine::Hook::ViewListener + + def protect_against_forgery? + false + end + + # Renders an additional table header to the membership setting + # + # Context: + # * :project => Current project + # + def view_projects_settings_members_table_header(context ={ }) + return "#{l(:rate_label_rate)} #{l(:rate_label_currency)}" + end + +end +