Configure posting private issues and notes
This commit is contained in:
@@ -40,6 +40,16 @@
|
||||
<input type="checkbox" id="settings_post_updates" value="1" name="settings[post_updates]" <%= settings['post_updates'] == '1' ? 'checked="checked"' : '' %> />
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label for="settings_post_updates">Post updates for private issues?</label>
|
||||
<input type="checkbox" id="settings_post_private_issues" value="1" name="settings[post_private_issues]" <%= settings['post_private_issues'] == '1' ? 'checked="checked"' : '' %> />
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label for="settings_post_updates">Post private notes?</label>
|
||||
<input type="checkbox" id="settings_post_private_notes" value="1" name="settings[post_private_notes]" <%= settings['post_private_notes'] == '1' ? 'checked="checked"' : '' %> />
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label for="settings_post_wiki_updates">Post Wiki Updates?</label>
|
||||
<input type="checkbox" id="settings_post_wiki_updates" value="1" name="settings[post_wiki_updates]" <%= settings['post_wiki_updates'] == '1' ? 'checked="checked"' : '' %> />
|
||||
|
||||
5
init.rb
5
init.rb
@@ -18,7 +18,10 @@ Redmine::Plugin.register :redmine_mattermost do
|
||||
'channel' => nil,
|
||||
'icon' => 'https://raw.githubusercontent.com/altsol/redmine_mattermost/assets/icon.png',
|
||||
'username' => 'redmine',
|
||||
'display_watchers' => 'no'
|
||||
'display_watchers' => 'no',
|
||||
'post_updates' => '1',
|
||||
'post_private_issues' => '1',
|
||||
'post_private_notes' => '1'
|
||||
},
|
||||
:partial => 'settings/mattermost_settings'
|
||||
end
|
||||
|
||||
@@ -8,7 +8,7 @@ class MattermostListener < Redmine::Hook::Listener
|
||||
url = url_for_project issue.project
|
||||
|
||||
return unless channels.any? and url
|
||||
return if issue.is_private?
|
||||
return if issue.is_private? and Setting.plugin_redmine_mattermost[:post_private_issues] != '1'
|
||||
|
||||
msg = "[#{escape issue.project}] #{escape issue.author} created <#{object_url issue}|#{escape issue}>#{mentions issue.description}"
|
||||
|
||||
@@ -45,8 +45,8 @@ class MattermostListener < Redmine::Hook::Listener
|
||||
url = url_for_project issue.project
|
||||
|
||||
return unless channels.any? and url and Setting.plugin_redmine_mattermost[:post_updates] == '1'
|
||||
return if issue.is_private?
|
||||
return if journal.private_notes?
|
||||
return if issue.is_private? and Setting.plugin_redmine_mattermost[:post_private_issues] != '1'
|
||||
return if journal.private_notes? and Setting.plugin_redmine_mattermost[:post_private_notes] != '1'
|
||||
|
||||
msg = "[#{escape issue.project}] #{escape journal.user.to_s} updated <#{object_url issue}|#{escape issue}>#{mentions journal.notes}"
|
||||
|
||||
@@ -66,7 +66,7 @@ class MattermostListener < Redmine::Hook::Listener
|
||||
url = url_for_project issue.project
|
||||
|
||||
return unless channels.any? and url and issue.save
|
||||
return if issue.is_private?
|
||||
return if issue.is_private? and Setting.plugin_redmine_mattermost[:post_private_issues] != '1'
|
||||
|
||||
msg = "[#{escape issue.project}] #{escape journal.user.to_s} updated <#{object_url issue}|#{escape issue}>"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user