From cd1229218b392e6c790c68c3408afbab19b91042 Mon Sep 17 00:00:00 2001 From: yashodha Date: Mon, 12 Aug 2013 20:23:44 +0530 Subject: [PATCH] fix the sending copy of email to assignee(CRM-13203) --- CRM/Case/Form/Activity.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/CRM/Case/Form/Activity.php b/CRM/Case/Form/Activity.php index f6e5932494..907bd4caff 100644 --- a/CRM/Case/Form/Activity.php +++ b/CRM/Case/Form/Activity.php @@ -619,11 +619,19 @@ class CRM_Case_Form_Activity extends CRM_Activity_Form_Activity { $mailStatus = ts("A copy of the activity has also been sent to selected contacts(s)."); } else { - $this->_relatedContacts = CRM_Activity_BAO_ActivityContact::getNames($activity->id, $assigneeID, TRUE, FALSE); + $this->_relatedContacts = CRM_Activity_BAO_ActivityAssignment::getAssigneeNames($activity->id, TRUE, FALSE); $mailStatus .= ' ' . ts("A copy of the activity has also been sent to assignee contacts(s)."); } + //build an associative array with unique email addresses. - foreach ($params[$val] as $id => $dnc) { + foreach ($params[$val] as $key => $value) { + if ($val == 'contact_check') { + $id = $key; + } + else { + $id = $value; + } + if (isset($id) && array_key_exists($id, $this->_relatedContacts)) { //if email already exists in array then append with ', ' another role only otherwise add it to array. if ($contactDetails = CRM_Utils_Array::value($this->_relatedContacts[$id]['email'], $mailToContacts)) { -- 2.25.1