$query->_tables['civicrm_contribution_soft_contact'] = 1;
$query->_tables['civicrm_contribution_soft_phone'] = 1;
}
+ if (!empty($query->_returnProperties['contribution_campaign_title'])) {
+ $query->_select['contribution_campaign_title'] = "civicrm_campaign.title as contribution_campaign_title";
+ $query->_element['contribution_campaign_title'] = $query->_tables['civicrm_campaign'] = 1;
+ }
// LCD 716 END
}
$from .= " $side JOIN civicrm_membership ON civicrm_membership_payment.membership_id = civicrm_membership.id ";
break;
+ case 'civicrm_campaign':
+ $from = " $side JOIN civicrm_campaign ON civicrm_campaign.id = civicrm_contribution.campaign_id";
+ break;
+
case 'contribution_participant':
$from = " $side JOIN civicrm_participant_payment ON civicrm_participant_payment.contribution_id = civicrm_contribution.id";
$from .= " $side JOIN civicrm_participant ON civicrm_participant_payment.participant_id = civicrm_participant.id ";
'amount_level' => 1,
'contribution_note' => 1,
'contribution_batch' => 1,
+ 'contribution_campaign_title' => 1,
'contribution_campaign_id' => 1,
);
if (self::isSoftCreditOptionEnabled()) {
// as the array is not actually 'returnProperties' after the sql query is formed - making the alterations to it confusing
foreach ($returnProperties as $key => $value) {
$outputColumns[$key] = $value;
- if (substr($key, -11) == 'campaign_id') {
- // the field $dao->x_campaign_id_id holds the id whereas the field $dao->campaign_id
- // we want to insert it directly after campaign id
- $outputColumns[$key . '_id'] = 1;
- }
}
while (1) {
$limitQuery = "{$queryString} LIMIT {$offset}, {$rowCount}";
if ($setHeader) {
$sqlDone = FALSE;
// Split campaign into 2 fields for id and title
- if (substr($field, -11) == 'campaign_id') {
+ if (substr($field, -14) == 'campaign_title') {
$headerRows[] = ts('Campaign Title');
}
- elseif (substr($field, -14) == 'campaign_id_id') {
+ elseif (substr($field, -11) == 'campaign_id') {
$headerRows[] = ts('Campaign ID');
}
elseif (isset($query->_fields[$field]['title'])) {
if (substr($fieldName, -11) == 'campaign_id') {
// CRM-14398
$sqlColumns[$fieldName] = "$fieldName varchar(128)";
- $sqlColumns[$fieldName . '_id'] = "{$fieldName}_id varchar(16)";
return;
}