2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.7 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2015 |
6 +--------------------------------------------------------------------+
7 | This file is a part of CiviCRM. |
9 | CiviCRM is free software; you can copy, modify, and distribute it |
10 | under the terms of the GNU Affero General Public License |
11 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
13 | CiviCRM is distributed in the hope that it will be useful, but |
14 | WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
16 | See the GNU Affero General Public License for more details. |
18 | You should have received a copy of the GNU Affero General Public |
19 | License and the CiviCRM Licensing Exception along |
20 | with this program; if not, contact CiviCRM LLC |
21 | at info[AT]civicrm[DOT]org. If you have questions about the |
22 | GNU Affero General Public License or the licensing of CiviCRM, |
23 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
24 +--------------------------------------------------------------------+
26 <div class="crm-block crm-form-block crm-import-maptable-form-block">
28 {* Import Wizard - Data Mapping table used by MapFields.tpl and Preview.tpl *}
31 <table class="selector">
33 <tr class="columnheader-dark"><th colspan="4">{ts 1=$savedName}Saved Field Mapping: %1{/ts}</td></tr>
35 <tr class="columnheader">
37 {assign var="totalRowsDisplay" value=$rowDisplayCount+1}
39 {assign var="totalRowsDisplay" value=$rowDisplayCount}
41 {section name=rows loop=$totalRowsDisplay}
42 { if $smarty.section.rows.iteration == 1 and $showColNames}
43 <td>{ts}Column Names{/ts}</td>
44 {elseif $showColNames}
45 <td>{ts 1=$smarty.section.rows.iteration-1}Import Data (row %1){/ts}</td>
47 <td>{ts 1=$smarty.section.rows.iteration}Import Data (row %1){/ts}</td>
51 <td>{ts}Matching CiviCRM Field{/ts}</td>
54 {*Loop on columns parsed from the import data rows*}
55 {section name=cols loop=$columnCount}
56 {assign var="i" value=$smarty.section.cols.index}
57 <tr style="border: 1px solid #DDDDDD;">
60 <td class="even-row labels">{$columnNames[$i]}</td>
63 {section name=rows loop=$rowDisplayCount}
64 {assign var="j" value=$smarty.section.rows.index}
65 <td class="odd-row">{$dataValues[$j][$i]}</td>
68 {* Display mapper <select> field for 'Map Fields', and mapper value for 'Preview' *}
69 <td class="form-item even-row{if $wizard.currentStepName == 'Preview'} labels{/if}">
70 {if $wizard.currentStepName == 'Preview'}
71 {if $relatedContactDetails && $relatedContactDetails[$i] != ''}
72 {$mapper[$i]} - {$relatedContactDetails[$i]}
74 {if $relatedContactLocType && $relatedContactLocType[$i] != ''}
75 - {$relatedContactLocType[$i]}
78 {if $relatedContactPhoneType && $relatedContactPhoneType[$i] != ''}
79 - {$relatedContactPhoneType[$i]}
82 {* append IM Service Provider type for related contact *}
83 {if $relatedContactImProvider && $relatedContactImProvider[$i] != ''}
84 - {$relatedContactImProvider[$i]}
87 {* append website type *}
88 {if $relatedContactWebsiteType && $relatedContactWebsiteType[$i] != ''}
89 - {$relatedContactWebsiteType[$i]}
102 {* append IM Service provider type for contact *}
107 {* append website type *}
117 {$form.mapper[$i].html}
127 {if $wizard.currentStepName != 'Preview'}
131 <span>{$form.updateMapping.html} {$form.updateMapping.label}</span>
133 <span>{$form.saveMapping.html} {$form.saveMapping.label}</span>
134 <div id="saveDetails" class="form-item">
135 <table class="form-layout-compressed">
136 <tr class="crm-import-maptable-form-block-saveMappingName">
137 <td class="label">{$form.saveMappingName.label}</td>
138 <td>{$form.saveMappingName.html}</td>
140 <tr class="crm-import-maptable-form-block-saveMappingName">
141 <td class="label">{$form.saveMappingDesc.label}</td>
142 <td>{$form.saveMappingDesc.html}</td>
146 <script type="text/javascript">
147 {if $mappingDetailsError }
148 cj('#saveDetails').show();
150 cj('#saveDetails').hide();
154 function showSaveDetails(chkbox) {
155 if (chkbox.checked) {
156 document.getElementById("saveDetails").style.display = "block";
157 document.getElementById("saveMappingName").disabled = false;
158 document.getElementById("saveMappingDesc").disabled = false;
160 document.getElementById("saveDetails").style.display = "none";
161 document.getElementById("saveMappingName").disabled = true;
162 document.getElementById("saveMappingDesc").disabled = true;
165 cj('select[id^="mapper"][id$="[0]"]').addClass('huge');
167 {include file="CRM/common/highLightImport.tpl" relationship=true}
169 {* // Set default location type *}
172 var defaultLocationType = "{/literal}{$defaultLocationType}{literal}";
173 if (defaultLocationType.length) {
174 $('#map-field').on('change', 'select[id^="mapper"][id$="_0"]', function() {
175 var select = $(this).next();
176 $('option', select).each(function() {
177 if ($(this).attr('value') == defaultLocationType
178 && $(this).text() == "{/literal}{$defaultLocationTypeLabel}{literal}") {
179 select.val(defaultLocationType);