Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CiviCRM Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
CiviCRM Core
Commits
2a879010
Commit
2a879010
authored
2 years ago
by
Eileen McNaughton
Browse files
Options
Downloads
Patches
Plain Diff
[Import] [ref] Move function to parent for use by siblings
parent
7c63299d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CRM/Contact/Import/Form/Preview.php
+0
-20
0 additions, 20 deletions
CRM/Contact/Import/Form/Preview.php
CRM/Import/Forms.php
+20
-0
20 additions, 0 deletions
CRM/Import/Forms.php
with
20 additions
and
20 deletions
CRM/Contact/Import/Form/Preview.php
+
0
−
20
View file @
2a879010
...
...
@@ -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
*/
...
...
This diff is collapsed.
Click to expand it.
CRM/Import/Forms.php
+
20
−
0
View file @
2a879010
...
...
@@ -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
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment