From 2a879010b5a31962e9792583955447cb04fb5185 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Thu, 26 May 2022 19:21:11 +1200 Subject: [PATCH] [Import] [ref] Move function to parent for use by siblings --- CRM/Contact/Import/Form/Preview.php | 20 -------------------- CRM/Import/Forms.php | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/CRM/Contact/Import/Form/Preview.php b/CRM/Contact/Import/Form/Preview.php index 9f03057aee..6e34b5657a 100644 --- a/CRM/Contact/Import/Form/Preview.php +++ b/CRM/Contact/Import/Form/Preview.php @@ -241,26 +241,6 @@ class CRM_Contact_Import_Form_Preview extends CRM_Import_Form_Preview { $importJob->isComplete(); } - /** - * Get the mapped fields as an array of labels. - * - * e.g - * ['First Name', 'Employee Of - First Name', 'Home - Street Address'] - * - * @return array - * @throws \API_Exception - * @throws \CRM_Core_Exception - */ - protected function getMappedFieldLabels(): array { - $mapper = []; - $parser = new CRM_Contact_Import_Parser_Contact(); - $parser->setUserJobID($this->getUserJobID()); - foreach ($this->getSubmittedValue('mapper') as $columnNumber => $mappedField) { - $mapper[$columnNumber] = $parser->getMappedFieldLabel($parser->getMappingFieldFromMapperInput($mappedField, 0, $columnNumber)); - } - return $mapper; - } - /** * @return \CRM_Contact_Import_Parser_Contact */ diff --git a/CRM/Import/Forms.php b/CRM/Import/Forms.php index 1262fa0e36..822fc5d5f1 100644 --- a/CRM/Import/Forms.php +++ b/CRM/Import/Forms.php @@ -567,4 +567,24 @@ class CRM_Import_Forms extends CRM_Core_Form { return NULL; } + /** + * Get the mapped fields as an array of labels. + * + * e.g + * ['First Name', 'Employee Of - First Name', 'Home - Street Address'] + * + * @return array + * @throws \API_Exception + * @throws \CRM_Core_Exception + */ + protected function getMappedFieldLabels(): array { + $mapper = []; + $parser = new CRM_Contact_Import_Parser_Contact(); + $parser->setUserJobID($this->getUserJobID()); + foreach ($this->getSubmittedValue('mapper') as $columnNumber => $mappedField) { + $mapper[$columnNumber] = $parser->getMappedFieldLabel($parser->getMappingFieldFromMapperInput($mappedField, 0, $columnNumber)); + } + return $mapper; + } + } -- 2.25.1