Try fixing channel field

This commit is contained in:
Igor Antonov
2017-02-27 16:39:26 +03:00
parent bdd9c9442e
commit a414136510
2 changed files with 9 additions and 9 deletions

View File

@@ -22,8 +22,8 @@ module RedmineMattermost
end
def save_from_issue
if not @create_already_fired
Redmine::Hook.call_hook(:redmine_mattermost_issues_edit_after_save, { :issue => self, :journal => self.current_journal}) unless self.current_journal.nil?
unless @create_already_fired
Redmine::Hook.call_hook(:redmine_mattermost_issues_edit_after_save, {:issue => self, :journal => self.current_journal}) unless self.current_journal.nil?
end
return true
end

View File

@@ -189,33 +189,33 @@ private
cf = ProjectCustomField.find_by_name("Mattermost URL")
return [
[
(proj.custom_value_for(cf).value rescue nil),
(url_for_project proj.parent),
Setting.plugin_redmine_mattermost[:mattermost_url],
].find{|v| v.present?}
].flatten.find{|v| v.present?}
end
def post_private_issues_for_project(proj)
return nil if proj.blank?
cf = ProjectCustomField.find_by_name("Mattermost Post private issues")
return [
[
(proj.custom_value_for(cf).value rescue nil),
(post_private_issues_for_project proj.parent),
Setting.plugin_redmine_mattermost[:post_private_issues],
].find{|v| v.present?}
].flatten.find{|v| v.present?}
end
def post_private_notes_for_project(proj)
return nil if proj.blank?
cf = ProjectCustomField.find_by_name("Mattermost Post private notes")
return [
[
(proj.custom_value_for(cf).value rescue nil),
(post_private_notes_for_project proj.parent),
Setting.plugin_redmine_mattermost[:post_private_notes],
].find{|v| v.present?}
].flatten.find { |v| v.present? }
end
def channels_for_project(proj)
@@ -227,7 +227,7 @@ private
(proj.custom_value_for(cf).value rescue nil),
(channels_for_project proj.parent),
Setting.plugin_redmine_mattermost[:channel],
].find{|v| v.present?}
].flatten.find{|v| v.present?}
# Channel name '-' or empty '' is reserved for NOT notifying
return [] if val.to_s == ''