diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2019-06-20 07:36:21 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2019-06-20 07:36:21 +0000 |
commit | f53cd3029c60325f8f27fe81b907fe1283c93b3a (patch) | |
tree | bb1fae9ca974abbd6e45f506022fc4736b1eefc1 /app | |
parent | 4778244c5ea089278d1fcd289ad84e03b23a9214 (diff) | |
download | redmine-f53cd3029c60325f8f27fe81b907fe1283c93b3a.tar.gz redmine-f53cd3029c60325f8f27fe81b907fe1283c93b3a.zip |
Don't show empty fields in email notifications (#10378).
Patch by Yuichi HARADA.
git-svn-id: http://svn.redmine.org/redmine/trunk@18280 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/issues_helper.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 8d16e7a40..76eded3d5 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -326,18 +326,22 @@ module IssuesHelper items = [] %w(author status priority assigned_to category fixed_version start_date due_date).each do |attribute| if issue.disabled_core_fields.grep(/^#{attribute}(_id)?$/).empty? + attr_value = "#{issue.send attribute}" + next if attr_value.blank? if html - items << content_tag('strong', "#{l("field_#{attribute}")}: ") + (issue.send attribute) + items << content_tag('strong', "#{l("field_#{attribute}")}: ") + attr_value else - items << "#{l("field_#{attribute}")}: #{issue.send attribute}" + items << "#{l("field_#{attribute}")}: #{attr_value}" end end end issue.visible_custom_field_values(user).each do |value| + cf_value = show_value(value, false) + next if cf_value.blank? if html - items << content_tag('strong', "#{value.custom_field.name}: ") + show_value(value, false) + items << content_tag('strong', "#{value.custom_field.name}: ") + cf_value else - items << "#{value.custom_field.name}: #{show_value(value, false)}" + items << "#{value.custom_field.name}: #{cf_value}" end end items |