-
Notifications
You must be signed in to change notification settings - Fork 66
/
init.rb
100 lines (85 loc) · 3.69 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
require 'redmine'
require 'aasm'
require "block_helpers"
# Patches to the Redmine core.
require 'dispatcher'
Dispatcher.to_prepare :redmine_kanban do
require_dependency 'user_preference'
UserPreference.send(:include, RedmineKanban::Patches::UserPreferencePatch)
require_dependency 'principal'
Principal.send(:include, RedmineKanban::Patches::PrincipalPatch)
require_dependency 'issue'
# Guards against including the module multiple time (like in tests)
# and registering multiple callbacks
unless Issue.included_modules.include? RedmineKanban::IssuePatch
Issue.send(:include, RedmineKanban::IssuePatch)
end
end
Redmine::Plugin.register :redmine_kanban do
name 'Kanban'
author 'Eric Davis'
url 'https://projects.littlestreamsoftware.com/projects/redmine-kanban'
author_url 'http://www.littlestreamsoftware.com'
description 'The Redmine Kanban plugin is used to manage issues according to the Kanban system of project management.'
version '0.2.0'
requires_redmine :version_or_higher => '0.9.0'
permission(:view_kanban, {:kanbans => [:show], :kanban_overviews => [:show]})
permission(:edit_kanban, {:kanbans => [:update, :sync], :kanban_issues => [:edit]})
permission(:manage_kanban, {})
permission(:view_my_kanban_requests, {:user_kanbans => [:show, :create], :kanban_issues => [:new]}, :public => true)
permission(:view_assigned_kanban, {:assigned_kanbans => [:show, :create]}, :public => true)
permission(:view_issue_in_kanban, {:kanban_issues => [:show]}, :public => true)
settings(:partial => 'settings/kanban_settings',
:default => {
'panes' => {
'incoming' => { 'status' => nil, 'limit' => 5, 'excluded_priorities' => nil, 'excluded_projects' => nil, 'url' => nil},
'backlog' => { 'status' => nil, 'limit' => 15},
'selected' => { 'status' => nil, 'limit' => 8},
'quick-tasks' => {'limit' => 5},
'active' => { 'status' => nil, 'limit' => 5},
'testing' => { 'status' => nil, 'limit' => 5},
'finished' => {'status' => nil, 'limit' => 7},
'canceled' => {'status' => nil, 'limit' => 7}
},
'management_group' => nil,
'staff_role' => nil,
'user_help' => "_Each list is a Pane of issues. The issues can be dragged and dropped onto other panes based on Roles and Permissions settings._",
'project_level' => 0,
'rollup' => 0,
'simple_issue_popup_form' => 0,
'reverse_pane_order' => 0,
'panels' => {
'overview' => {
'subissues_take_higher_priority' => 0
}
},
'incoming_projects' => []
})
menu(:top_menu,
:kanban,
{:controller => 'kanbans', :action => 'show'},
:caption => :kanban_title,
:if => Proc.new {
User.current.allowed_to?(:view_kanban, nil, :global => true)
})
menu(:top_menu,
:kanban_overview,
{:controller => 'kanban_overviews', :action => 'show'},
:caption => :kanban_overview_title,
:if => Proc.new {
User.current.allowed_to?(:view_kanban, nil, :global => true)
})
menu(:top_menu,
:my_kanban_requests,
{:controller => 'user_kanbans', :action => 'show', :id => nil},
:caption => :text_my_kanban_requests_title,
:after => :kanban,
:require => :loggedin)
menu(:top_menu,
:assigned_kanban,
{:controller => 'assigned_kanbans', :action => 'show', :id => nil},
:caption => :text_assigned_kanban_title,
:after => :kanban,
:require => :loggedin)
end
require 'redmine_kanban/hooks/view_my_account_hook'