forked from dalyons/redmine-todos-scrum-plugin
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinit.rb
68 lines (51 loc) · 2.25 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
require 'redmine'
# Hooks
require_dependency 'todo_issues_hook'
Rails.configuration.to_prepare do
require_dependency 'project'
require_dependency 'user'
#application.rb changed names between rails verisons - hack for backwards compatibility
begin
require_dependency 'application_controller'
rescue MissingSourceFile
require_dependency 'application'
end
#This file loads some associations into the core redmine classes, like associations to todos.
require_dependency 'patches/project_patch'
require_dependency 'patches/user_patch'
require_dependency 'patches/issues_controller_patch'
end
Redmine::Plugin.register :redmine_todos_plugin do
name 'Redmine Todo Lists plugin'
author 'David Lyons'
description 'A plugin to create and manage agile-esque todo lists on a per project basis.'
version '0.0.4.3'
settings :default => {
'todos_auto_complete_parent' => false
}, :partial => 'settings/settings'
project_module :todo_lists do
permission :view_todos, {:todos => [:index, :show] }
permission :edit_todos,
{:todos => [:create, :destroy, :new, :toggle_complete, :sort, :edit, :update],
:issues => [:create, :destroy, :new, :toggle_complete, :sort, :edit, :update]}
permission :use_personal_todos,
{:mytodos => [:index,:destroy, :new, :create, :toggle_complete, :index, :sort, :edit, :update]}
end
menu :top_menu, :mytodos, { :controller => 'mytodos', :action => 'index' },
:caption => :my_todos_title,
:if => Proc.new {
User.current.allowed_to?(:use_personal_todos, nil, :global => true)
}
menu :project_menu, :todos, {:controller => 'todos', :action => 'index'},
:caption => :label_todo_plural, :after => :new_issue, :param => :project_id
activity_provider :todos, :default => false
end
#fix required to make the plugin work in devel mode with rails 2.2
# as per http://www.ruby-forum.com/topic/171629
#config.auto_load_paths.each do |path|
# ActiveSupport::Dependencies.load_once_paths.delete(path)
#end
# now we should include this module in ApplicationHelper module
#unless ApplicationHelper.included_modules.include? BoardsWatchers::Patches::ApplicationHelperPatch
# ApplicationHelper.send(:include, BoardsWatchers::Patches::ApplicationHelperPatch)
#end