|
1 |
| -# require 'redmine' |
2 |
| -# require 'redmine_custom_workflows/hooks' |
3 |
| -# |
4 |
| -# to_prepare = Proc.new do |
5 |
| -# unless Project.include?(RedmineCustomWorkflows::ProjectPatch) |
6 |
| -# Project.send(:include, RedmineCustomWorkflows::ProjectPatch) |
7 |
| -# end |
8 |
| -# unless ProjectsHelper.include?(RedmineCustomWorkflows::ProjectsHelperPatch) |
9 |
| -# ProjectsHelper.send(:include, RedmineCustomWorkflows::ProjectsHelperPatch) |
10 |
| -# end |
11 |
| -# unless Issue.include?(RedmineCustomWorkflows::IssuePatch) |
12 |
| -# Issue.send(:include, RedmineCustomWorkflows::IssuePatch) |
13 |
| -# end |
14 |
| -# unless ActionView::Base.include?(RedmineCustomWorkflows::Helper) |
15 |
| -# ActionView::Base.send(:include, RedmineCustomWorkflows::Helper) |
16 |
| -# end |
17 |
| -# end |
18 |
| -# |
19 |
| -# if Redmine::VERSION::MAJOR >= 2 |
20 |
| -# Rails.configuration.to_prepare(&to_prepare) |
21 |
| -# else |
22 |
| -# require 'dispatcher' |
23 |
| -# Dispatcher.to_prepare(:redmine_custom_workflows, &to_prepare) |
24 |
| -# end |
25 |
| -# |
26 |
| -# Redmine::Plugin.register :redmine_custom_workflows do |
27 |
| -# name 'Redmine Custom Workflow plugin' |
28 |
| -# author 'Anton Argirov' |
29 |
| -# description 'Allows to create custom workflows for issues, defined in the plain Ruby language' |
30 |
| -# version '0.0.4' |
31 |
| -# url 'http://redmine.academ.org' |
32 |
| -# |
33 |
| -# menu :admin_menu, :custom_workflows, {:controller => 'custom_workflows', :action => 'index'}, :caption => :label_custom_workflow_plural |
34 |
| -# |
35 |
| -# permission :manage_project_workflow, {}, :require => :member |
36 |
| -# end |
| 1 | +require 'redmine' |
| 2 | +require 'redmine_custom_workflows/hooks' |
| 3 | + |
| 4 | +to_prepare = Proc.new do |
| 5 | + unless Project.include?(RedmineCustomWorkflows::ProjectPatch) |
| 6 | + Project.send(:include, RedmineCustomWorkflows::ProjectPatch) |
| 7 | + end |
| 8 | + unless ProjectsHelper.include?(RedmineCustomWorkflows::ProjectsHelperPatch) |
| 9 | + ProjectsHelper.send(:include, RedmineCustomWorkflows::ProjectsHelperPatch) |
| 10 | + end |
| 11 | + unless Issue.include?(RedmineCustomWorkflows::IssuePatch) |
| 12 | + Issue.send(:include, RedmineCustomWorkflows::IssuePatch) |
| 13 | + end |
| 14 | + unless ActionView::Base.include?(RedmineCustomWorkflows::Helper) |
| 15 | + ActionView::Base.send(:include, RedmineCustomWorkflows::Helper) |
| 16 | + end |
| 17 | +end |
| 18 | + |
| 19 | +if Redmine::VERSION::MAJOR >= 2 |
| 20 | + Rails.configuration.to_prepare(&to_prepare) |
| 21 | +else |
| 22 | + require 'dispatcher' |
| 23 | + Dispatcher.to_prepare(:redmine_custom_workflows, &to_prepare) |
| 24 | +end |
| 25 | + |
| 26 | +Redmine::Plugin.register :redmine_custom_workflows do |
| 27 | + name 'Redmine Custom Workflow plugin' |
| 28 | + author 'Anton Argirov' |
| 29 | + description 'Allows to create custom workflows for issues, defined in the plain Ruby language' |
| 30 | + version '0.0.4' |
| 31 | + url 'http://redmine.academ.org' |
| 32 | + |
| 33 | + menu :admin_menu, :custom_workflows, {:controller => 'custom_workflows', :action => 'index'}, :caption => :label_custom_workflow_plural |
| 34 | + |
| 35 | + permission :manage_project_workflow, {}, :require => :member |
| 36 | +end |
0 commit comments