Activity emails: Fix activityTypeName template var & fix priority_id label
authorAlok Patel <alok@agileware.com.au>
Fri, 12 Oct 2018 06:16:14 +0000 (11:46 +0530)
committerColeman Watts <coleman@civicrm.org>
Tue, 15 Jan 2019 20:51:45 +0000 (15:51 -0500)
CRM/Case/BAO/Case.php
CRM/Case/XMLProcessor/Report.php

index 0e4260c3ef8e74fd60e88b9f6949266dee921efb..5dda13716f30b7b1049e7da9185d4d782564e6a0 100644 (file)
@@ -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')) {
index 744f6228e33893f68224be47821cb2dd7ff34217..ec89977932aa5e6f17d75697f26f924dd8dded1f 100644 (file)
@@ -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',