<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.3 |
+ | CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2013 |
+--------------------------------------------------------------------+
$contactType = array('Individual', 'Household', 'Organization');
foreach ($contactType as $value) {
$contactFields = CRM_Contact_BAO_Contact::exportableFields($value, FALSE, $required);
+ $contactFields = array_merge($contactFields, CRM_Contact_BAO_Query_Hook::singleton()->getFields());
+
// exclude the address options disabled in the Address Settings
$fields[$value] = CRM_Core_BAO_Address::validateAddressOptions($contactFields);
-
+ ksort($fields[$value]);
if ($mappingType == 'Export') {
$relationships = array();
$relationshipTypes = CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, NULL, NULL, $value);
$csRelationships = array();
if ($mappingType == 'Export') {
- $subTypeRelationshipTypes =
+ $subTypeRelationshipTypes =
CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, NULL, NULL, $val['parent'],
FALSE, 'label', TRUE, $subType);
-
+
foreach ($subTypeRelationshipTypes as $key => $var) {
if (!array_key_exists($key, $fields[$val['parent']])) {
list($type) = explode('_', $key);
-
+
$csRelationships[$key]['title'] = $var;
$csRelationships[$key]['headerPattern'] = '/' . preg_quote($var, '/') . '/';
$csRelationships[$key]['export'] = TRUE;
$mapperKeys = array_keys($mapperFields);
- $locationTypes = CRM_Core_PseudoConstant::locationType();
+ $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
$defaultLocationType = CRM_Core_BAO_LocationType::getDefault();
foreach ($sel1 as $key => $sel) {
if ($key) {
- asort($mapperFields[$key]);
+ // sort everything BUT the contactType which is sorted seperately by
+ // an initial commit of CRM-13278 (check ksort above)
+ if (!in_array($key, $contactType)) {
+ asort($mapperFields[$key]);
+ }
$sel2[$key] = array('' => ts('- select field -')) + $mapperFields[$key];
}
}
$sel3[''] = NULL;
$sel5[''] = NULL;
- $phoneTypes = CRM_Core_PseudoConstant::phoneType();
- $imProviders = CRM_Core_PseudoConstant::IMProvider();
+ $phoneTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Phone', 'phone_type_id');
+ $imProviders = CRM_Core_PseudoConstant::get('CRM_Core_DAO_IM', 'provider_id');
asort($phoneTypes);
foreach ($sel1 as $k => $sel) {
if ($mappingType == 'Search Builder') {
//CRM -2292, restricted array set
$operatorArray = array(
- '' => ts('-operator-'),
- '=' => '=',
- '!=' => '!=',
- '>' => '>',
- '<' => '<',
- '>=' => '>=',
- '<=' => '<=',
- 'IN' => 'IN',
- 'LIKE' => 'LIKE',
- 'RLIKE' => 'RLIKE',
- 'IS EMPTY' => 'IS EMPTY',
- 'IS NOT EMPTY' => 'IS NOT EMPTY',
- 'IS NULL' => 'IS NULL',
- 'IS NOT NULL' => 'IS NOT NULL',
+ '' => ts('-operator-'),
+ '=' => '=',
+ '!=' => '≠',
+ '>' => '>',
+ '<' => '<',
+ '>=' => '≥',
+ '<=' => '≤',
+ 'IN' => ts('In'),
+ 'LIKE' => ts('Like'),
+ 'RLIKE' => ts('Regex'),
+ 'IS EMPTY' => ts('Is Empty'),
+ 'IS NOT EMPTY' => ts('Not Empty'),
+ 'IS NULL' => ts('Is Null'),
+ 'IS NOT NULL' => ts('Not Null'),
);
$form->add('select', "operator[$x][$i]", '', $operatorArray);
}
}
- if ($v[0] == 'Contribution' && substr($fldName, 0, 7) != 'custom_'
+ if ($v[0] == 'Contribution' && substr($fldName, 0, 7) != 'custom_'
&& substr($fldName, 0, 10) != 'financial_') {
if (substr($fldName, 0, 13) != 'contribution_') {
$fldName = 'contribution_' . $fldName;
return $fields;
}
- $locationTypes = CRM_Core_PseudoConstant::locationType();
+ $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
foreach ($params['mapper'] as $key => $value) {
foreach ($value as $k => $v) {
if (isset($v[1])) {
}
if (CRM_Utils_Array::value('operator', $params)) {
- $saveMappingFields->operator = CRM_Utils_Array::value($k, $params['operator'][$key]);
+ $saveMappingFields->operator = CRM_Utils_Array::value($k, $params['operator'][$key]);
}
if (CRM_Utils_Array::value('value', $params)) {
$saveMappingFields->value = CRM_Utils_Array::value($k, $params['value'][$key]);