From 4cdf555e84dab9782e8b0f70f8ebedd9782b31d1 Mon Sep 17 00:00:00 2001 From: eileen Date: Mon, 1 Feb 2021 19:50:25 +1300 Subject: [PATCH] [REF] Remove copy & paste code from Activity mapping form All this code to support location types appears to be copied & pasted & not accessed in this form --- CRM/Activity/Import/Form/MapField.php | 28 +++++++-------------------- CRM/Activity/Import/Parser.php | 1 - 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/CRM/Activity/Import/Form/MapField.php b/CRM/Activity/Import/Form/MapField.php index 8dcf6ee62a..499b991708 100644 --- a/CRM/Activity/Import/Form/MapField.php +++ b/CRM/Activity/Import/Form/MapField.php @@ -108,18 +108,14 @@ class CRM_Activity_Import_Form_MapField extends CRM_Import_Form_MapField { $hasHeaders = !empty($this->_columnHeaders); $headerPatterns = $this->get('headerPatterns'); $dataPatterns = $this->get('dataPatterns'); - $hasLocationTypes = $this->get('fieldTypes'); // Initialize all field usages to false. foreach ($mapperKeys as $key) { $this->_fieldUsed[$key] = FALSE; } - $this->_location_types = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id'); $sel1 = $this->_mapperFields; - $sel2[''] = NULL; - $js = "\n"; @@ -205,12 +193,10 @@ class CRM_Activity_Import_Form_MapField extends CRM_Import_Form_MapField { } } if ($warning != 0 && $this->get('savedMapping')) { - $session = CRM_Core_Session::singleton(); - $session->setStatus(ts('The data columns in this import file appear to be different from the saved mapping. Please verify that you have selected the correct saved mapping before continuing.')); + CRM_Core_Session::singleton()->setStatus(ts('The data columns in this import file appear to be different from the saved mapping. Please verify that you have selected the correct saved mapping before continuing.')); } else { - $session = CRM_Core_Session::singleton(); - $session->setStatus(NULL); + CRM_Core_Session::singleton()->setStatus(NULL); } $this->setDefaults($defaults); diff --git a/CRM/Activity/Import/Parser.php b/CRM/Activity/Import/Parser.php index 5e6d08b817..73bc3a02b0 100644 --- a/CRM/Activity/Import/Parser.php +++ b/CRM/Activity/Import/Parser.php @@ -307,7 +307,6 @@ abstract class CRM_Activity_Import_Parser extends CRM_Import_Parser { $store->set('lineCount', $this->_lineCount); $store->set('separator', $this->_separator); $store->set('fields', $this->getSelectValues()); - $store->set('fieldTypes', $this->getSelectTypes()); $store->set('headerPatterns', $this->getHeaderPatterns()); $store->set('dataPatterns', $this->getDataPatterns()); -- 2.25.1