From 5658157f198a1d080a887e93ee2592c6627b7904 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Wed, 6 Apr 2022 17:31:16 +1200 Subject: [PATCH] Fix enotice, simplify text on Saved field mapping --- CRM/Contact/Import/Form/DataSource.php | 3 +-- CRM/Custom/Import/Form/DataSource.php | 1 - CRM/Import/Form/DataSource.php | 3 +-- templates/CRM/Activity/Import/Form/DataSource.tpl | 2 +- templates/CRM/Contact/Import/Form/DataSource.tpl | 2 +- templates/CRM/Contribute/Import/Form/DataSource.tpl | 6 +++--- templates/CRM/Custom/Import/Form/DataSource.tpl | 2 +- templates/CRM/Event/Import/Form/DataSource.tpl | 2 +- templates/CRM/Member/Import/Form/DataSource.tpl | 2 +- 9 files changed, 10 insertions(+), 13 deletions(-) diff --git a/CRM/Contact/Import/Form/DataSource.php b/CRM/Contact/Import/Form/DataSource.php index 070affb7c8..9336485841 100644 --- a/CRM/Contact/Import/Form/DataSource.php +++ b/CRM/Contact/Import/Form/DataSource.php @@ -145,7 +145,7 @@ class CRM_Contact_Import_Form_DataSource extends CRM_Core_Form { $mappingArray = CRM_Core_BAO_Mapping::getMappings('Import Contact'); $this->assign('savedMapping', $mappingArray); - $this->addElement('select', 'savedMapping', ts('Mapping Option'), ['' => ts('- select -')] + $mappingArray); + $this->addElement('select', 'savedMapping', ts('Saved Field Mapping'), ['' => ts('- select -')] + $mappingArray); $js = ['onClick' => "buildSubTypes();buildDedupeRules();"]; // contact types option @@ -214,7 +214,6 @@ class CRM_Contact_Import_Form_DataSource extends CRM_Core_Form { 'fieldSeparator' => $config->fieldSeparator, ]; - $this->assign('loadedMapping', $this->get('loadedMapping')); if ($this->get('loadedMapping')) { $defaults['savedMapping'] = $this->get('loadedMapping'); } diff --git a/CRM/Custom/Import/Form/DataSource.php b/CRM/Custom/Import/Form/DataSource.php index 1fcc6b2323..4257fd0dc6 100644 --- a/CRM/Custom/Import/Form/DataSource.php +++ b/CRM/Custom/Import/Form/DataSource.php @@ -36,7 +36,6 @@ class CRM_Custom_Import_Form_DataSource extends CRM_Import_Form_DataSource { ]; $loadedMapping = $this->get('loadedMapping'); - $this->assign('loadedMapping', $loadedMapping); if ($loadedMapping) { $defaults['savedMapping'] = $loadedMapping; } diff --git a/CRM/Import/Form/DataSource.php b/CRM/Import/Form/DataSource.php index d06d6c56e9..e2e3e2d6f7 100644 --- a/CRM/Import/Form/DataSource.php +++ b/CRM/Import/Form/DataSource.php @@ -66,10 +66,9 @@ abstract class CRM_Import_Form_DataSource extends CRM_Core_Form { $mappingArray = CRM_Core_BAO_Mapping::getCreateMappingValues('Import ' . static::IMPORT_ENTITY); $this->assign('savedMapping', $mappingArray); - $this->add('select', 'savedMapping', ts('Mapping Option'), ['' => ts('- select -')] + $mappingArray); + $this->add('select', 'savedMapping', ts('Saved Field Mapping'), ['' => ts('- select -')] + $mappingArray); if ($loadedMapping = $this->get('loadedMapping')) { - $this->assign('loadedMapping', $loadedMapping); $this->setDefaults(['savedMapping' => $loadedMapping]); } diff --git a/templates/CRM/Activity/Import/Form/DataSource.tpl b/templates/CRM/Activity/Import/Form/DataSource.tpl index 89f67bf144..d51557e786 100644 --- a/templates/CRM/Activity/Import/Form/DataSource.tpl +++ b/templates/CRM/Activity/Import/Form/DataSource.tpl @@ -43,7 +43,7 @@ {include file="CRM/Core/Date.tpl"} {if $savedMapping} - {if $loadedMapping}{ts}Select a Different Field Mapping{/ts}{else}{ts}Load Saved Field Mapping{/ts}{/if} + {$form.savedMapping.label} {$form.savedMapping.html}
{ts}Select Saved Mapping or Leave blank to create a new One.{/ts} {/if} diff --git a/templates/CRM/Contact/Import/Form/DataSource.tpl b/templates/CRM/Contact/Import/Form/DataSource.tpl index 5009af8a19..72fb1dec11 100644 --- a/templates/CRM/Contact/Import/Form/DataSource.tpl +++ b/templates/CRM/Contact/Import/Form/DataSource.tpl @@ -77,7 +77,7 @@ {if $savedMapping} - + {$form.savedMapping.html}
   {ts}Select Saved Mapping or Leave blank to create a new One.{/ts} diff --git a/templates/CRM/Contribute/Import/Form/DataSource.tpl b/templates/CRM/Contribute/Import/Form/DataSource.tpl index cafd93d903..9616358585 100644 --- a/templates/CRM/Contribute/Import/Form/DataSource.tpl +++ b/templates/CRM/Contribute/Import/Form/DataSource.tpl @@ -34,9 +34,9 @@ {$form.fieldSeparator.html} {include file="CRM/Core/Date.tpl"} -{if $savedMapping} - {if $loadedMapping}{ts}Select a Different Field Mapping{/ts}{else}{ts}Load Saved Field Mapping{/ts}{/if}{$form.savedMapping.html}
{ts}Select a saved field mapping if this file format matches a previous import.{/ts} -{/if} + {if $savedMapping} + {$form.savedMapping.label}{$form.savedMapping.html}
{ts}Select a saved field mapping if this file format matches a previous import.{/ts} + {/if}
{include file="CRM/common/formButtons.tpl" location="bottom"}
diff --git a/templates/CRM/Custom/Import/Form/DataSource.tpl b/templates/CRM/Custom/Import/Form/DataSource.tpl index abbde10980..38b479dc33 100644 --- a/templates/CRM/Custom/Import/Form/DataSource.tpl +++ b/templates/CRM/Custom/Import/Form/DataSource.tpl @@ -64,7 +64,7 @@ {if $savedMapping} - {if $loadedMapping}{ts}Select a Different Field Mapping{/ts}{else}{ts}Load Saved Field Mapping{/ts}{/if} + {$form.savedMapping.label} {$form.savedMapping.html} diff --git a/templates/CRM/Event/Import/Form/DataSource.tpl b/templates/CRM/Event/Import/Form/DataSource.tpl index 8808386096..626b1d8cec 100644 --- a/templates/CRM/Event/Import/Form/DataSource.tpl +++ b/templates/CRM/Event/Import/Form/DataSource.tpl @@ -64,7 +64,7 @@ {if $savedMapping} - {if $loadedMapping}{ts}Select a Different Field Mapping{/ts}{else}{ts}Load Saved Field Mapping{/ts}{/if} + {$form.savedMapping.label} {$form.savedMapping.html} diff --git a/templates/CRM/Member/Import/Form/DataSource.tpl b/templates/CRM/Member/Import/Form/DataSource.tpl index 9e70692bb4..fb4cfaf060 100644 --- a/templates/CRM/Member/Import/Form/DataSource.tpl +++ b/templates/CRM/Member/Import/Form/DataSource.tpl @@ -53,7 +53,7 @@ {include file="CRM/Core/Date.tpl"} {if $savedMapping} - {if $loadedMapping}{ts}Select a Different Field Mapping{/ts}{else}{ts}Load Saved Field Mapping{/ts}{/if} + {$form.savedMapping.label} {$form.savedMapping.html}
{ts}If you want to use a previously saved import field mapping - select it here.{/ts} -- 2.25.1