Fix enotice, simplify text on Saved field mapping
authorEileen McNaughton <emcnaughton@wikimedia.org>
Wed, 6 Apr 2022 05:31:16 +0000 (17:31 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Wed, 6 Apr 2022 05:47:28 +0000 (17:47 +1200)
CRM/Contact/Import/Form/DataSource.php
CRM/Custom/Import/Form/DataSource.php
CRM/Import/Form/DataSource.php
templates/CRM/Activity/Import/Form/DataSource.tpl
templates/CRM/Contact/Import/Form/DataSource.tpl
templates/CRM/Contribute/Import/Form/DataSource.tpl
templates/CRM/Custom/Import/Form/DataSource.tpl
templates/CRM/Event/Import/Form/DataSource.tpl
templates/CRM/Member/Import/Form/DataSource.tpl

index 070affb7c8004131579773fd4d0fdf9f790ad23f..933648584199032c168ccd895dd053074ff837df 100644 (file)
@@ -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');
     }
index 1fcc6b2323aab14b40abf1a4213e0ee9abf1dd5e..4257fd0dc6acc2e03a2e7743a31b3bf74c777b04 100644 (file)
@@ -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;
     }
index d06d6c56e998eb754e5ae68cc3a719ec2d714493..e2e3e2d6f73d7c4fe471c6a8ec0d8bde96376edc 100644 (file)
@@ -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]);
     }
 
index 89f67bf144bb0aa23200d03204684fd03d5eed54..d51557e78669b7554a1546a0fac914d9ebd90996 100644 (file)
@@ -43,7 +43,7 @@
         <tr>{include file="CRM/Core/Date.tpl"}</tr>
         {if $savedMapping}
         <tr class="crm-activity-import-uploadfile-form-block-savedMapping">
-        <td>{if $loadedMapping}{ts}Select a Different Field Mapping{/ts}{else}{ts}Load Saved Field Mapping{/ts}{/if}</td>
+        <td>{$form.savedMapping.label}</td>
            <td>{$form.savedMapping.html}<br />
               <span class="description">{ts}Select Saved Mapping or Leave blank to create a new One.{/ts}</span>
 {/if}
index 5009af8a195864f0a7d63f91d6995ab94a5a49a0..72fb1dec112afe2bdd98702bbee329da0572cb40 100644 (file)
@@ -77,7 +77,7 @@
 
         {if $savedMapping}
          <tr  class="crm-import-datasource-form-block-savedMapping">
-              <td class="label"><label for="savedMapping">{if $loadedMapping}{ts}Select a Different Field Mapping{/ts}{else}{ts}Load Saved Field Mapping{/ts}{/if}</label></td>
+              <td class="label"><label for="savedMapping">{$form.savedMapping.label}</label></td>
               <td>{$form.savedMapping.html}<br />
       &nbsp;&nbsp;&nbsp;<span class="description">{ts}Select Saved Mapping or Leave blank to create a new One.{/ts}</span></td>
          </tr>
index cafd93d903922abdfa9646770b002546975279be..96163585857f643510fbcb8405a07c2faa225ad0 100644 (file)
@@ -34,9 +34,9 @@
           <td>{$form.fieldSeparator.html}</td>
         </tr>
         <tr>{include file="CRM/Core/Date.tpl"}</tr>
-{if $savedMapping}
-      <tr> <td class="label">{if $loadedMapping}{ts}Select a Different Field Mapping{/ts}{else}{ts}Load Saved Field Mapping{/ts}{/if}</td><td>{$form.savedMapping.html}<br /> <span class="description">{ts}Select a saved field mapping if this file format matches a previous import.{/ts}</span></tr>
-{/if}
+  {if $savedMapping}
+        <tr> <td class="label">{$form.savedMapping.label}</td><td>{$form.savedMapping.html}<br /> <span class="description">{ts}Select a saved field mapping if this file format matches a previous import.{/ts}</span></tr>
+  {/if}
     </table>
 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
  </div>
index abbde109807862a1f5ed6d191d632d39cba64e7d..38b479dc33cd56acd241f93dd58be9cc841dc4f5 100644 (file)
@@ -64,7 +64,7 @@
   </tr>
   {if $savedMapping}
   <tr class="crm-custom-import-uploadfile-form-block-savedMapping">
-              <td class="label">{if $loadedMapping}{ts}Select a Different Field Mapping{/ts}{else}{ts}Load Saved Field Mapping{/ts}{/if}</td>
+              <td class="label">{$form.savedMapping.label}</td>
               <td><span>{$form.savedMapping.html}</span> </td>
   </tr>
   <tr>
index 88083860960480f4dc1dc6d7b7e6592e27871514..626b1d8cec4b66cd2e47da84757d37506efa61f1 100644 (file)
@@ -64,7 +64,7 @@
   </tr>
   {if $savedMapping}
   <tr class="crm-event-import-uploadfile-form-block-savedMapping">
-              <td class="label">{if $loadedMapping}{ts}Select a Different Field Mapping{/ts}{else}{ts}Load Saved Field Mapping{/ts}{/if}</dt>
+              <td class="label">{$form.savedMapping.label}</td>
               <td><span>{$form.savedMapping.html}</span> </td>
   </tr>
   <tr>
index 9e70692bb48ed71f8e75fcff5ca1f482d2b25b3c..fb4cfaf060416ce8e4adf5433c09ebac327e3d72 100644 (file)
@@ -53,7 +53,7 @@
        <tr class="crm-member-import-uploadfile-from-block-date">{include file="CRM/Core/Date.tpl"}</tr>
 {if $savedMapping}
        <tr  class="crm-member-import-uploadfile-from-block-savedMapping">
-         <td>{if $loadedMapping}{ts}Select a Different Field Mapping{/ts}{else}{ts}Load Saved Field Mapping{/ts}{/if}</td>
+         <td>{$form.savedMapping.label}</td>
          <td>{$form.savedMapping.html}<br />
            <span class="description">{ts}If you want to use a previously saved import field mapping - select it here.{/ts}</span>
          </td>