forked from jbbarth/redmine_organizations
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.rb
56 lines (48 loc) · 2.35 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
require 'redmine'
require_dependency 'query'
require_dependency 'issue_query'
#hooks
require_dependency 'redmine_organizations/hooks/view_layouts_base_html_head_hook'
# Patches to existing classes/modules
ActiveSupport::Reloader.to_prepare do
require_dependency 'redmine_organizations/patches/user_patch'
require_dependency 'redmine_organizations/patches/group_patch'
require_dependency 'redmine_organizations/patches/issue_patch'
require_dependency 'redmine_organizations/patches/issue_query_patch'
require_dependency 'redmine_organizations/patches/mailer_patch'
require_dependency 'redmine_organizations/patches/project_patch'
require_dependency 'redmine_organizations/patches/users_helper_patch'
require_dependency 'redmine_organizations/patches/member_role_patch'
require_dependency 'redmine_organizations/patches/member_patch'
require_dependency 'redmine_organizations/patches/members_helper_patch'
require_dependency 'redmine_organizations/patches/users_controller_patch'
require_dependency 'redmine_organizations/patches/application_controller_patch'
require_dependency 'redmine_organizations/patches/field_format_patch'
#ensure our helper is included
ActionView::Base.send(:include, OrganizationsHelper)
end
Redmine::Plugin.register :redmine_organizations do
name 'Redmine Organizations plugin'
author 'Jean-Baptiste BARTH'
description 'Adds "organization" structure to replace Redmine groups'
url 'http://github.com/jbbarth/redmine_organizations'
author_url 'mailto:jeanbaptiste.barth@gmail.com'
version '3.4.4'
requires_redmine :version_or_higher => '3.0.0'
requires_redmine_plugin :redmine_base_rspec, :version_or_higher => '0.0.3' if Rails.env.test?
requires_redmine_plugin :redmine_base_deface, :version_or_higher => '0.0.1'
settings :default => {
'hide_groups_admin_menu' => "0",
'default_team_leader_role' => nil
}, :partial => 'settings/organizations_settings'
end
Redmine::MenuManager.map :admin_menu do |menu|
menu.push :organizations, {:controller => 'organizations'},
:after => :groups,
:caption => :label_organization_plural,
:html => {:class => 'icon'}
end
Redmine::MenuManager.map :top_menu do |menu|
menu.push :organizations, {:controller => 'organizations'}, :caption => :label_organization_plural,
:if => Proc.new {User.current.logged?}, :last => true
end