Consolidate MapTable.tpl
authorEileen McNaughton <emcnaughton@wikimedia.org>
Fri, 8 Apr 2022 04:43:07 +0000 (16:43 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Fri, 8 Apr 2022 04:51:58 +0000 (16:51 +1200)
templates/CRM/Activity/Import/Form/MapField.tpl
templates/CRM/Activity/Import/Form/Preview.tpl
templates/CRM/Event/Import/Form/MapField.tpl
templates/CRM/Event/Import/Form/MapTable.tpl [deleted file]
templates/CRM/Event/Import/Form/Preview.tpl
templates/CRM/Import/Form/MapTable.tpl [moved from templates/CRM/Activity/Import/Form/MapTable.tpl with 85% similarity]
templates/CRM/Member/Import/Form/MapField.tpl
templates/CRM/Member/Import/Form/MapTable.tpl [deleted file]
templates/CRM/Member/Import/Form/Preview.tpl

index fbc5c78edbb91d80c63edace8bed58cd01a96553..dc6576a00368b1d212151e27fd0bbd2cf25b81e2 100644 (file)
@@ -20,7 +20,7 @@
 </div>
 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
  {* Table for mapping data to CRM fields *}
- {include file="CRM/Activity/Import/Form/MapTable.tpl}
+ {include file="CRM/Import/Form/MapTable.tpl"}
  <br />
 
 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
index 5b846a62cc13ac90579567a583816941aa20e4b5..111dddc6446d9b4e17d72a2b5121ccb0a36d003a 100644 (file)
@@ -73,7 +73,7 @@
  <br />
 
  {* Table for mapping preview *}
- {include file="CRM/Activity/Import/Form/MapTable.tpl}
+ {include file="CRM/Import/Form/MapTable.tpl"}
  <br />
 
  <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
index 7ed50d8d8bc60830cace4e8125c3c2ea5b774b7d..eb99c84b26986cccb88c69052eb8d45a26d993cd 100644 (file)
@@ -27,7 +27,7 @@
    </tr>
    <tr>
      <td>{* Table for mapping data to CRM fields *}
-         {include file="CRM/Event/Import/Form/MapTable.tpl}
+         {include file="CRM/Import/Form/MapTable.tpl"}
      </td>
    </tr>
    <tr>
diff --git a/templates/CRM/Event/Import/Form/MapTable.tpl b/templates/CRM/Event/Import/Form/MapTable.tpl
deleted file mode 100644 (file)
index 6d5bf95..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-{*
- +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC. All rights reserved.                        |
- |                                                                    |
- | This work is published under the GNU AGPLv3 license with some      |
- | permitted exceptions and without any warranty. For full license    |
- | and copyright information, see https://civicrm.org/licensing       |
- +--------------------------------------------------------------------+
-*}
-{* Event Import Wizard - Data Mapping table used by MapFields.tpl and Preview.tpl *}
-<div class="crm-block crm-form-block crm-event-import-maptable-form-block">
-<div id="map-field">
-    {strip}
-    <table>
-    {if $savedMappingName}
-        <tr class="columnheader-dark"><th colspan="4">{ts 1=$savedMappingName}Saved Field Mapping: %1{/ts}</td></tr>
-    {/if}
-        <tr class="columnheader">
-            {section name=rows loop=$rowDisplayCount}
-       {if $skipColumnHeader }
-                   { if $smarty.section.rows.iteration == 1 }
-                     <th>{ts}Column Headers{/ts}</th>
-                   {else}
-                     <th>{ts 1=$smarty.section.rows.iteration}Import Data (row %1){/ts}</th>
-                   {/if}
-          {else}
-                  <th>{ts 1=$smarty.section.rows.iteration}Import Data (row %1){/ts}</th>
-                {/if}
-            {/section}
-
-            <th>{ts}Matching CiviCRM Field{/ts}</th>
-        </tr>
-
-        {*Loop on columns parsed from the import data rows*}
-        {section name=cols loop=$columnCount}
-            {assign var="i" value=$smarty.section.cols.index}
-            <tr style="border-bottom: 1px solid #92B6EC;">
-
-                {section name=rows loop=$rowDisplayCount}
-                    {assign var="j" value=$smarty.section.rows.index}
-                    <td class="{if $skipColumnHeader AND $smarty.section.rows.iteration == 1}even-row labels{else}odd-row{/if}">{$dataValues[$j][$i]|escape}</td>
-                {/section}
-
-                {* Display mapper <select> field for 'Map Fields', and mapper value for 'Preview' *}
-                <td class="form-item even-row{if $wizard.currentStepName == 'Preview'} labels{/if}">
-                    {if $wizard.currentStepName == 'Preview'}
-                        {$mapper[$i]}
-                    {else}
-                        {$form.mapper[$i].html|smarty:nodefaults}
-                    {/if}
-                </td>
-
-            </tr>
-        {/section}
-
-    </table>
-  {/strip}
-
-    {if $wizard.currentStepName != 'Preview'}
-    <div>
-
-      {if $savedMappingName}
-          <span>{$form.updateMapping.html} &nbsp;&nbsp; {$form.updateMapping.label}</span>
-      {/if}
-      <span>{$form.saveMapping.html} &nbsp;&nbsp; {$form.saveMapping.label}</span>
-      <div id="saveDetails" class="form-item">
-     <table class="form-layout">
-            <tr class="crm-event_map_table-form-block-saveMappingName">
-           <td class="label">{$form.saveMappingName.label}</td><td>{$form.saveMappingName.html}</td>
-        </tr>
-        <tr class="crm-event_map_table-form-block-saveMappingDesc">
-           <td class="label">{$form.saveMappingDesc.label}</td><td>{$form.saveMappingDesc.html}</td>
-            </tr>
-     </table>
-      </div>
-      <script type="text/javascript">
-             {if $mappingDetailsError }
-                cj('#saveDetails').show();
-             {else}
-              cj('#saveDetails').hide();
-             {/if}
-
-           {literal}
-            function showSaveDetails(chkbox) {
-             if (chkbox.checked) {
-              document.getElementById("saveDetails").style.display = "block";
-              document.getElementById("saveMappingName").disabled = false;
-              document.getElementById("saveMappingDesc").disabled = false;
-             } else {
-              document.getElementById("saveDetails").style.display = "none";
-              document.getElementById("saveMappingName").disabled = true;
-              document.getElementById("saveMappingDesc").disabled = true;
-             }
-             }
-             {/literal}
-       {include file="CRM/common/highLightImport.tpl"}
-      </script>
-    </div>
-    {/if}
- </div>
-</div>
index 93c1f615edd9e3f95b58814bd4568a29d4ce4c1c..62220cc98572bd40f4820886db183c50bd670c74 100644 (file)
@@ -75,7 +75,7 @@
 
 
  {* Table for mapping preview *}
- {include file="CRM/Event/Import/Form/MapTable.tpl}
+ {include file="CRM/Import/Form/MapTable.tpl"}
 
 
  <div class="crm-submit-buttons">
similarity index 85%
rename from templates/CRM/Activity/Import/Form/MapTable.tpl
rename to templates/CRM/Import/Form/MapTable.tpl
index 9990cb38bf0d6370388f30773e5910a58d6b22e6..a805ef7d644dbf20cef2486888965733f052c6f5 100644 (file)
@@ -7,8 +7,8 @@
  | and copyright information, see https://civicrm.org/licensing       |
  +--------------------------------------------------------------------+
 *}
-{* Activity Import Wizard - Data Mapping table used by MapFields.tpl and Preview.tpl *}
-<div class="crm-block crm-form-block crm-activity_map_table-form-block">
+{* Import Wizard - Data Mapping table used by MapFields.tpl and Preview.tpl *}
+<div class="crm-block crm-form-block crm-map-table-form-block">
 
  <div id="map-field">
     {strip}
       {/if}
       <span>{$form.saveMapping.html} &nbsp;&nbsp; {$form.saveMapping.label}</span>
       <div id="saveDetails" class="form-item">
-          <table>
-                  <tr class="crm-activity_map_table-form-block-saveMappingName">
-             <td>{$form.saveMappingName.label}</td>
-                     <td>{$form.saveMappingName.html}</td>
-                  </tr>
-                  <tr class="crm-activity_map_table-form-block-saveMappingDesc">
-             <td>{$form.saveMappingDesc.label}</td>
-                     <td>{$form.saveMappingDesc.html}</td>
-                 </tr>
-            </table>
+        <table class="form-layout">
+          <tr class="crm-map-table-form-block-saveMappingName">
+            <td class="label">{$form.saveMappingName.label}</td><td>{$form.saveMappingName.html}</td>
+          </tr>
+          <tr class="crm-map-table-form-block-saveMappingDesc">
+            <td class="label">{$form.saveMappingDesc.label}</td>
+            <td>{$form.saveMappingDesc.html}</td>
+          </tr>
+        </table>
       </div>
       <script type="text/javascript">
              {if $mappingDetailsError }
index 7580006fc90aa4cea0d622fa2f39c240b22ac923..691755c7fb102179e5f1ab5104cc7ba66369b8c4 100644 (file)
@@ -19,7 +19,7 @@
 {* @var $form Contains the array for the form elements and other form associated information assigned to the template by the controller *}
 
  {* Table for mapping data to CRM fields *}
- {include file="CRM/Member/Import/Form/MapTable.tpl}
+ {include file="CRM/Import/Form/MapTable.tpl"}
 
 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
 </div>
diff --git a/templates/CRM/Member/Import/Form/MapTable.tpl b/templates/CRM/Member/Import/Form/MapTable.tpl
deleted file mode 100644 (file)
index 8a8cbfa..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-{*
- +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC. All rights reserved.                        |
- |                                                                    |
- | This work is published under the GNU AGPLv3 license with some      |
- | permitted exceptions and without any warranty. For full license    |
- | and copyright information, see https://civicrm.org/licensing       |
- +--------------------------------------------------------------------+
-*}
-{* Membership Import Wizard - Data Mapping table used by MapFields.tpl and Preview.tpl *}
-
- <div id="map-field">
-    {strip}
-    <table>
-    {if $savedMappingName}
-        <tr class="columnheader-dark"><th colspan="4">{ts 1=$savedMappingName}Saved Field Mapping: %1{/ts}</td></tr>
-    {/if}
-        <tr class="columnheader">
-            {section name=rows loop=$rowDisplayCount}
-       {if $skipColumnHeader }
-                   { if $smarty.section.rows.iteration == 1 }
-                     <th>{ts}Column Headers{/ts}</th>
-                   {else}
-                     <th>{ts 1=$smarty.section.rows.iteration}Import Data (row %1){/ts}</th>
-                   {/if}
-          {else}
-                  <th>{ts 1=$smarty.section.rows.iteration}Import Data (row %1){/ts}</th>
-                {/if}
-            {/section}
-
-            <th>{ts}Matching CiviCRM Field{/ts}</th>
-        </tr>
-
-        {*Loop on columns parsed from the import data rows*}
-        {section name=cols loop=$columnCount}
-            {assign var="i" value=$smarty.section.cols.index}
-            <tr style="border-bottom: 1px solid #92B6EC;">
-
-                {section name=rows loop=$rowDisplayCount}
-                    {assign var="j" value=$smarty.section.rows.index}
-                    <td class="{if $skipColumnHeader AND $smarty.section.rows.iteration == 1}even-row labels{else}odd-row{/if}">{$dataValues[$j][$i]|escape}</td>
-                {/section}
-
-                {* Display mapper <select> field for 'Map Fields', and mapper value for 'Preview' *}
-                <td class="form-item even-row{if $wizard.currentStepName == 'Preview'} labels{/if}">
-                    {if $wizard.currentStepName == 'Preview'}
-                        {$mapper[$i]}
-                    {else}
-                        {$form.mapper[$i].html|smarty:nodefaults}
-                    {/if}
-                </td>
-
-            </tr>
-        {/section}
-
-    </table>
-  {/strip}
-
-    {if $wizard.currentStepName != 'Preview'}
-    <div>
-
-      {if $savedMappingName}
-          <span>{$form.updateMapping.html} &nbsp;&nbsp; {$form.updateMapping.label}</span>
-      {/if}
-      <span>{$form.saveMapping.html} &nbsp;&nbsp; {$form.saveMapping.label}</span>
-      <div id="saveDetails" class="form-item">
-            <table class="form-layout-compressed">
-             <tr class="crm-membership-form-block-saveMappingName">
-              <td>{$form.saveMappingName.label}</td><td>{$form.saveMappingName.html}</td>
-               </tr>
-               <tr class="crm-membership-form-block-saveMappingDesc">
-              <td>{$form.saveMappingDesc.label}</td><td>{$form.saveMappingDesc.html}</td>
-             </tr>
-            </table>
-      </div>
-      <script type="text/javascript">
-             {if $mappingDetailsError }
-                cj('#saveDetails').show();
-             {else}
-              cj('#saveDetails').hide();
-             {/if}
-
-           {literal}
-            function showSaveDetails(chkbox) {
-             if (chkbox.checked) {
-              document.getElementById("saveDetails").style.display = "block";
-              document.getElementById("saveMappingName").disabled = false;
-              document.getElementById("saveMappingDesc").disabled = false;
-             } else {
-              document.getElementById("saveDetails").style.display = "none";
-              document.getElementById("saveMappingName").disabled = true;
-              document.getElementById("saveMappingDesc").disabled = true;
-             }
-             }
-             {/literal}
-       {include file="CRM/common/highLightImport.tpl"}
-      </script>
-    </div>
-    {/if}
- </div>
index e4465552d57b9c0a168403dfccb02cfcffd3a67c..390b7e225052ba4e18ac449c7500ed00608abf07 100644 (file)
@@ -73,7 +73,7 @@
 
 
  {* Table for mapping preview *}
- {include file="CRM/Member/Import/Form/MapTable.tpl}
+ {include file="CRM/Import/Form/MapTable.tpl"}
 
 
  <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>