From: Alok Patel Date: Fri, 12 Oct 2018 06:16:14 +0000 (+0530) Subject: Activity emails: Fix activityTypeName template var & fix priority_id label X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=8d04ae48808b78a37797d6f5c0e54ff8468db317;p=civicrm-core.git Activity emails: Fix activityTypeName template var & fix priority_id label --- diff --git a/CRM/Case/BAO/Case.php b/CRM/Case/BAO/Case.php index 0e4260c3ef..5dda13716f 100644 --- a/CRM/Case/BAO/Case.php +++ b/CRM/Case/BAO/Case.php @@ -1343,9 +1343,9 @@ SELECT case_status.label AS case_status, status_id, civicrm_case_type.title AS c } $tplParams = $activityInfo = array(); - //if its a case activity + $activityTypeId = CRM_Core_DAO::getFieldValue('CRM_Activity_DAO_Activity', $activityId, 'activity_type_id'); + // If it's a case activity if ($caseId) { - $activityTypeId = CRM_Core_DAO::getFieldValue('CRM_Activity_DAO_Activity', $activityId, 'activity_type_id'); $nonCaseActivityTypes = CRM_Core_PseudoConstant::activityType(); if (!empty($nonCaseActivityTypes[$activityTypeId])) { $anyActivity = TRUE; @@ -1369,6 +1369,7 @@ SELECT case_status.label AS case_status, status_id, civicrm_case_type.title AS c if ($caseId) { $activityInfo['fields'][] = array('label' => 'Case ID', 'type' => 'String', 'value' => $caseId); } + $tplParams['activityTypeName'] = CRM_Core_PseudoConstant::getLabel('CRM_Activity_DAO_Activity', 'activity_type_id', $activityTypeId); $tplParams['activity'] = $activityInfo; foreach ($tplParams['activity']['fields'] as $k => $val) { if (CRM_Utils_Array::value('label', $val) == ts('Subject')) { diff --git a/CRM/Case/XMLProcessor/Report.php b/CRM/Case/XMLProcessor/Report.php index 744f6228e3..ec89977932 100644 --- a/CRM/Case/XMLProcessor/Report.php +++ b/CRM/Case/XMLProcessor/Report.php @@ -520,7 +520,7 @@ WHERE a.id = %1 $activity['fields'][] = array( 'label' => ts('Priority'), - 'value' => CRM_Core_PseudoConstant::getLabel('CRM_Activity_DAO_Activity', 'priority', + 'value' => CRM_Core_PseudoConstant::getLabel('CRM_Activity_DAO_Activity', 'priority_id', $activityDAO->priority_id ), 'type' => 'String',