This repository has been archived by the owner on Jan 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathinit.rb
49 lines (43 loc) · 1.82 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
require_dependency 'vendor/plugins/acts_as_customizable/init'
require_dependency 'vendor/plugins/acts_as_list/init'
require_dependency 'vendor/plugins/acts_as_event/init'
require_dependency 'vendor/plugins/acts_as_activity_provider/init'
require_dependency 'vendor/plugins/acts_as_searchable/init'
require_dependency 'vendor/plugins/awesome_nested_set/init'
require_dependency 'vendor/plugins/acts_as_attachable/init'
require_dependency 'vendor/plugins/acts_as_watchable/init'
require_dependency 'issue'
require_dependency 'changeset'
require 'redmine'
require 'ruby-freshbooks'
require 'redmine_freshbooks'
require 'project_patch'
require 'time_entry_patch'
require 'user_patch'
require 'dispatcher'
Dispatcher.to_prepare :redmine_freshbooks do
if(Setting["plugin_redmine_freshbooks"]['freshbooks_enabled'] == 'yes')
require_dependency 'project'
require_dependency 'time_entry'
# Guards against including the module multiple time (like in tests)
# and registering multiple callbacks
unless Project.included_modules.include? RedmineFreshbooks::ProjectPatch
Project.send(:include, RedmineFreshbooks::ProjectPatch)
end
unless TimeEntry.included_modules.include? RedmineFreshbooks::TimeEntryPatch
TimeEntry.send(:include, RedmineFreshbooks::TimeEntryPatch)
end
unless User.included_modules.include? RedmineFreshbooks::UserPatch
User.send(:include, RedmineFreshbooks::UserPatch)
end
end
end
Redmine::Plugin.register :redmine_freshbooks do
name 'Redmine Freshbooks'
author 'phsr'
description 'Integrates Freshbooks timelogging into Redmine'
version '1.0.0'
url 'http://github.com/phsr/Redmine-Freshbooks'
author_url 'http://github.com/phsr'
settings :default => {'freshbooks_domain' => 'YOURDOMAIN.frehsbooks.com', 'freshbooks_enabled' => 'no'}, :partial => 'settings/settings'
end