-
Notifications
You must be signed in to change notification settings - Fork 25
/
init.rb
52 lines (44 loc) · 2.12 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
# ezFAQ plugin for redMine
# Copyright (C) 2008-2009 Zou Chaoqun
#
# This program 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 2
# of the License, or (at your option) any later version.
#
# This program 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 this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require 'redmine'
# Patches to the Redmine core. Will not work in development mode
require 'dispatcher'
require 'attachment_patch'
Dispatcher.to_prepare do
Attachment.send(:include, AttachmentPatch)
end
# Hooks
require_dependency 'ezfaq_layouts_hook'
Redmine::Plugin.register :ezfaq_plugin do
name 'ezFAQ plugin'
author 'Zou Chaoqun'
description 'This is a FAQ management plugin for Redmine'
version '0.3.5'
url 'http://ezwork.techcon.thtf.com.cn/projects/ezwork'
author_url 'mailto:[email protected]'
project_module :ezfaq do
permission :view_faqs, {:ezfaq => [:index, :show, :history, :diff, :show_history_version]}, :public => true
permission :add_faqs, {:ezfaq => [:new, :preview]}, :require => :loggedin
permission :edit_faqs, {:ezfaq => [:edit, :preview, :copy, :list_invalid_faqs]}, :require => :member
permission :delete_faqs, {:ezfaq => [:destroy]}, :require => :member
permission :manage_faq_categories, {:ezfaq => [:add_faq_category], :faq_categories => [:index, :change_order, :edit, :destroy]}, :require => :member
permission :faq_setting, {:ezfaq => [:faq_setting]}, :require => :member
end
menu :project_menu, :ezfaq, { :controller => 'ezfaq', :action => 'index' }, :caption => :label_title_ezfaq
# Faqs are added to the activity view
activity_provider :faqs, :class_name => 'Faq::FaqVersion', :default => false
end