Skip to content

Commit

Permalink
Minor refactor preparatory to function extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Jul 14, 2018
1 parent d576e59 commit 2391353
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions CRM/Export/BAO/Export.php
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,18 @@ public static function exportComponents(
}
}
else {
$primary = TRUE;
$extraProperties = self::defineExtraProperties($queryMode);
$paymentFields = $extraProperties['paymentFields'];
$extraReturnProperties = $extraProperties['extraReturnProperties'];
$paymentTableId = $extraProperties['paymentTableId'];

$returnProperties = [
'location_type' => 1,
'im_provider' => 1,
'phone_type_id' => 1,
'current_employer' => 1,
];

$fields = CRM_Contact_BAO_Contact::exportableFields('All', TRUE, TRUE);
foreach ($fields as $key => $var) {
if ($key && (substr($key, 0, 6) != 'custom')) {
Expand All @@ -496,19 +507,6 @@ public static function exportComponents(
}
}

if ($primary) {
$returnProperties['location_type'] = 1;
$returnProperties['im_provider'] = 1;
$returnProperties['phone_type_id'] = 1;
$returnProperties['provider_id'] = 1;
$returnProperties['current_employer'] = 1;
}

$extraProperties = self::defineExtraProperties($queryMode);
$paymentFields = $extraProperties['paymentFields'];
$extraReturnProperties = $extraProperties['extraReturnProperties'];
$paymentTableId = $extraProperties['paymentTableId'];

if ($queryMode != CRM_Contact_BAO_Query::MODE_CONTACTS) {
$componentReturnProperties = CRM_Contact_BAO_Query::defaultReturnProperties($queryMode);
if ($queryMode == CRM_Contact_BAO_Query::MODE_CONTRIBUTE) {
Expand Down

0 comments on commit 2391353

Please sign in to comment.