2 +--------------------------------------------------------------------+
3 | Copyright CiviCRM LLC. All rights reserved. |
5 | This work is published under the GNU AGPLv3 license with some |
6 | permitted exceptions and without any warranty. For full license |
7 | and copyright information, see https://civicrm.org/licensing |
8 +--------------------------------------------------------------------+
11 <div class="crm-block crm-form-block crm-import-datasource-form-block">
12 {if $showOnlyDataSourceFormPane}
13 {include file=$dataSourceFormTemplateFile}
15 {* Import Wizard - Step 1 (choose data source) *}
16 {* @var $form Contains the array for the form elements and other form associated information assigned to the template by the controller *}
18 {* WizardHeader.tpl provides visual display of steps thru the wizard as well as title for current step *}
19 {include file="CRM/common/WizardHeader.tpl"}
21 {ts}The Import Wizard allows you to easily import contact records from other applications into CiviCRM. For example, if your organization has contacts in MS Access® or Excel®, and you want to start using CiviCRM to store these contacts, you can 'import' them here.{/ts} {help id='choose-data-source-intro'}
23 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
24 <div id="choose-data-source" class="form-item">
25 <h3>{ts}Choose Data Source{/ts}</h3>
26 <table class="form-layout">
27 <tr class="crm-import-datasource-form-block-dataSource">
28 <td class="label">{$form.dataSource.label}</td>
29 <td>{$form.dataSource.html} {help id='data-source-selection'}</td>
34 {* Data source form pane is injected here when the data source is selected. *}
35 <div id="data-source-form-block">
36 {if $dataSourceFormTemplateFile}
37 {include file=$dataSourceFormTemplateFile}
41 <div id="common-form-controls" class="form-item">
42 <h3>{ts}Import Options{/ts}</h3>
43 <table class="form-layout-compressed">
44 <tr class="crm-import-datasource-form-block-contactType">
45 <td class="label">{$form.contactType.label}</td>
46 <td>{$form.contactType.html} {help id='contact-type'}
47 <span id="contact-subtype">{$form.subType.label} {$form.subType.html} {help id='contact-sub-type'}</span></td>
49 <tr class="crm-import-datasource-form-block-onDuplicate">
50 <td class="label">{$form.onDuplicate.label}</td>
51 <td>{$form.onDuplicate.html} {help id='dupes'}</td>
53 <tr class="crm-import-datasource-form-block-dedupe">
54 <td class="label">{$form.dedupe.label}</td>
55 <td><span id="contact-dedupe">{$form.dedupe.html}</span> {help id='id-dedupe_rule'}</td>
57 <tr class="crm-import-datasource-form-block-fieldSeparator">
58 <td class="label">{$form.fieldSeparator.label}</td>
59 <td>{$form.fieldSeparator.html} {help id='id-fieldSeparator'}</td>
61 <tr>{include file="CRM/Core/Date.tpl"}</tr>
63 <td></td><td class="description">{ts}Select the format that is used for date fields in your import data.{/ts}</td>
67 <tr class="crm-import-datasource-form-block-doGeocodeAddress">
68 <td class="label"></td>
69 <td>{$form.doGeocodeAddress.html} {$form.doGeocodeAddress.label}<br />
70 <span class="description">
71 {ts}This option is not recommended for large imports. Use the command-line geocoding script instead.{/ts}
73 {docURL page="user/initial-set-up/scheduled-jobs"}
79 <tr class="crm-import-datasource-form-block-savedMapping">
80 <td class="label"><label for="savedMapping">{$form.savedMapping.label}</label></td>
81 <td>{$form.savedMapping.html}<br />
82 <span class="description">{ts}Select Saved Mapping or Leave blank to create a new One.{/ts}</span></td>
86 {if $form.disableUSPS}
87 <tr class="crm-import-datasource-form-block-disableUSPS">
88 <td class="label"></td>
89 <td>{$form.disableUSPS.html} <label for="disableUSPS">{$form.disableUSPS.label}</label></td>
96 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"} </div>
99 <script type="text/javascript">
101 //build data source form block
102 buildDataSourceFormBlock();
107 function buildDataSourceFormBlock(dataSource)
109 var dataUrl = {/literal}"{crmURL p=$urlPath h=0 q=$urlPathVar}"{literal};
112 var dataSource = cj("#dataSource").val();
116 dataUrl = dataUrl + '&dataSource=' + dataSource;
118 cj("#data-source-form-block").html( '' );
122 cj("#data-source-form-block").load( dataUrl );
125 function buildSubTypes( )
127 element = cj('input[name="contactType"]:checked').val( );
128 var postUrl = {/literal}"{crmURL p='civicrm/ajax/subtype' h=0 }"{literal};
129 var param = 'parentId='+ element;
130 cj.ajax({ type: "POST", url: postUrl, data: param, async: false, dataType: 'json',
132 success: function(subtype){
133 if ( subtype.length == 0 ) {
134 cj("#subType").empty();
135 cj("#contact-subtype").hide();
137 cj("#contact-subtype").show();
138 cj("#subType").empty();
140 cj("#subType").append("<option value=''>- {/literal}{ts escape='js'}select{/ts}{literal} -</option>");
141 for ( var key in subtype ) {
142 // stick these new options in the subtype select
143 cj("#subType").append("<option value="+key+">"+subtype[key]+" </option>");
153 function buildDedupeRules( )
155 element = cj("input[name=contactType]:checked").val();
156 var postUrl = {/literal}"{crmURL p='civicrm/ajax/dedupeRules' h=0 }"{literal};
157 var param = 'parentId='+ element;
158 cj.ajax({ type: "POST", url: postUrl, data: param, async: false, dataType: 'json',
160 success: function(dedupe){
161 if ( dedupe.length == 0 ) {
162 cj("#dedupe").empty();
163 cj("#contact-dedupe").hide();
165 cj("#contact-dedupe").show();
166 cj("#dedupe").empty();
168 cj("#dedupe").append("<option value=''>- {/literal}{ts escape='js'}select{/ts}{literal} -</option>");
169 for ( var key in dedupe ) {
170 // stick these new options in the dedupe select
171 cj("#dedupe").append("<option value="+key+">"+dedupe[key]+" </option>");