Minor refactor preparatory to function extraction
authoreileen <emcnaughton@wikimedia.org>
Sat, 14 Jul 2018 00:29:34 +0000 (12:29 +1200)
committereileen <emcnaughton@wikimedia.org>
Tue, 17 Jul 2018 01:31:36 +0000 (13:31 +1200)
CRM/Export/BAO/Export.php

index 4fb071ff200773f7f39e283604c2d4847b40cc93..f5b946f3681701715d35188d174e5324c6e56e95 100644 (file)
@@ -444,7 +444,13 @@ class CRM_Export_BAO_Export {
       }
     }
     else {
-      $primary = TRUE;
+      $returnProperties = [
+        'location_type' => 1,
+        'im_provider' => 1,
+        'phone_type_id' => 1,
+        'provider_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')) {
@@ -453,14 +459,6 @@ class CRM_Export_BAO_Export {
         }
       }
 
-      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'];