forked from hron/redmine_subtasks
-
Notifications
You must be signed in to change notification settings - Fork 1
/
init.rb
49 lines (40 loc) · 1.77 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
require 'dispatcher'
require 'redmine'
require 'redmine_subtasks/setting'
require 'redmine_subtasks/redmine_ext'
require 'redmine_subtasks/issues_controller_hooks'
RAILS_DEFAULT_LOGGER.info 'Starting Subtasks plugin for RedMine'
Redmine::Plugin.register :redmine_subtasks do
name 'Subtasks plugin'
author 'Aleksei Gusev'
author_url 'mailto:Aleksei Gusev <[email protected]>?subject=redmine_subtasks'
description 'This is plugin for Redmine for adding subtasks functionality.'
url 'http://github.com/hron/redmine_subtasks'
version '0.0.1'
requires_redmine :version_or_higher => '0.8.0'
settings :default => { :delete_children => 1,
:subissues_list_columns => [ :id,
:subject,
:status,
:start_date,
:due_date ] },
:partial => 'settings/subtasks_settings'
# remapping permissions
Redmine::AccessControl.permissions.delete_if do |p|
p.name == :manage_issue_relations
end
project_module :issue_tracking do |map|
map.permission :manage_issue_relations, {
:issue_relations => [:new, :destroy],
:issues => [:add_subissue]
}
end
end
Dispatcher.to_prepare do
Issue.send( :include, RedmineSubtasks::RedmineExt::IssuePatch)
Version.send( :include, RedmineSubtasks::RedmineExt::VersionPatch)
Query.send( :include, RedmineSubtasks::RedmineExt::QueryPatch)
IssuesHelper.send(:include, RedmineSubtasks::RedmineExt::IssuesHelperPatch)
QueriesHelper.send(:include, RedmineSubtasks::RedmineExt::QueriesHelperPatch)
VersionsHelper.send(:include, RedmineSubtasks::RedmineExt::VersionsHelperPatch)
end