In it's current state (0.1.0) the plugin is incompatible with Redmine devel. I'll attach the contents of a patch-file which solves the issue, though the chosen solution is not working while running in development mode. This is a TODO.
I've also fixed a minor error in the settings-partial, resulting in a correct display of the currently configured project custom-field in the settings-partial which I've also renamed to prevent collisions with other plugins.
Index: app/models/iframe_text.rb
===================================================================
--- app/models/iframe_text.rb (revision 218)
+++ app/models/iframe_text.rb (working copy)
@@ -1,9 +1,7 @@
-require 'net/imap'
-
class IframeText
def self.get_iframe_text(project)
- # Find all of the projects that have enabled the "ticket emailer" plugin
+ # Find all of the projects that have enabled the "google calendar" plugin
iframe_text = project.custom_values.detect {|v| v.custom_field_id == Setting.plugin_redmine_google_calendar['iframe_text'].to_i}
iframe_text = iframe_text.value if iframe_text
Index: app/views/settings/_googlecalendar_settings.rhtml
===================================================================
--- app/views/settings/_googlecalendar_settings.rhtml (revision 0)
+++ app/views/settings/_googlecalendar_settings.rhtml (revision 0)
@@ -0,0 +1,10 @@
+<% string_fields = ProjectCustomField.find :all %>
+
+This will allow you to create a tab that references a custom iframe. You will need to go to 'Admin -> Custom fields' and create the follow field of type 'Long text'.
+
+
+ iFrame Text
+ <%= select_tag 'settings[iframe_text]',
+ '<option value="">(Select one)</option>' +
+ options_from_collection_for_select(string_fields, :id, :name, @settings['iframe_text'].to_i) %>
+
Index: app/views/settings/_settings.rhtml
===================================================================
--- app/views/settings/_settings.rhtml (revision 218)
+++ app/views/settings/_settings.rhtml (working copy)
@@ -1,9 +0,0 @@
-<% string_fields = ProjectCustomField.find :all %>
-
-This will allow you to create a tab that references a custom iframe. You will need to go to 'Admin -> Custom fields' and create the follow field of type 'Long text'.
-
-iFrame Text
-<%= select_tag 'settings[iframe_text]',
- '<option value="">(Select one)</option>' +
- options_from_collection_for_select(string_fields, :id, :name, @settings['iframe_tab'].to_i) %>
-
Index: init.rb
===================================================================
--- init.rb (revision 218)
+++ init.rb (working copy)
@@ -19,16 +19,17 @@
RAILS_DEFAULT_LOGGER.info 'Google Calendar'
-# Redmine ticket emailer plugin
+# Redmine Google Calendar plugin
Redmine::Plugin.register :redmine_google_calendar do
name 'Google Calendar Plugin'
author 'Jim Mulholland'
description 'A plugin to allow users to add a new tab with an embedded Google Calendar Iframe.'
- version '0.1.0'
+ version '0.2.0'
- # The data necessary to log into your email server.
- # For this first rev, I am assuming you have an IMAP server
- settings :default => {'iframe_text' => ''}, :partial => 'settings/settings'
+ # This plugin contains settings
+ settings :default => {
+ 'iframe_text' => ''
+ }, :partial => 'settings/googlecalendar_settings'
# This plugin adds a project module
# It can be enabled/disabled at project level (Project settings -> Modules)
@@ -42,10 +43,11 @@
menu :project_menu, :google_calendar, :controller => 'google_calendar', :action => 'show'
end
-Rails::Plugin.class_eval do
- def reloadable!
- load_paths.each { |p| Dependencies.load_once_paths.delete(p) }
- end
-end
-
-reloadable!
+## Commented-out for Redmine 0.9-devel compatibility
+## TODO Fix development-mode compatibility
+# Rails::Plugin.class_eval do
+# def reloadable!
+# load_paths.each { |p| Dependencies.load_once_paths.delete(p) }
+# end
+# end
+# reloadable!