-
Notifications
You must be signed in to change notification settings - Fork 3
/
init.rb
37 lines (30 loc) · 1.73 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
require 'redmine'
require 'dispatcher'
require 'will_paginate'
Dispatcher.to_prepare :redmine_departments do
require_dependency 'issue'
# Guards against including the module multiple time (like in tests)
# and registering multiple callbacks
Issue.send(:include, RedmineDepartments::IssuePatch) unless Issue.included_modules.include?(RedmineDepartments::IssuePatch)
ApplicationController.send(:include, RedmineDepartments::ApplicationControllerPatch) unless ApplicationController.included_modules.include?(RedmineDepartments::ApplicationControllerPatch)
Query.send(:include, RedmineDepartments::QueryPatch) unless Query.included_modules.include? RedmineDepartments::QueryPatch
end
require_dependency 'departments_show_issue_hook'
Redmine::Plugin.register :redmine_departments do
name 'Redmine Departments plugin'
author 'Nick Peelman'
author_url 'http://peelman.us'
url 'http://github.com/peelman/redmine_departments'
description 'Departments Plugin for the LSSupport Group. Icons are from the Silk collection, by FamFamFam'
version '1.0.0'
menu :top_menu, :departments, { :controller => :departments, :action => :index }, :caption => 'Departments'
menu :admin_menu, :departments, {:controller => :departments, :action => :index }, :caption => 'Departments'
project_module :departments do |map|
map.permission :view_departments, { :departments => [:index, :show] }
map.permission :add_departments, { :departments => :new }
map.permission :edit_departments, { :departments => :edit }
map.permission :delete_departments, { :departments => :delete }
map.permission :add_issue_to_department, { :departments => :addissue }
map.permission :remove_issue_from_department, { :departments => :removeissue }
end
end