forked from ixti/redmine_tags
-
Notifications
You must be signed in to change notification settings - Fork 9
/
init.rb
78 lines (65 loc) · 2.94 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
# This file is a part of redmine_tags
# redMine plugin, that adds tagging support.
#
# Copyright (c) 2010 Aleksey V Zapparov AKA ixti
#
# redmine_tags is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# redmine_tags is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with redmine_tags. If not, see <http://www.gnu.org/licenses/>.
require 'redmine'
require 'redmine_tags'
require 'redmine_acts_as_taggable_on/initialize'
Redmine::Plugin.register :redmine_tags do
name 'Redmine Tags'
author 'Aleksey V Zapparov AKA "ixti"'
description 'Redmine issues and wiki pages tagging support'
version '2.0.1-dev'
url 'https://github.com/redminecrm/redmine_tags/'
author_url 'http://www.redminecrm.com/'
requires_redmine :version_or_higher => '2.1.0'
requires_acts_as_taggable_on
settings :default => {
:issues_sidebar => 'none',
:issues_show_count => 0,
:issues_open_only => 0,
:issues_sort_by => 'name',
:issues_sort_order => 'asc'
}, :partial => 'tags/settings'
end
ActionDispatch::Callbacks.to_prepare do
unless Issue.included_modules.include?(RedmineTags::Patches::IssuePatch)
Issue.send(:include, RedmineTags::Patches::IssuePatch)
end
[IssuesController, CalendarsController, GanttsController, SettingsController].each do |controller|
RedmineTags::Patches::AddHelpersForIssueTagsPatch.apply(controller)
end
unless WikiPage.included_modules.include?(RedmineTags::Patches::WikiPagePatch)
WikiPage.send(:include, RedmineTags::Patches::WikiPagePatch)
end
unless WikiController.included_modules.include?(RedmineTags::Patches::WikiControllerPatch)
WikiController.send(:include, RedmineTags::Patches::WikiControllerPatch)
end
unless AutoCompletesController.included_modules.include?(RedmineTags::Patches::AutoCompletesControllerPatch)
AutoCompletesController.send(:include, RedmineTags::Patches::AutoCompletesControllerPatch)
end
base = ActiveSupport::Dependencies::search_for_file('issue_query') ? IssueQuery : Query
unless base.included_modules.include?(RedmineTags::Patches::QueryPatch)
base.send(:include, RedmineTags::Patches::QueryPatch)
end
base = ActiveSupport::Dependencies::search_for_file('issue_queries_helper') ? IssueQueriesHelper : QueriesHelper
unless base.included_modules.include?(RedmineTags::Patches::QueriesHelperPatch)
base.send(:include, RedmineTags::Patches::QueriesHelperPatch)
end
end
require 'redmine_tags/hooks/model_issue_hook'
require 'redmine_tags/hooks/views_issues_hook'
require 'redmine_tags/hooks/views_wiki_hook'