$component = 'civicrm_pledge';
break;
- case CRM_Export_Form_Select::CASE_EXPORT:
- $component = 'civicrm_case';
- break;
-
case CRM_Export_Form_Select::GRANT_EXPORT:
$component = 'civicrm_grant';
break;
}
- $relIDs = CRM_Core_DAO::getContactIDsFromComponent($ids, $component);
+
+ if ($exportMode == CRM_Export_Form_Select::CASE_EXPORT) {
+ $relIDs = CRM_Case_BAO_Case::retrieveContactIdsByCaseId($ids);
+ }
+ else {
+ $relIDs = CRM_Core_DAO::getContactIDsFromComponent($ids, $component);
+ }
}
$relationshipJoin = $relationshipClause = '';
$count++;
$row = array();
+ //convert the pseudo constants
+ $query->convertToPseudoNames($dao);
+
//first loop through returnproperties so that we return what is required, and in same order.
$relationshipField = 0;
foreach ($returnProperties as $field => $value) {
$row[$field] = $dao->contact_id;
// special case for calculated field
}
+ elseif ($field == 'source_contact_id') {
+ $row[$field] = $dao->contact_id;
+ }
elseif ($field == 'pledge_balance_amount') {
$row[$field] = $dao->pledge_amount - $dao->pledge_total_paid;
// special case for calculated field
elseif ($field == 'pledge_next_pay_amount') {
$row[$field] = $dao->pledge_next_pay_amount + $dao->pledge_outstanding_amount;
}
+ elseif ($field == 'prefix_id' || $field == 'suffix_id' || $field == 'gender_id') {
+ if ($field == 'prefix_id') {
+ $row[$field] = $dao->individual_prefix;
+ }
+ elseif ($field == 'suffix_id') {
+ $row[$field] = $dao->individual_suffix;
+ }
+ else {
+ $row[$field] = $dao->gender;
+ }
+ }
elseif (is_array($value) && $field == 'location') {
// fix header for location type case
foreach ($value as $ltype => $val) {
if (isset($query->_fields[$field]['type'])) {
switch ($query->_fields[$field]['type']) {
case CRM_Utils_Type::T_INT:
- case CRM_Utils_Type::T_BOOL:
case CRM_Utils_Type::T_BOOLEAN:
$sqlColumns[$fieldName] = "$fieldName varchar(16)";
break;