* @return array
*/
public function getQueryFields() {
- return $this->queryFields;
+ return array_merge(
+ $this->queryFields,
+ $this->getComponentPaymentFields()
+ );
}
/**
$queryFields['country']['context'] = 'country';
$queryFields['world_region']['context'] = 'country';
$queryFields['state_province']['context'] = 'province';
+ $queryFields['contact_id'] = ['title' => ts('Contact ID'), 'type' => CRM_Utils_Type::T_INT];
$this->queryFields = $queryFields;
}
return $this->getQueryFields()[$field]['title'];
}
elseif ($this->isExportPaymentFields() && array_key_exists($field, $this->getcomponentPaymentFields())) {
- return CRM_Utils_Array::value($field, $this->getcomponentPaymentFields());
+ return CRM_Utils_Array::value($field, $this->getcomponentPaymentFields())['title'];
}
else {
return $field;
*/
public function getComponentPaymentFields() {
return [
- 'componentPaymentField_total_amount' => ts('Total Amount'),
- 'componentPaymentField_contribution_status' => ts('Contribution Status'),
- 'componentPaymentField_received_date' => ts('Date Received'),
- 'componentPaymentField_payment_instrument' => ts('Payment Method'),
- 'componentPaymentField_transaction_id' => ts('Transaction ID'),
+ 'componentPaymentField_total_amount' => ['title' => ts('Total Amount'), 'type' => CRM_Utils_Type::T_MONEY],
+ 'componentPaymentField_contribution_status' => ['title' => ts('Contribution Status'), 'type' => CRM_Utils_Type::T_STRING],
+ 'componentPaymentField_received_date' => ['title' => ts('Date Received'), 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME],
+ 'componentPaymentField_payment_instrument' => ['title' => ts('Payment Method'), 'type' => CRM_Utils_Type::T_STRING],
+ 'componentPaymentField_transaction_id' => ['title' => ts('Transaction ID'), 'type' => CRM_Utils_Type::T_STRING],
];
}
*/
public function getPaymentHeaders() {
if ($this->isExportPaymentFields() && !$this->isExportSpecifiedPaymentFields()) {
- return $this->getcomponentPaymentFields();
+ return CRM_Utils_Array::collect('title', $this->getcomponentPaymentFields());
}
return [];
}
return "$fieldName varchar(128)";
}
- if (substr($fieldName, -11) == 'campaign_id') {
- // CRM-14398
- return "$fieldName varchar(128)";
- }
-
$queryFields = $this->getQueryFields();
// @todo remove the enotice avoidance here, ensure all columns are declared.
// tests will fail on the enotices until they all are & then all the 'else'
switch ($fieldSpec['type']) {
case CRM_Utils_Type::T_INT:
case CRM_Utils_Type::T_BOOLEAN:
+ if (in_array(CRM_Utils_Array::value('data_type', $fieldSpec), ['Country', 'StateProvince', 'ContactReference'])) {
+ return "$fieldName varchar(255)";
+ }
return "$fieldName varchar(16)";
case CRM_Utils_Type::T_STRING:
$length = max(512, CRM_Utils_Array::value('text_length', $queryFields[$columnName]));
return "$fieldName varchar($length)";
- case 'Country':
- case 'StateProvince':
case 'Link':
return "$fieldName varchar(255)";