$types = explode(',', $options);
$labels = array();
foreach ($types as $value) {
- $labels[$value] = CRM_Core_PseudoConstant::getLabel($baoName, $fieldName, $value);
+ if ($labelValue = CRM_Core_PseudoConstant::getLabel($baoName, $fieldName, $value)) {
+ $labels[$value] = $labelValue;
+ }
+ else {
+ $labels[$value] = CRM_Core_DAO::getFieldValue($baoName, $value, $fieldName);
+ }
}
return implode(', ', array_filter($labels));
}
'batch_id' => array(
'name' => 'batch_id',
'title' => ts('Batch Title'),
+ 'dbAlias' => 'GROUP_CONCAT(batch_civireport.batch_id SEPARATOR ",")',
),
),
'filters' => array(
// convert batch id to batch title
if (!empty($row['civicrm_batch_batch_id'])) {
- $rows[$rowNum]['civicrm_batch_batch_id'] = CRM_Core_DAO::getFieldValue('CRM_Batch_BAO_Batch', $row['civicrm_batch_batch_id'], 'title');
+ $rows[$rowNum]['civicrm_batch_batch_id'] = $this->getLabels($row['civicrm_batch_batch_id'], 'CRM_Batch_BAO_Batch', 'title');
$entryFound = TRUE;
}