Project

General

Profile

RE: Writing plugins compatible with both Redmine 1.x and ... » init.rb

Marco Nobler, 2012-11-05 15:38

 
1
require 'redmine'
2

    
3
require 'dispatcher' unless Rails::VERSION::MAJOR >= 3
4

    
5
if Rails::VERSION::MAJOR >= 3
6
  #TODO
7
  ActionDispatch::Callbacks.to_prepare do
8
    # use require_dependency if you plan to utilize development mode
9
    require_dependency 'redmine_tlcit/patches/issue_patch'
10
    require_dependency 'redmine_tlcit/patches/issues_controller_patch'
11
    require_dependency 'redmine_tlcit/patches/project_patch'
12
    require_dependency 'redmine_tlcit/patches/query_patch'
13
    require_dependency 'redmine_tlcit/patches/queries_helper_patch'
14
    require_dependency 'redmine_tlcit/patches/issues_helper_patch'
15
    require_dependency 'redmine_tlcit/patches/application_helper_patch'
16
  end
17
else
18
  Dispatcher.to_prepare do
19
  #Dispatcher.to_prepare BW_AssetHelpers::PLUGIN_NAME do
20
    # Patches
21
    require_dependency 'redmine_tlcit/patches/issue_patch'
22
    require_dependency 'redmine_tlcit/patches/issues_controller_patch'
23
    require_dependency 'redmine_tlcit/patches/project_patch'
24
    require_dependency 'redmine_tlcit/patches/query_patch'
25
    require_dependency 'redmine_tlcit/patches/queries_helper_patch'
26
    require_dependency 'redmine_tlcit/patches/issues_helper_patch'
27
    require_dependency 'redmine_tlcit/patches/application_helper_patch'
28
  end
29
end
30

    
31

    
32
# Hooks
33
  require_dependency 'redmine_tlcit/hooks'
34

    
35
Redmine::Plugin.register :redmine_tlcit do
36
  name 'Redmine TelecomItalia'
37
  author ''
38
  description 'Adattamento di Redmine alle esigenze di TelecomItalia'
39
  version '1.02'
40

    
41
  permission :new_impacts, :impacts => :new
42
  permission :destroy_impacts, :impacts => :destroy
43

    
44
  settings(:partial => 'settings/tlcit_settings',
45
           :default => {
46
             'id_tracker_rda' => '0', 'id_tracker_impact' => '0'
47
           })
48

    
49
end
(1-1/2)