{* Table for mapping data to CRM fields *}
{include file="CRM/Contact/Import/Form/MapTable.tpl" mapper=$form.mapper}
+ {* // Set default location type *}
+ {literal}
+ <script type="text/javascript">
+ CRM.$(function($) {
+ var defaultLocationType = "{/literal}{$defaultLocationType}{literal}";
+ if (defaultLocationType.length) {
+ $('#map-field').on('change', 'select[id^="mapper"][id$="_0"]', function() {
+ var select = $(this).next();
+ $('option', select).each(function() {
+ if ($(this).attr('value') == defaultLocationType && $(this).text() == {/literal}{
+ $defaultLocationTypeLabel|@json_encode}{literal}) {
+ select.val(defaultLocationType);
+ }
+ });
+ });
+ }
+ });
+ </script>
+ {/literal}
+
<script type="text/javascript" >
{literal}
if ( document.getElementsByName("saveMapping")[0].checked ) {
+--------------------------------------------------------------------+
*}
{include file="CRM/Import/Form/MapTableCommon.tpl"}
-
-{if $wizard.currentStepName != 'Preview'}
- {* // Set default location type *}
- {literal}
- <script type="text/javascript">
- CRM.$(function($) {
- var defaultLocationType = "{/literal}{$defaultLocationType}{literal}";
- if (defaultLocationType.length) {
- $('#map-field').on('change', 'select[id^="mapper"][id$="_0"]', function() {
- var select = $(this).next();
- $('option', select).each(function() {
- if ($(this).attr('value') == defaultLocationType && $(this).text() == {/literal}{
- $defaultLocationTypeLabel|@json_encode}{literal}) {
- select.val(defaultLocationType);
- }
- });
- });
- }
- });
- </script>
- {/literal}
-{/if}