CRM-19883 - fix display in report rows
authoryashodha <yashodha.chaku@webaccessglobal.com>
Thu, 9 Feb 2017 09:41:19 +0000 (15:11 +0530)
committeryashodha <yashodha.chaku@webaccessglobal.com>
Thu, 9 Feb 2017 09:41:19 +0000 (15:11 +0530)
CRM/Report/Form/Activity.php

index 5ab3e3e724117d418ffdeca42a95126311055c5c..820b6f6d1e38a63ba701a2d5a2e2503c7671a2d5 100644 (file)
@@ -285,6 +285,7 @@ class CRM_Report_Form_Activity extends CRM_Report_Form {
           ),
           'priority_id' => array(
             'title' => ts('Activity Priority'),
+            'type' => CRM_Utils_Type::T_STRING,
             'operatorType' => CRM_Report_Form::OP_MULTISELECT,
             'options' => CRM_Core_PseudoConstant::get('CRM_Activity_DAO_Activity', 'priority_id'),
           ),
@@ -887,6 +888,7 @@ FROM civireport_activity_temp_target tar
     $entryFound = FALSE;
     $activityType = CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE);
     $activityStatus = CRM_Core_PseudoConstant::activityStatus();
+    $priority = CRM_Core_PseudoConstant::get('CRM_Activity_DAO_Activity', 'priority_id');
     $viewLinks = FALSE;
     $context = CRM_Utils_Request::retrieve('context', 'String', $this, FALSE, 'report');
     $actUrl = '';
@@ -1003,6 +1005,13 @@ FROM civireport_activity_temp_target tar
         }
       }
 
+      if (array_key_exists('civicrm_activity_priority_id', $row)) {
+        if ($value = $row['civicrm_activity_priority_id']) {
+          $rows[$rowNum]['civicrm_activity_priority_id'] = $priority[$value];
+          $entryFound = TRUE;
+        }
+      }
+
       if (array_key_exists('civicrm_activity_details', $row) && $this->_outputMode == 'html') {
         if ($value = $row['civicrm_activity_details']) {
           $fullDetails = $rows[$rowNum]['civicrm_activity_details'];