From fd1b0607055909142e75f437a326273c3bd370e5 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Mon, 5 Aug 2013 17:08:26 +0000 Subject: 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 --- app/helpers/issues_helper.rb | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'app/helpers/issues_helper.rb') 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={}) -- cgit v1.2.3