*
* @var array
*/
- static $_importableFields = NULL;
+ public static $_importableFields = NULL;
/**
* Static field for all the contribution information that we can potentially export
*
* @var array
*/
- static $_exportableFields = NULL;
+ public static $_exportableFields = NULL;
/**
* Static field to hold financial trxn id's.
*
* @var array
*/
- static $_trxnIDs = NULL;
+ public static $_trxnIDs = NULL;
/**
* Field for all the objects related to this contribution
);
}
- CRM_Contact_BAO_GroupContactCache::opportunisticCacheFlush();
+ // reset the group contact cache for this group
+ // HACK: dave hack - these caches are murder!!!
+ // CRM_Contact_BAO_GroupContactCache::opportunisticCacheFlush();
if ($contributionID) {
CRM_Utils_Hook::post('edit', 'Contribution', $contribution->id, $contribution);
return $contribution;
}
- $null = NULL; // return by reference
+ // return by reference
+ $null = NULL;
return $null;
}
// as they would then me membership.contact_id, membership.is_test etc
return civicrm_api3('Membership', 'get', [
'id' => ['IN' => $membershipIDs],
- 'return' => ['id', 'contact_id', 'membership_type_id', 'is_test']
+ 'return' => ['id', 'contact_id', 'membership_type_id', 'is_test'],
])['values'];
}
}
else {
$whereClauses['financial_type_id'] = [
- 'IN (' . implode(',', array_keys($types)) . ')'
+ 'IN (' . implode(',', array_keys($types)) . ')',
];
}
return $whereClauses;
'subject' => ts('Payment failed at payment processor'),
'source_record_id' => $contributionID,
'source_contact_id' => CRM_Core_Session::getLoggedInContactID() ? CRM_Core_Session::getLoggedInContactID() :
- $contactID,
+ $contactID,
));
// CRM-20336 Make sure that the contribution status is Failed, not Pending.
);
}
- $updateResult['membership_end_date'] = CRM_Utils_Date::customFormat($dates['end_date'],
- '%B %E%f, %Y'
- );
$updateResult['updatedComponents']['CiviMember'] = $membership->status_id;
if ($processContributionObject) {
$processContribution = TRUE;
return FALSE;
}
-
/**
* Function to record additional payment for partial and refund contributions.
*
$updatedStatusName = CRM_Utils_Array::value($updatedStatusId,
CRM_Member_PseudoConstant::membershipStatus()
);
- if ($updatedStatusName == 'Cancelled') {
- $statusMsg .= "<br />" . ts("Membership for %1 has been Cancelled.", array(1 => $userDisplayName));
- }
- elseif ($updatedStatusName == 'Expired') {
- $statusMsg .= "<br />" . ts("Membership for %1 has been Expired.", array(1 => $userDisplayName));
- }
- else {
- $endDate = CRM_Utils_Array::value('membership_end_date', $updateResult);
- if ($endDate) {
- $statusMsg .= "<br />" . ts("Membership for %1 has been updated. The membership End Date is %2.",
- array(
- 1 => $userDisplayName,
- 2 => $endDate,
- )
- );
- }
+
+ $statusNameMsgPart = 'updated';
+ switch ($updatedStatusName) {
+ case 'Cancelled':
+ case 'Expired':
+ $statusNameMsgPart = $updatedStatusName;
+ break;
}
+
+ $statusMsg .= "<br />" . ts("Membership for %1 has been %2.", array(1 => $userDisplayName, 2 => $statusNameMsgPart));
}
if ($componentName == 'CiviEvent') {
* Line items.
* @param bool $isARefund
* Is this a refund / negative transaction.
+ * @param int $previousLineItemTotal
*
* @return float
*/
* @param float $balance
* @param string $contributionStatus
*
- * @return array $actionLinks Links array containing:
- * -url
- * -title
+ * @return array
+ * $actionLinks Links array containing:
+ * -url
+ * -title
*/
protected static function getContributionPaymentLinks($id, $balance, $contributionStatus) {
if ($contributionStatus === 'Failed' || !CRM_Core_Permission::check('edit contributions')) {
$clauses = [];
foreach ($whereClauses as $key => $clause) {
- $clauses[] = 'b.' . $key . " " . implode(' AND b.' . $key, (array) $clause);
+ $clauses[] = 'b.' . $key . " " . implode(' AND b.' . $key, (array) $clause);
}
$whereClauseString = implode(' AND ', $clauses);