Fix custom fields

This commit is contained in:
Alexander Meindl
2019-12-26 18:25:19 +01:00
parent 9be229f1c4
commit 7cba13f8cd
6 changed files with 18 additions and 13 deletions

View File

@@ -156,14 +156,19 @@ class Messenger
field_format = nil
key = nil
escape = true
value = detail.value.to_s
if detail.property == 'cf'
key = CustomField.find(detail.prop_key)&.name
title = key
field_format = CustomField.find(detail.prop_key)&.field_format
unless key.nil?
title = key
field_format = CustomField.find(detail.prop_key)&.field_format
value = IssuesController.helpers.format_value(detail.value, detail.custom_field) if detail.value.present?
end
elsif detail.property == 'attachment'
key = 'attachment'
title = I18n.t :label_attachment
value = detail.value.to_s
else
key = detail.prop_key.to_s.sub('_id', '')
title = if key == 'parent'
@@ -171,10 +176,10 @@ class Messenger
else
I18n.t "field_#{key}"
end
value = detail.value.to_s
end
short = true
value = detail.value.to_s
case key
when 'title', 'subject', 'description'

View File

@@ -4,8 +4,8 @@ module RedmineMessenger
def self.included(base)
base.send(:include, InstanceMethods)
base.class_eval do
after_create :send_messenger_create
after_update :send_messenger_update
after_create_commit :send_messenger_create
after_update_commit :send_messenger_update
end
end

View File

@@ -4,8 +4,8 @@ module RedmineMessenger
def self.included(base)
base.send(:include, InstanceMethods)
base.class_eval do
after_create :send_messenger_create
after_update :send_messenger_update
after_create_commit :send_messenger_create
after_update_commit :send_messenger_update
end
end

View File

@@ -4,8 +4,8 @@ module RedmineMessenger
def self.included(base)
base.send(:include, InstanceMethods)
base.class_eval do
after_create :send_messenger_create
after_update :send_messenger_update
after_create_commit :send_messenger_create
after_update_commit :send_messenger_update
end
end

View File

@@ -4,8 +4,8 @@ module RedmineMessenger
def self.included(base)
base.send(:include, InstanceMethods)
base.class_eval do
after_create :send_messenger_create
after_update :send_messenger_update
after_create_commit :send_messenger_create
after_update_commit :send_messenger_update
end
end

View File

@@ -4,8 +4,8 @@ module RedmineMessenger
def self.included(base)
base.send(:include, InstanceMethods)
base.class_eval do
after_create :send_messenger_create
after_update :send_messenger_update
after_create_commit :send_messenger_create
after_update_commit :send_messenger_update
end
end