elseif ($field == 'pledge_next_pay_amount') {
$row[$field] = $dao->pledge_next_pay_amount + $dao->pledge_outstanding_amount;
}
- elseif (in_array(substr($field, 0, -3), array('gender', 'prefix', 'suffix'))) {
+ elseif (in_array(substr($field, 0, -3), array('gender', 'prefix', 'suffix', 'communication_style'))) {
$row[$field] = CRM_Core_PseudoConstant::getLabel('CRM_Contact_DAO_Contact', $field, $dao->$field);
}
elseif (is_array($value) && $field == 'location') {
$fieldValue = CRM_Utils_Array::value($relationValue, $imProviders);
}
}
+ // CRM-13995
+ elseif (is_object($relDAO) && in_array($relationField, array(
+ 'email_greeting', 'postal_greeting', 'addressee'))) {
+ //special case for greeting replacement
+ $fldValue = "{$relationField}_display";
+ $fieldValue = $relDAO->$fldValue;
+ }
+ elseif ( is_object($relDAO) && $relationField == 'state_province' ) {
+ $fieldValue = CRM_Core_PseudoConstant::stateProvince($relDAO->state_province_id);
+ }
+ elseif ( is_object($relDAO) && $relationField == 'country' ) {
+ $fieldValue = CRM_Core_PseudoConstant::country($relDAO->country_id);
+ }
else {
$fieldValue = '';
}
$field = $field . '_';
+
if (is_object($relDAO) && $relationField == 'id') {
$row[$field . $relationField] = $relDAO->contact_id;
- } else if ( is_object( $relDAO ) && is_array( $relationValue ) && $relationField == 'location' ) {
+ }
+ elseif ( is_object( $relDAO ) && is_array( $relationValue ) && $relationField == 'location' ) {
foreach ($relationValue as $ltype => $val) {
foreach (array_keys($val) as $fld) {
$type = explode('-', $fld);
$relationQuery[$field]->_options
);
}
- elseif (in_array($relationField, array(
- 'email_greeting', 'postal_greeting', 'addressee'))) {
- //special case for greeting replacement
- $fldValue = "{$relationField}_display";
- $row[$field . $relationField] = $relDAO->$fldValue;
- }
else {
//normal relationship fields
// CRM-3157: localise country, region (both have ‘country’ context) and state_province (‘province’ context)
case 'gender':
case 'preferred_communication_method':
case 'preferred_mail_format':
+ case 'communication_style':
$row[$field] = $i18n->crm_translate($fieldValue);
break;