diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-08-05 17:08:26 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-08-05 17:08:26 +0000 |
commit | fd1b0607055909142e75f437a326273c3bd370e5 (patch) | |
tree | 60d53cd94e140f08072ba2c09ffe9dbd4e9e858e /app/helpers/issues_helper.rb | |
parent | b19b90234529206205abfa21c4a92ba7cebb7d98 (diff) | |
download | redmine-fd1b0607055909142e75f437a326273c3bd370e5.tar.gz redmine-fd1b0607055909142e75f437a326273c3bd370e5.zip |
Fixed that standard fields disabled still appear in email notifications (#14584).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@12079 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers/issues_helper.rb')
-rw-r--r-- | app/helpers/issues_helper.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 2e45d2e97..bc7fbab85 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -231,6 +231,28 @@ module IssuesHelper out end + def email_issue_attributes(issue, user) + items = [] + %w(author status priority assigned_to category fixed_version).each do |attribute| + unless issue.disabled_core_fields.include?(attribute+"_id") + items << "#{l("field_#{attribute}")}: #{issue.send attribute}" + end + end + issue.visible_custom_field_values(user).each do |value| + items << "#{value.custom_field.name}: #{show_value(value)}" + end + items + end + + def render_email_issue_attributes(issue, user, html=false) + items = email_issue_attributes(issue, user) + if html + content_tag('ul', items.map{|s| content_tag('li', s)}.join("\n").html_safe) + else + items.map{|s| "* #{s}"}.join("\n") + end + end + # Returns the textual representation of a journal details # as an array of strings def details_to_strings(details, no_html=false, options={}) |