Move greeting params retrieval to the place in the code where it is used
[civicrm-core.git] / CRM / Export / Form / Select.php
index 5ce06d9976ce5872cc5ba6c463f7b6e285d033e2..315c622cb146d3c824729b10c0686e393204b2f5 100644 (file)
@@ -142,7 +142,8 @@ class CRM_Export_Form_Select extends CRM_Core_Form_Task {
         if ($formName == 'CRM_Export_StateMachine_Standalone') {
           $componentName = ['CRM', $this->controller->get('entity')];
         }
-        $entityShortname = $componentName[1]; // Contact
+        // Contact
+        $entityShortname = $componentName[1];
         $entityDAOName = $entityShortname;
         break;
     }
@@ -316,18 +317,17 @@ FROM   {$this->_componentTable}
     ]);
 
     $this->addButtons([
-        [
-          'type' => 'next',
-          'name' => ts('Continue'),
-          'spacing' => '          ',
-          'isDefault' => TRUE,
-        ],
-        [
-          'type' => 'cancel',
-          'name' => ts('Cancel'),
-        ],
-      ]
-    );
+      [
+        'type' => 'next',
+        'name' => ts('Continue'),
+        'spacing' => '          ',
+        'isDefault' => TRUE,
+      ],
+      [
+        'type' => 'cancel',
+        'name' => ts('Cancel'),
+      ],
+    ]);
 
     $this->addFormRule(['CRM_Export_Form_Select', 'formRule'], $this);
   }
@@ -388,22 +388,6 @@ FROM   {$this->_componentTable}
     // all submitted options or any other argument
     $exportParams = $params;
 
-    if (!empty($this->_greetingOptions)) {
-      foreach ($this->_greetingOptions as $key => $value) {
-        if ($option = CRM_Utils_Array::value($key, $exportParams)) {
-          if ($this->_greetingOptions[$key][$option] == ts('Other')) {
-            $exportParams[$key] = $exportParams["{$key}_other"];
-          }
-          elseif ($this->_greetingOptions[$key][$option] == ts('List of names')) {
-            $exportParams[$key] = '';
-          }
-          else {
-            $exportParams[$key] = $this->_greetingOptions[$key][$option];
-          }
-        }
-      }
-    }
-
     $mappingId = CRM_Utils_Array::value('mapping', $params);
     if ($mappingId) {
       $this->set('mappingId', $mappingId);