forked from igloo15/redmine_loader
-
Notifications
You must be signed in to change notification settings - Fork 1
/
init.rb
67 lines (54 loc) · 1.67 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
require 'redmine'
require_dependency 'string'
require_dependency 'element'
require_dependency 'views_issues_index_bottom_hook'
ActionDispatch::Callbacks.to_prepare do
SettingsHelper.__send__(:include, SettingsHelperPatch)
Mailer.__send__(:include, LoaderMailer)
Issue.__send__(:include, IssuePatch)
Redmine::Views::OtherFormatsBuilder.__send__(:include, LoaderOtherFormatsBuilder)
end
Redmine::Plugin.register :redmine_loader do
author 'Simon Stearn, Andrew Hodgkinsons'
desc = 'MS Project/Redmine sync plugin'
name desc
description desc
version '0.3b'
requires_redmine version_or_higher: '2.3.0'
default_tracker_alias = 'Tracker'
settings default: {
export: {
sync_versions: false,
ignore_fields: {
description: false,
priority: false,
done_ratio: false,
estimated_hours: false,
spent_hours: false
}
},
import: {
is_private_by_default: false,
instant_import_tasks: 10,
sync_versions: false,
tracker_alias: default_tracker_alias,
redmine_id_alias: 'RID',
ignore_fields: {
description: false,
priority: false,
done_ratio: false,
estimated_hours: false,
spent_hours: false
}
},
}, partial: 'settings/loader_settings'
project_module :project_xml_importer do
permission :import_issues_from_xml, loader: [:new, :create]
permission :export_issues_to_xml, loader: :export
end
menu :project_menu, :loader, { controller: :loader, action: :new },
caption: :menu_caption, after: :new_issue, param: :project_id
Time::DATE_FORMATS.merge!(
ms_xml: lambda{ |time| time.strftime("%Y-%m-%dT%H:%M:%S") }
)
end