-
Notifications
You must be signed in to change notification settings - Fork 5
/
init.rb
34 lines (27 loc) · 935 Bytes
/
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
require 'redmine'
Redmine::Plugin.register :redmine_msg_preview do
name 'Outlook MSG Preview'
author 'Alex Bevilacqua'
url 'http://www.alexbevi.com/projects/redmine-msg-preview'
author_url 'http://blog.alexbevi.com'
description 'Allow previewing of Microsoft Outlook .msg file attachments'
version '0.0.2'
end
class RedmineMSGPreviewHook < Redmine::Hook::ViewListener
render_on :view_issues_show_description_bottom, :partial => 'msg_list'
end
module MsgHelper
module PublicMethods
def lookup_property(msg, prop)
case prop.upcase
when "SENDER":
return msg.properties.sent_representing_name
when "SUBJECT"
return msg.properties.subject
when "CREATION_TIME"
return msg.properties.creation_time.to_s
end
end
end
end
ActionView::Base.send :include, MsgHelper::PublicMethods