Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | {* |
2 | +--------------------------------------------------------------------+ | |
2c4c49ca | 3 | | CiviCRM version 4.7 | |
6a488035 | 4 | +--------------------------------------------------------------------+ |
fa938177 | 5 | | Copyright CiviCRM LLC (c) 2004-2016 | |
6a488035 TO |
6 | +--------------------------------------------------------------------+ |
7 | | This file is a part of CiviCRM. | | |
8 | | | | |
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. | | |
12 | | | | |
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. | | |
17 | | | | |
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 | +--------------------------------------------------------------------+ | |
25 | *} | |
26 | <div class="crm-block crm-form-block crm-import-preview-form-block"> | |
27 | ||
28 | {literal} | |
29 | <script type="text/javascript"> | |
30 | function setIntermediate( ) { | |
31 | var dataUrl = "{/literal}{$statusUrl}{literal}"; | |
32 | cj.getJSON( dataUrl, function( response ) { | |
33 | ||
34 | var dataStr = response.toString(); | |
35 | var result = dataStr.split(","); | |
36 | cj("#intermediate").html( result[1] ); | |
37 | if( result[0] < 100 ){ | |
38 | cj("#importProgressBar .ui-progressbar-value").animate({width: result[0]+"%"}, 500); | |
39 | cj("#status").text( result[0]+"% Completed"); | |
40 | } | |
41 | }); | |
42 | } | |
43 | ||
44 | function pollLoop( ){ | |
45 | setIntermediate( ); | |
46 | window.setTimeout( pollLoop, 10*1000 ); // 10 sec | |
47 | } | |
48 | ||
49 | function verify( ) { | |
ee288924 | 50 | if (! confirm('Backing up your database before importing is recommended, as there is no Undo for this. {/literal}{ts escape='js'}Are you sure you want to Import now{/ts}{literal}?') ) { |
6a488035 TO |
51 | return false; |
52 | } | |
53 | ||
54 | cj("#id-processing").show( ).dialog({ | |
55 | modal : true, | |
56 | width : 350, | |
57 | height : 160, | |
58 | resizable : false, | |
6a488035 TO |
59 | draggable : true, |
60 | closeOnEscape : false, | |
6a488035 TO |
61 | open : function ( ) { |
62 | cj("#id-processing").dialog().parents(".ui-dialog").find(".ui-dialog-titlebar").remove(); | |
63 | } | |
64 | }); | |
65 | cj("#importProgressBar" ).progressbar({value:0}); | |
66 | cj("#importProgressBar").show( ); | |
67 | pollLoop( ); | |
68 | } | |
69 | </script> | |
70 | {/literal} | |
71 | ||
72 | {* Import Wizard - Step 3 (preview import results prior to actual data loading) *} | |
73 | {* @var $form Contains the array for the form elements and other form associated information assigned to the template by the controller *} | |
74 | ||
75 | {* WizardHeader.tpl provides visual display of steps thru the wizard as well as title for current step *} | |
76 | {include file="CRM/common/WizardHeader.tpl"} | |
f6eedce7 | 77 | <div class="help"> |
6a488035 TO |
78 | <p> |
79 | {ts}The information below previews the results of importing your data in CiviCRM. Review the totals to ensure that they represent your expected results.{/ts} | |
80 | </p> | |
81 | ||
82 | {if $invalidRowCount} | |
83 | <p class="error"> | |
84 | {ts 1=$invalidRowCount 2=$downloadErrorRecordsUrl}CiviCRM has detected invalid data or formatting errors in %1 records. If you continue, these records will be skipped. OR, you can download a file with just these problem records - <a href='%2'>Download Errors</a>. Then correct them in the original import file, cancel this import and begin again at step 1.{/ts} | |
85 | </p> | |
86 | {/if} | |
87 | ||
88 | {if $conflictRowCount} | |
89 | <p class="error"> | |
90 | {ts 1=$conflictRowCount 2=$downloadConflictRecordsUrl}CiviCRM has detected %1 records with conflicting email addresses within this data file. If you continue, these records will be skipped. OR, you can download a file with just these problem records - <a href='%2'>Download Conflicts</a>. Then correct them in the original import file, cancel this import and begin again at step 1.{/ts} | |
91 | </p> | |
92 | {/if} | |
93 | ||
94 | <p>{ts}Click 'Import Now' if you are ready to proceed.{/ts}</p> | |
95 | </div> | |
96 | <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div> | |
97 | {* Import Progress Bar and Info *} | |
98 | <div id="id-processing" class="hiddenElement"> | |
99 | <h3>Importing records...</h3><br /> | |
100 | <div id="status" style="margin-left:6px;"></div> | |
101 | <div class="progressBar" id="importProgressBar" style="margin-left:6px;display:none;"></div> | |
102 | <div id="intermediate"></div> | |
103 | <div id="error_status"></div> | |
104 | </div> | |
105 | ||
106 | <div id="preview-info"> | |
107 | {* Summary Preview (record counts) *} | |
108 | <table id="preview-counts" class="report"> | |
109 | <tr><td class="label">{ts}Total Rows{/ts}</td> | |
110 | <td class="data">{$totalRowCount}</td> | |
111 | <td class="explanation">{ts}Total number of rows in the imported data.{/ts}</td> | |
112 | </tr> | |
113 | ||
114 | {if $invalidRowCount} | |
115 | <tr class="error"><td class="label">{ts}Rows with Errors{/ts}</td> | |
116 | <td class="data">{$invalidRowCount}</td> | |
117 | <td class="explanation">{ts}Rows with invalid data in one or more fields (for example, invalid email address formatting). These rows will be skipped (not imported).{/ts} | |
118 | {if $invalidRowCount} | |
119 | <div class="action-link"><a href="{$downloadErrorRecordsUrl}">» {ts}Download Errors{/ts}</a></div> | |
120 | {/if} | |
121 | </td> | |
122 | </tr> | |
123 | {/if} | |
124 | ||
125 | {if $conflictRowCount} | |
126 | <tr class="error"><td class="label">{ts}Conflicting Rows{/ts}</td> | |
127 | <td class="data">{$conflictRowCount}</td> | |
128 | <td class="explanation">{ts}Rows with conflicting email addresses within this file. These rows will be skipped (not imported).{/ts} | |
129 | {if $conflictRowCount} | |
130 | <div class="action-link"><a href="{$downloadConflictRecordsUrl}">» {ts}Download Conflicts{/ts}</a></div> | |
131 | {/if} | |
132 | </td> | |
133 | </tr> | |
134 | {/if} | |
135 | ||
136 | <tr> | |
137 | <td class="label">{ts}Valid Rows{/ts}</td> | |
138 | <td class="data">{$validRowCount}</td> | |
139 | <td class="explanation">{ts}Total rows to be imported.{/ts}</td> | |
140 | </tr> | |
141 | </table> | |
142 | ||
143 | {* Table for mapping preview *} | |
719a6fec | 144 | {include file="CRM/Contact/Import/Form/MapTable.tpl"} |
6a488035 TO |
145 | |
146 | {* Group options *} | |
147 | {* New Group *} | |
148 | <div id="new-group" class="crm-accordion-wrapper collapsed"> | |
149 | <div class="crm-accordion-header"> | |
150 | {ts}Add imported records to a new group{/ts} | |
151 | </div><!-- /.crm-accordion-header --> | |
152 | <div class="crm-accordion-body"> | |
153 | <table class="form-layout-compressed"> | |
154 | <tr> | |
155 | <td class="description label">{$form.newGroupName.label}</td> | |
156 | <td>{$form.newGroupName.html}</td> | |
157 | </tr> | |
158 | <tr> | |
159 | <td class="description label">{$form.newGroupDesc.label}</td> | |
160 | <td>{$form.newGroupDesc.html}</td> | |
161 | </tr> | |
162 | </table> | |
163 | </div><!-- /.crm-accordion-body --> | |
164 | </div><!-- /.crm-accordion-wrapper --> | |
165 | ||
166 | ||
167 | {* Existing Group *} | |
168 | ||
169 | <div id="existing-groups" class="crm-accordion-wrapper crm-existing_group-accordion {if $form.groups} {else}collapsed{/if}"> | |
170 | <div class="crm-accordion-header"> | |
171 | {$form.groups.label} | |
172 | </div><!-- /.crm-accordion-header --> | |
173 | <div class="crm-accordion-body"> | |
174 | ||
175 | <div class="form-item"> | |
176 | <table><tr><td style="width: 14em;"></td><td>{$form.groups.html}</td></tr></table> | |
177 | </div> | |
178 | </div><!-- /.crm-accordion-body --> | |
179 | </div><!-- /.crm-accordion-wrapper --> | |
180 | ||
181 | {* Tag options *} | |
182 | {* New Tag *} | |
183 | <div id="new-tag" class="crm-accordion-wrapper collapsed"> | |
184 | <div class="crm-accordion-header"> | |
185 | {ts}Create a new tag and assign it to imported records{/ts} | |
186 | </div><!-- /.crm-accordion-header --> | |
187 | <div class="crm-accordion-body"> | |
188 | ||
189 | <div class="form-item"> | |
190 | <table class="form-layout-compressed"> | |
191 | <tr> | |
192 | <td class="description label">{$form.newTagName.label}</td> | |
193 | <td>{$form.newTagName.html}</td> | |
194 | </tr> | |
195 | <tr> | |
196 | <td class="description label">{$form.newTagDesc.label}</td> | |
197 | <td>{$form.newTagDesc.html}</td> | |
198 | </tr> | |
199 | </table> | |
200 | </div> | |
201 | </div><!-- /.crm-accordion-body --> | |
202 | </div><!-- /.crm-accordion-wrapper --> | |
203 | {* Existing Tag Imported Contact *} | |
204 | ||
205 | <div id="existing-tags" class="crm-accordion-wrapper collapsed"> | |
206 | <div class="crm-accordion-header"> | |
207 | {ts}Tag imported records{/ts} | |
208 | </div><!-- /.crm-accordion-header --> | |
209 | <div class="crm-accordion-body"> | |
210 | ||
211 | <table class="form-layout-compressed"> | |
212 | <tr><td style="width: 14em;"></td> | |
213 | <td class="listing-box" style="margin-bottom: 0em; width: 15em;"> | |
214 | {foreach from=$form.tag item="tag_val"} | |
215 | <div>{$tag_val.html}</div> | |
216 | {/foreach} | |
217 | </td> | |
218 | </tr> | |
219 | </table> | |
220 | </div><!-- /.crm-accordion-body --> | |
221 | </div><!-- /.crm-accordion-wrapper --> | |
222 | </div> {* End of preview-info div. We hide this on form submit. *} | |
223 | ||
224 | <div class="crm-submit-buttons"> | |
225 | {include file="CRM/common/formButtons.tpl" location="bottom"} | |
226 | </div> | |
227 | </div> | |
228 | ||
229 | {literal} | |
230 | <script type="text/javascript"> | |
6a488035 TO |
231 | |
232 | {/literal}{if $invalidGroupName}{literal} | |
233 | cj("#new-group.collapsed").crmAccordionToggle(); | |
234 | {/literal}{/if}{literal} | |
235 | ||
236 | {/literal}{if $invalidTagName}{literal} | |
237 | cj("#new-tag.collapsed").crmAccordionToggle(); | |
238 | {/literal}{/if}{literal} | |
239 | ||
240 | </script> | |
241 | {/literal} |