forked from ThatCompany/that_meeting
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.rb
More file actions
64 lines (58 loc) · 2.81 KB
/
init.rb
File metadata and controls
64 lines (58 loc) · 2.81 KB
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
require 'redmine'
require_dependency 'hooks/that_meeting_hook'
Rails.logger.info 'Starting That Meeting plugin for Redmine'
IssueQuery.add_available_column(QueryColumn.new(:formatted_start_time, :caption => :field_start_time))
IssueQuery.add_available_column(QueryColumn.new(:formatted_end_time, :caption => :field_end_time))
IssueQuery.add_available_column(QueryColumn.new(:recurrence))
Rails.configuration.to_prepare do
unless IssuesController.included_modules.include?(IssueMeetingsHelper)
IssuesController.send(:helper, :issue_meetings)
IssuesController.send(:include, IssueMeetingsHelper)
end
unless IssuesController.included_modules.include?(Patches::ThatMeetingIssuesControllerPatch)
IssuesController.send(:include, Patches::ThatMeetingIssuesControllerPatch)
end
unless ActionView::Base.included_modules.include?(I18n::TimeFormatter)
ActionView::Base.send(:include, I18n::TimeFormatter)
end
unless IssuesHelper.included_modules.include?(Patches::ThatMeetingIssuesHelperPatch)
IssuesHelper.send(:include, Patches::ThatMeetingIssuesHelperPatch)
end
unless WatchersHelper.included_modules.include?(Patches::ThatMeetingWatchersHelperPatch)
WatchersHelper.send(:include, Patches::ThatMeetingWatchersHelperPatch)
end
unless Issue.included_modules.include?(Patches::ThatMeetingIssuePatch)
Issue.send(:include, Patches::ThatMeetingIssuePatch)
end
unless Journal.included_modules.include?(Patches::ThatMeetingJournalPatch)
Journal.send(:include, Patches::ThatMeetingJournalPatch)
end
unless JournalDetail.included_modules.include?(Patches::ThatMeetingJournalDetailPatch)
JournalDetail.send(:include, Patches::ThatMeetingJournalDetailPatch)
end
unless Watcher.included_modules.include?(Patches::ThatMeetingWatcherPatch)
Watcher.send(:include, Patches::ThatMeetingWatcherPatch)
end
unless Mailer.included_modules.include?(Patches::ThatMeetingMailerPatch)
Mailer.send(:include, Patches::ThatMeetingMailerPatch)
end
unless MailHandler.included_modules.include?(Patches::ThatMeetingMailHandlerPatch)
MailHandler.send(:include, Patches::ThatMeetingMailHandlerPatch)
end
end
Redmine::Plugin.register :that_meeting do
name 'That Meeting'
author 'Andriy Lesyuk for That Company'
author_url 'http://www.andriylesyuk.com/'
description 'Converts issues of the selected trackers into iCalendar events.'
url 'https://github.com/thatcompany/that_meeting'
version '0.0.1'
settings :default => {
'tracker_ids' => [],
'hide_mails' => true,
'cancel_status_ids' => [],
'force_notifications' => false,
'system_timezone' => (File.read('/etc/timezone').strip rescue nil),
'timezone_format' => '%Z'
}, :partial => 'settings/meeting'
end