From 88ffa617daf1732bce2d0bec2b235d3e40b7bde4 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Tue, 15 Jan 2019 13:47:30 -0500 Subject: [PATCH] Minor code cleanup --- includes/wf_crm_webform_postprocess.inc | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/includes/wf_crm_webform_postprocess.inc b/includes/wf_crm_webform_postprocess.inc index 770dee7ff..5c6b1193f 100644 --- a/includes/wf_crm_webform_postprocess.inc +++ b/includes/wf_crm_webform_postprocess.inc @@ -1423,16 +1423,10 @@ class wf_crm_webform_postprocess extends wf_crm_webform_base { } } if ($mail) { - $caseId = (isset($params['case_id'])) ? $params['case_id'] : NULL; + $caseId = isset($params['case_id']) ? $params['case_id'] : NULL; + $caseClientId = $caseId ? CRM_Utils_Array::first(CRM_Case_BAO_Case::getCaseClients($caseId)) : NULL; // Include attachments while sending a copy of activity. $attachments = CRM_Core_BAO_File::getEntityFile('civicrm_activity', $activity['id']); - $caseClientId = NULL; - if ($caseId) { - $caseClients = CRM_Case_BAO_Case::getCaseClients($caseId); - if (count($caseClients) > 0) { - $caseClientId = $caseClients[0]; - } - } CRM_Case_BAO_Case::sendActivityCopy($caseClientId, $activity['id'], $mail, $attachments, $caseId); } }