Merge pull request #8066 from totten/master-alter-menu-rb
[civicrm-core.git] / templates / CRM / Contact / Import / Form / Preview.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.7 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2016 |
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( ) {
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}?') ) {
51 return false;
52 }
53
54 cj("#id-processing").show( ).dialog({
55 modal : true,
56 width : 350,
57 height : 160,
58 resizable : false,
59 draggable : true,
60 closeOnEscape : false,
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"}
77 <div class="help">
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}">&raquo; {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}">&raquo; {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 *}
144 {include file="CRM/Contact/Import/Form/MapTable.tpl"}
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 <tr>
163 <td class="description label">{$form.newGroupType.label}</td>
164 <td>{$form.newGroupType.html}</td>
165 </tr>
166 </table>
167 </div><!-- /.crm-accordion-body -->
168 </div><!-- /.crm-accordion-wrapper -->
169
170
171 {* Existing Group *}
172
173 <div id="existing-groups" class="crm-accordion-wrapper crm-existing_group-accordion {if $form.groups} {else}collapsed{/if}">
174 <div class="crm-accordion-header">
175 {$form.groups.label}
176 </div><!-- /.crm-accordion-header -->
177 <div class="crm-accordion-body">
178
179 <div class="form-item">
180 <table><tr><td style="width: 14em;"></td><td>{$form.groups.html}</td></tr></table>
181 </div>
182 </div><!-- /.crm-accordion-body -->
183 </div><!-- /.crm-accordion-wrapper -->
184
185 {* Tag options *}
186 {* New Tag *}
187 <div id="new-tag" class="crm-accordion-wrapper collapsed">
188 <div class="crm-accordion-header">
189 {ts}Create a new tag and assign it to imported records{/ts}
190 </div><!-- /.crm-accordion-header -->
191 <div class="crm-accordion-body">
192
193 <div class="form-item">
194 <table class="form-layout-compressed">
195 <tr>
196 <td class="description label">{$form.newTagName.label}</td>
197 <td>{$form.newTagName.html}</td>
198 </tr>
199 <tr>
200 <td class="description label">{$form.newTagDesc.label}</td>
201 <td>{$form.newTagDesc.html}</td>
202 </tr>
203 </table>
204 </div>
205 </div><!-- /.crm-accordion-body -->
206 </div><!-- /.crm-accordion-wrapper -->
207 {* Existing Tag Imported Contact *}
208
209 <div id="existing-tags" class="crm-accordion-wrapper collapsed">
210 <div class="crm-accordion-header">
211 {ts}Tag imported records{/ts}
212 </div><!-- /.crm-accordion-header -->
213 <div class="crm-accordion-body">
214
215 <table class="form-layout-compressed">
216 <tr><td style="width: 14em;"></td>
217 <td class="listing-box" style="margin-bottom: 0em; width: 15em;">
218 {foreach from=$form.tag item="tag_val"}
219 <div>{$tag_val.html}</div>
220 {/foreach}
221 </td>
222 </tr>
223 </table>
224 </div><!-- /.crm-accordion-body -->
225 </div><!-- /.crm-accordion-wrapper -->
226 </div> {* End of preview-info div. We hide this on form submit. *}
227
228 <div class="crm-submit-buttons">
229 {include file="CRM/common/formButtons.tpl" location="bottom"}
230 </div>
231 </div>
232
233 {literal}
234 <script type="text/javascript">
235
236 {/literal}{if $invalidGroupName}{literal}
237 cj("#new-group.collapsed").crmAccordionToggle();
238 {/literal}{/if}{literal}
239
240 {/literal}{if $invalidTagName}{literal}
241 cj("#new-tag.collapsed").crmAccordionToggle();
242 {/literal}{/if}{literal}
243
244 </script>
245 {/literal}