-
Notifications
You must be signed in to change notification settings - Fork 12
/
init.rb
37 lines (29 loc) · 1.15 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
# encoding: utf-8
def patch_class(clazz, patch)
clazz.send(:include, patch) unless clazz.include?(patch)
end
Rails.configuration.to_prepare do
patch_class Mailer, IssueReminder::Patches::MailerPatch
end
Redmine::Plugin.register :redmine_issue_reminder do
name 'Inactive Issue Reminder'
author 'Jens Krämer'
description 'Notifications for issues that havent been updated for a configurable number of days'
version '1.0.0'
author_url 'https://jkraemer.net/'
requires_redmine version_or_higher: '2.6.0'
# in case this plugin is added before running the first migrations,
# issue_statuses table doesn't exist, therefore the rescue
resolved_state_id = IssueStatus.find_by_name('Gelöst').try(:id) rescue nil
closed_state_id = IssueStatus.find_by_name('Geschlossen').try(:id) rescue nil
settings :default => {
'remind_after_days' => '90',
'close_issues_after_days' => '120',
'resolved_state_id' => resolved_state_id,
'closed_state_id' => closed_state_id
}, :partial => 'issue_reminder/settings'
project_module :issue_reminder do
permission :receive_issue_reminders, {}
permission :receive_due_issues, {}
end
end