if (CRM_Core_Permission::access('CiviEvent')) {
$fields['Participant'] = CRM_Event_BAO_Participant::exportableFields();
//get the component payment fields
+ // @todo - review this - inconsistent with other entities & hacky.
if ($exportMode == CRM_Export_Form_Select::EVENT_EXPORT) {
$componentPaymentFields = array();
foreach (CRM_Export_BAO_Export::componentPaymentFields() as $payField => $payTitle) {
// If we haven't selected specific payment fields, load in all the
// payment headers.
if (!$processor->isExportSpecifiedPaymentFields()) {
- $paymentHeaders = self::componentPaymentFields();
+ $paymentHeaders = $processor->getcomponentPaymentFields();
if (!empty($paymentDetails)) {
$addPaymentHeader = TRUE;
}
/**
* Build componentPayment fields.
+ *
+ * This is no longer used by export but BAO_Mapping still calls it & we
+ * should find a generic way to handle this or move this to that class.
+ *
+ * @deprecated
*/
public static function componentPaymentFields() {
static $componentPaymentFields;
// @todo - set this correctly in the xml rather than here.
$headerRows[] = ts('IM Service Provider');
}
- elseif ($processor->isExportPaymentFields() && array_key_exists($field, self::componentPaymentFields())) {
- $headerRows[] = CRM_Utils_Array::value($field, self::componentPaymentFields());
+ elseif ($processor->isExportPaymentFields() && array_key_exists($field, $processor->getcomponentPaymentFields())) {
+ $headerRows[] = CRM_Utils_Array::value($field, $processor->getcomponentPaymentFields());
}
else {
$headerRows[] = $field;
}
}
}
- elseif ($processor->isExportSpecifiedPaymentFields() && array_key_exists($field, self::componentPaymentFields())) {
+ elseif ($processor->isExportSpecifiedPaymentFields() && array_key_exists($field, $processor->getcomponentPaymentFields())) {
$paymentTableId = $processor->getPaymentTableID();
$paymentData = CRM_Utils_Array::value($iterationDAO->$paymentTableId, $paymentDetails);
$payFieldMapper = array(
/**
* Get fields that indicate payment fields have been requested for a component.
*
+ * Ideally this should be protected but making it temporarily public helps refactoring..
+ *
* @return array
*/
- protected function getComponentPaymentFields() {
+ public function getComponentPaymentFields() {
return [
'componentPaymentField_total_amount' => ts('Total Amount'),
'componentPaymentField_contribution_status' => ts('Contribution Status'),