manually merged work on CRM-10592, #527
[civicrm-core.git] / templates / CRM / Import / Form / Preview.tpl
CommitLineData
6a488035
TO
1{*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.3 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2013 |
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">
30function 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
44function pollLoop( ){
45 setIntermediate( );
46 window.setTimeout( pollLoop, 10*1000 ); // 10 sec
47}
48
49function verify( ) {
50 if (! confirm('{/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 bgiframe : true,
60 draggable : true,
61 closeOnEscape : false,
62 overlay : { opacity: 0.5, background: "black" },
63 open : function ( ) {
64 cj("#id-processing").dialog().parents(".ui-dialog").find(".ui-dialog-titlebar").remove();
65 }
66 });
67 cj("#importProgressBar" ).progressbar({value:0});
68 cj("#importProgressBar").show( );
69 pollLoop( );
70}
71</script>
72{/literal}
73
74{* Import Wizard - Step 3 (preview import results prior to actual data loading) *}
75{* @var $form Contains the array for the form elements and other form associated information assigned to the template by the controller *}
76
77 {* WizardHeader.tpl provides visual display of steps thru the wizard as well as title for current step *}
78 {include file="CRM/common/WizardHeader.tpl"}
79<div id="help">
80 <p>
81 {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}
82 </p>
83
84 {if $invalidRowCount}
85 <p class="error">
86 {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}
87 </p>
88 {/if}
89
90 {if $conflictRowCount}
91 <p class="error">
92 {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}
93 </p>
94 {/if}
95
96 <p>{ts}Click 'Import Now' if you are ready to proceed.{/ts}</p>
97</div>
98<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
99{* Import Progress Bar and Info *}
100<div id="id-processing" class="hiddenElement">
101 <h3>Importing records...</h3><br />
102 <div id="status" style="margin-left:6px;"></div>
103 <div class="progressBar" id="importProgressBar" style="margin-left:6px;display:none;"></div>
104 <div id="intermediate"></div>
105 <div id="error_status"></div>
106</div>
107
108<div id="preview-info">
109 {* Summary Preview (record counts) *}
110 <table id="preview-counts" class="report">
111 <tr><td class="label">{ts}Total Rows{/ts}</td>
112 <td class="data">{$totalRowCount}</td>
113 <td class="explanation">{ts}Total number of rows in the imported data.{/ts}</td>
114 </tr>
115
116 {if $invalidRowCount}
117 <tr class="error"><td class="label">{ts}Rows with Errors{/ts}</td>
118 <td class="data">{$invalidRowCount}</td>
119 <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}
120 {if $invalidRowCount}
121 <div class="action-link"><a href="{$downloadErrorRecordsUrl}">&raquo; {ts}Download Errors{/ts}</a></div>
122 {/if}
123 </td>
124 </tr>
125 {/if}
126
127 {if $conflictRowCount}
128 <tr class="error"><td class="label">{ts}Conflicting Rows{/ts}</td>
129 <td class="data">{$conflictRowCount}</td>
130 <td class="explanation">{ts}Rows with conflicting email addresses within this file. These rows will be skipped (not imported).{/ts}
131 {if $conflictRowCount}
132 <div class="action-link"><a href="{$downloadConflictRecordsUrl}">&raquo; {ts}Download Conflicts{/ts}</a></div>
133 {/if}
134 </td>
135 </tr>
136 {/if}
137
138 <tr>
139 <td class="label">{ts}Valid Rows{/ts}</td>
140 <td class="data">{$validRowCount}</td>
141 <td class="explanation">{ts}Total rows to be imported.{/ts}</td>
142 </tr>
143 </table>
144
145 {* Table for mapping preview *}
146 {include file="CRM/Import/Form/MapTable.tpl"}
147
148 {* Group options *}
149 {* New Group *}
150<div id="new-group" class="crm-accordion-wrapper collapsed">
151 <div class="crm-accordion-header">
152 {ts}Add imported records to a new group{/ts}
153 </div><!-- /.crm-accordion-header -->
154 <div class="crm-accordion-body">
155 <table class="form-layout-compressed">
156 <tr>
157 <td class="description label">{$form.newGroupName.label}</td>
158 <td>{$form.newGroupName.html}</td>
159 </tr>
160 <tr>
161 <td class="description label">{$form.newGroupDesc.label}</td>
162 <td>{$form.newGroupDesc.html}</td>
163 </tr>
164 </table>
165 </div><!-- /.crm-accordion-body -->
166</div><!-- /.crm-accordion-wrapper -->
167
168
169 {* Existing Group *}
170
171<div id="existing-groups" class="crm-accordion-wrapper crm-existing_group-accordion {if $form.groups} {else}collapsed{/if}">
172 <div class="crm-accordion-header">
173 {$form.groups.label}
174 </div><!-- /.crm-accordion-header -->
175 <div class="crm-accordion-body">
176
177 <div class="form-item">
178 <table><tr><td style="width: 14em;"></td><td>{$form.groups.html}</td></tr></table>
179 </div>
180 </div><!-- /.crm-accordion-body -->
181</div><!-- /.crm-accordion-wrapper -->
182
183 {* Tag options *}
184 {* New Tag *}
185<div id="new-tag" class="crm-accordion-wrapper collapsed">
186 <div class="crm-accordion-header">
187 {ts}Create a new tag and assign it to imported records{/ts}
188 </div><!-- /.crm-accordion-header -->
189 <div class="crm-accordion-body">
190
191 <div class="form-item">
192 <table class="form-layout-compressed">
193 <tr>
194 <td class="description label">{$form.newTagName.label}</td>
195 <td>{$form.newTagName.html}</td>
196 </tr>
197 <tr>
198 <td class="description label">{$form.newTagDesc.label}</td>
199 <td>{$form.newTagDesc.html}</td>
200 </tr>
201 </table>
202 </div>
203 </div><!-- /.crm-accordion-body -->
204</div><!-- /.crm-accordion-wrapper -->
205 {* Existing Tag Imported Contact *}
206
207<div id="existing-tags" class="crm-accordion-wrapper collapsed">
208 <div class="crm-accordion-header">
209 {ts}Tag imported records{/ts}
210</div><!-- /.crm-accordion-header -->
211 <div class="crm-accordion-body">
212
213 <table class="form-layout-compressed">
214 <tr><td style="width: 14em;"></td>
215 <td class="listing-box" style="margin-bottom: 0em; width: 15em;">
216 {foreach from=$form.tag item="tag_val"}
217 <div>{$tag_val.html}</div>
218 {/foreach}
219 </td>
220 </tr>
221 </table>
222 </div><!-- /.crm-accordion-body -->
223</div><!-- /.crm-accordion-wrapper -->
224</div> {* End of preview-info div. We hide this on form submit. *}
225
226<div class="crm-submit-buttons">
227 {include file="CRM/common/formButtons.tpl" location="bottom"}
228</div>
229</div>
230
231{literal}
232<script type="text/javascript">
233cj(function() {
234 cj().crmAccordions();
235});
236
237{/literal}{if $invalidGroupName}{literal}
238cj("#new-group.collapsed").crmAccordionToggle();
239{/literal}{/if}{literal}
240
241{/literal}{if $invalidTagName}{literal}
242cj("#new-tag.collapsed").crmAccordionToggle();
243{/literal}{/if}{literal}
244
245</script>
246{/literal}