forked from alexbevi/redmine_advanced_roadmap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.rb
76 lines (66 loc) · 2.89 KB
/
init.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# This plugin should be reloaded in development mode.
if Rails.env.development? == "development"
ActiveSupport::Dependencies.load_once_paths.reject!{|x| x =~ /^#{Regexp.escape(File.dirname(__FILE__))}/}
end
if Gem::Version.new("3.0") > Gem::Version.new(Rails.version) then
require "redmine"
require "dispatcher"
require_dependency File.dirname(File.dirname(__FILE__)) + "/awesome_nested_set/rails/init"
end
require "rubygems"
require "gravatar"
if Gem::Version.new("3.0") > Gem::Version.new(Rails.version) then
Dispatcher.to_prepare do
begin
require_dependency "application"
rescue LoadError
require_dependency "application_controller"
end
ApplicationHelper.send(:include, AdvancedRoadmap::ApplicationHelperPatch)
Issue.send(:include, AdvancedRoadmap::IssuePatch)
IssuesController.send(:include, AdvancedRoadmap::IssuesControllerPatch)
Project.send(:include, AdvancedRoadmap::ProjectPatch)
ProjectsHelper.send(:include, AdvancedRoadmap::ProjectsHelperPatch)
Redmine::I18n.send(:include, AdvancedRoadmap::RedmineI18nPatch)
Version.send(:include, AdvancedRoadmap::VersionPatch)
VersionsController.send(:include, AdvancedRoadmap::VersionsControllerPatch)
end
else
Rails.configuration.to_prepare do
begin
require_dependency "application"
rescue LoadError
require_dependency "application_controller"
end
ApplicationHelper.send(:include, AdvancedRoadmap::ApplicationHelperPatch)
Issue.send(:include, AdvancedRoadmap::IssuePatch)
IssuesController.send(:include, AdvancedRoadmap::IssuesControllerPatch)
Project.send(:include, AdvancedRoadmap::ProjectPatch)
ProjectsHelper.send(:include, AdvancedRoadmap::ProjectsHelperPatch)
Redmine::I18n.send(:include, AdvancedRoadmap::RedmineI18nPatch)
Version.send(:include, AdvancedRoadmap::VersionPatch)
VersionsController.send(:include, AdvancedRoadmap::VersionsControllerPatch)
end
end
require_dependency "advanced_roadmap/view_hooks"
#RAILS_DEFAULT_LOGGER.info "Advanced roadmap & milestones plugin for RedMine"
Redmine::Plugin.register :redmine_advanced_roadmap do
name "Advanced Roadmap"
url "https://bitbucket.org/StrangeWill/redmine-advanced-roadmap/"
author "Emilio Gonzalez Montana, William Roush"
author_url "https://bitbucket.org/StrangeWill/redmine-advanced-roadmap/"
description "Additional performance metrics analysis for Redmine's Roadmap feature and support for project milestones."
version "0.7.0"
permission :manage_milestones, {:milestones => [:add, :edit, :destroy]}
requires_redmine :version_or_higher => "1.0.2"
settings :default => {
"parallel_effort_custom_field" => "",
"solved_issues_to_estimate" => "5",
"ratio_good" => "0.8",
"color_good" => "green",
"ratio_bad" => "1.2",
"color_bad" => "orange",
"ratio_very_bad" => "1.5",
"color_very_bad" => "red"
}, :partial => "settings/advanced_roadmap_settings"
end