From f900e2ea30a3e5cc3823638f4166d375c6150402 Mon Sep 17 00:00:00 2001 From: Philipp Tessenow Date: Fri, 29 Jun 2012 15:47:29 +0200 Subject: [PATCH] move cost_entry settings from the engine to this plugin --- init.rb | 1 + lib/redmine_widgets/settings.rb | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 lib/redmine_widgets/settings.rb diff --git a/init.rb b/init.rb index 9b5005fd19..e785b38ad3 100644 --- a/init.rb +++ b/init.rb @@ -6,6 +6,7 @@ $LOAD_PATH << File.expand_path("../lib/redmine_widgets", __FILE__) require 'simple_table' require 'entry_table' require 'cost_types' +require 'settings' Redmine::Plugin.register :redmine_reporting do name 'Reporting Plugin' diff --git a/lib/redmine_widgets/settings.rb b/lib/redmine_widgets/settings.rb new file mode 100644 index 0000000000..5d5e4b5396 --- /dev/null +++ b/lib/redmine_widgets/settings.rb @@ -0,0 +1,19 @@ +class Widget::Settings < Widget::Base + + @@settings_to_render.insert -2, :cost_types + + def render_cost_types_settings + render_widget Widget::Settings::Fieldset, @subject, { :type => "units" } do + render_widget Widget::CostTypes, + @cost_types, + :selected_type_id => @selected_type_id + end + end + + def render_with_options(options, &block) + @cost_types = options.delete(:cost_types) + @selected_type_id = options.delete(:selected_type_id) + + super(options, &block) + end +end