From: yashodha Date: Mon, 12 Aug 2013 14:53:44 +0000 (+0530) Subject: fix the sending copy of email to assignee(CRM-13203) X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=cd1229218b392e6c790c68c3408afbab19b91042;p=civicrm-core.git fix the sending copy of email to assignee(CRM-13203) --- 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)) {