1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-02-01 03:57:15 +00:00

Show parent issues in notification email (#34302).

Patch by Yuichi HARADA.


git-svn-id: https://svn.redmine.org/redmine/trunk@22120 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA 2023-03-01 03:46:53 +00:00
parent 96a718547d
commit a499d68802
3 changed files with 5 additions and 2 deletions

View File

@ -445,7 +445,7 @@ module IssuesHelper
def email_issue_attributes(issue, user, html)
items = []
%w(author status priority assigned_to category fixed_version start_date due_date).each do |attribute|
%w(author status priority assigned_to category fixed_version start_date due_date parent_issue).each do |attribute|
if issue.disabled_core_fields.grep(/^#{attribute}(_id)?$/).empty?
attr_value = (issue.send attribute).to_s
next if attr_value.blank?

View File

@ -1502,6 +1502,8 @@ class Issue < ActiveRecord::Base
end
end
alias :parent_issue :parent
def set_parent_id
self.parent_id = parent_issue_id
end

View File

@ -658,7 +658,7 @@ class MailerTest < ActiveSupport::TestCase
ActionMailer::Base.deliveries.clear
with_settings :notified_events => %w(issue_added) do
cf = IssueCustomField.generate!
issue = Issue.generate!
issue = Issue.generate!(:parent => Issue.find(1))
Mailer.deliver_issue_add(issue)
assert_not_equal 0, ActionMailer::Base.deliveries.size
@ -667,6 +667,7 @@ class MailerTest < ActiveSupport::TestCase
assert_mail_body_match /^\* Author: /, mail
assert_mail_body_match /^\* Status: /, mail
assert_mail_body_match /^\* Priority: /, mail
assert_mail_body_match /^\* Parent task: /, mail
assert_mail_body_no_match /^\* Assignee: /, mail
assert_mail_body_no_match /^\* Category: /, mail