]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Import/tpls/step3.tpl
Release 6.1.5
[Github/sugarcrm.git] / modules / Import / tpls / step3.tpl
1 {*
2
3 /*********************************************************************************
4  * SugarCRM is a customer relationship management program developed by
5  * SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
6  * 
7  * This program is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU Affero General Public License version 3 as published by the
9  * Free Software Foundation with the addition of the following permission added
10  * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
11  * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
12  * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
13  * 
14  * This program is distributed in the hope that it will be useful, but WITHOUT
15  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
17  * details.
18  * 
19  * You should have received a copy of the GNU Affero General Public License along with
20  * this program; if not, see http://www.gnu.org/licenses or write to the Free
21  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22  * 02110-1301 USA.
23  * 
24  * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
25  * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
26  * 
27  * The interactive user interfaces in modified source and object code versions
28  * of this program must display Appropriate Legal Notices, as required under
29  * Section 5 of the GNU Affero General Public License version 3.
30  * 
31  * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
32  * these Appropriate Legal Notices must retain the display of the "Powered by
33  * SugarCRM" logo. If the display of the logo is not reasonably feasible for
34  * technical reasons, the Appropriate Legal Notices must display the words
35  * "Powered by SugarCRM".
36  ********************************************************************************/
37
38
39
40
41 *}
42 {literal}
43 <style>
44 <!--
45 textarea { width: 20em }
46 -->
47 </style>
48 {/literal}
49 <script type="text/javascript" src="{sugar_getjspath file='include/javascript/sugar_grp_yui_widgets.js'}"></script>
50 {overlib_includes}
51 {$MODULE_TITLE}
52 <form enctype="multipart/form-data" real_id="importstep3" id="importstep3" name="importstep3" method="POST" action="index.php">
53 <input type="hidden" name="module" value="Import">
54 <input type="hidden" name="custom_delimiter" value="{$CUSTOM_DELIMITER}">
55 <input type="hidden" name="custom_enclosure" value="{$CUSTOM_ENCLOSURE}">
56 <input type="hidden" name="import_type" value="{$TYPE}">
57 <input type="hidden" name="source" value="{$SOURCE}">
58 <input type="hidden" name="source_id" value="{$SOURCE_ID}">
59 <input type="hidden" name="action" value="Step3">
60 <input type="hidden" name="import_module" value="{$IMPORT_MODULE}">
61 <input type="hidden" name="to_pdf" value="1">
62 <input type="hidden" name="has_header" value="{$HAS_HEADER}">
63 <input type="hidden" name="tmp_file" value="{$TMP_FILE}">
64 <input type="hidden" name="tmp_file_base" value="{$TMP_FILE}">
65 <input type="hidden" name="firstrow" value="{$FIRSTROW}">
66 <input type="hidden" name="columncount" value ="{$COLUMNCOUNT}">
67 <input type="hidden" name="display_tabs_def">
68
69 <div align="right">
70     <span class="required" align="right">{$APP.LBL_REQUIRED_SYMBOL}</span> {$APP.NTC_REQUIRED}
71 </div>
72
73 <p>
74 {$MOD.LBL_SELECT_FIELDS_TO_MAP}
75 </p>
76 <br />
77 <table border="0" cellpadding="0" width="100%" id="importTable" class="detail view">
78 {foreach from=$rows key=key item=item name=rows}
79 {if $smarty.foreach.rows.first}
80 <tr>
81     <td style="text-align: left;" scope="row">
82         <b>{$MOD.LBL_DATABASE_FIELD}</b>&nbsp;
83         {sugar_help text=$MOD.LBL_DATABASE_FIELD_HELP}
84     </td>
85     {if $HAS_HEADER == 'on'}
86     <td style="text-align: left;" scope="row">
87         <b>{$MOD.LBL_HEADER_ROW}</b>&nbsp;
88         {sugar_help text=$MOD.LBL_HEADER_ROW_HELP}
89     </td>
90     {/if}
91     <td style="text-align: left;" scope="row">
92         <b>{$MOD.LBL_DEFAULT_VALUE}</b>&nbsp;
93         {sugar_help text=$MOD.LBL_DEFAULT_VALUE_HELP}
94     </td>
95     <td style="text-align: left;" scope="row">
96         <b>{$MOD.LBL_ROW} 1</b>&nbsp;
97         {sugar_help text=$MOD.LBL_ROW_HELP}
98     </td>
99     {if $HAS_HEADER != 'on'}
100     <td style="text-align: left;"><b>{$MOD.LBL_ROW} 2</b></td>
101     {/if}
102 </tr>
103 {/if}
104 <tr>
105     <td valign="top" align="left" id="row_{$smarty.foreach.rows.index}_col_0">
106         <select class='fixedwidth' name="colnum_{$smarty.foreach.rows.index}">
107             <option value="-1">{$MOD.LBL_DONT_MAP}</option>
108             {$item.field_choices}
109         </select>
110     </td>
111     {if $HAS_HEADER == 'on'}
112     <td id="row_{$smarty.foreach.rows.index}_header">{$item.cell1}</td>
113     {/if}
114     <td id="defaultvaluepicker_{$smarty.foreach.rows.index}" nowrap="nowrap">
115         {$item.default_field}
116     </td>
117     {if $item.show_remove}
118     <td colspan="2">
119         <input title="{$MOD.LBL_REMOVE_ROW}" accessKey=""
120             id="deleterow_{$smarty.foreach.rows.index}" class="button" type="button"
121             value="  {$MOD.LBL_REMOVE_ROW}  ">
122     </td>
123     {else}
124     {if $HAS_HEADER != 'on'}
125     <td id="row_{$smarty.foreach.rows.index}_col_1" scope="row">{$item.cell1}</td>
126     {/if}
127     <td id="row_{$smarty.foreach.rows.index}_col_2" scope="row">{$item.cell2}</td>
128     {/if}
129 </tr>
130 {/foreach}
131 <tr>
132     <td align="left" colspan="4" style="background: transparent;">
133         <input title="{$MOD.LBL_ADD_ROW}" accessKey="" id="addrow" class="button" type="button"
134             name="button" value="  {$MOD.LBL_ADD_ROW}  ">
135         <input title="{$MOD.LBL_SHOW_ADVANCED_OPTIONS}" accessKey="" id="toggleImportOptions" class="button" type="button"
136             name="button" value="  {$MOD.LBL_SHOW_ADVANCED_OPTIONS}  ">
137         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
138         <span scope="row"><strong>{$MOD.LBL_SAVE_MAPPING_AS}</strong></span>
139         <span >
140             <input type="text" name="save_map_as" id="save_map_as" value=""
141                 style="width: 20em" maxlength="254">
142             &nbsp;{sugar_help text=$MOD.LBL_SAVE_MAPPING_HELP}
143         </span>
144     </td>
145 </tr>
146 <tr style="display: none;" id="importOptions">
147     <td valign="middle" colspan="4">
148         <table border="0" width="100%">
149         <tr>
150             <td valign="top" width="50%">
151                 <div>
152                     <h4>{$MOD.LBL_IMPORT_FILE_SETTINGS}&nbsp;{sugar_help text=$MOD.LBL_IMPORT_FILE_SETTINGS_HELP}</h4>
153                     <table border=0 class="edit view">
154                     <tr>
155                         <td scope="row"><slot>{$MOD.LBL_CHARSET}</slot></td>
156                         <td ><slot><select tabindex='4' name='importlocale_charset'>{$CHARSETOPTIONS}</select></slot></td>
157                     </tr>
158                     <tr>
159                         <td scope="row"><slot>{$MOD.LBL_DATE_FORMAT}</slot></td>
160                         <td ><slot><select tabindex='4' name='importlocale_dateformat'>{$DATEOPTIONS}</select></slot></td>
161                     </tr>
162                     <tr>
163                         <td scope="row"><slot>{$MOD.LBL_TIME_FORMAT}</slot></td>
164                         <td ><slot><select tabindex='4' name='importlocale_timeformat'>{$TIMEOPTIONS}</select></slot></td>
165                     </tr>
166                     <tr>
167                         <td scope="row"><slot>{$MOD.LBL_TIMEZONE}</slot></td>
168                         <td ><slot><select tabindex='4' name='importlocale_timezone'>{$TIMEZONEOPTIONS}</select></slot></td>
169                     </tr>
170                     <tr>
171                         <td scope="row"><slot>{$MOD.LBL_CURRENCY}</slot></td>
172                         <td ><slot>
173                             <select tabindex='4' id='currency_select' name='importlocale_currency' onchange='setSymbolValue(this.selectedIndex);setSigDigits();'>{$CURRENCY}</select>
174                             <input type="hidden" id="symbol" value="">
175                         </slot></td>
176                     </tr>
177                     <tr>
178                         <td scope="row"><slot>
179                             {$MOD.LBL_CURRENCY_SIG_DIGITS}:
180                         </slot></td>
181                         <td ><slot>
182                             <select id='sigDigits' onchange='setSigDigits(this.value);' name='importlocale_default_currency_significant_digits'>{$sigDigits}</select>
183                         </slot></td>
184                     </tr>
185                     <tr>
186                         <td scope="row"><slot>
187                             <i>{$MOD.LBL_LOCALE_EXAMPLE_NAME_FORMAT}</i>:
188                         </slot></td>
189                         <td ><slot>
190                             <input type="text" disabled id="sigDigitsExample" name="sigDigitsExample">
191                         </slot></td>
192                     </tr>
193                     <tr>
194                         <td scope="row"><slot>{$MOD.LBL_NUMBER_GROUPING_SEP}</slot></td>
195                         <td ><slot>
196                             <input tabindex='4' name='importlocale_num_grp_sep' id='default_number_grouping_seperator'
197                                 type='text' maxlength='1' size='1' value='{$NUM_GRP_SEP}'
198                                 onkeydown='setSigDigits();' onkeyup='setSigDigits();'>
199                         </slot></td>
200                     </tr>
201                     <tr>
202                         <td scope="row"><slot>{$MOD.LBL_DECIMAL_SEP}</slot></td>
203                         <td ><slot>
204                             <input tabindex='4' name='importlocale_dec_sep' id='default_decimal_seperator'
205                                 type='text' maxlength='1' size='1' value='{$DEC_SEP}'
206                                 onkeydown='setSigDigits();' onkeyup='setSigDigits();'>
207                         </slot></td>
208                     </tr>
209                     <tr>
210                         <td scope="row" valign="top">{$MOD.LBL_LOCALE_DEFAULT_NAME_FORMAT}: </td>
211                         <td  valign="top">
212                             <input onkeyup="setPreview();" onkeydown="setPreview();" id="default_locale_name_format" type="text" tabindex='4' name="importlocale_default_locale_name_format" value="{$default_locale_name_format}">
213                            <br />{$MOD.LBL_LOCALE_NAME_FORMAT_DESC}
214                         </td>
215                     </tr>
216                     <tr>
217                         <td scope="row" valign="top"><i>{$MOD.LBL_LOCALE_EXAMPLE_NAME_FORMAT}:</i> </td>
218                         <td  valign="top"><input tabindex='4' id="nameTarget" name="no_value" id=":q" value="" style="border: none;" disabled size="50"></td>
219                     </tr>
220                     </table>
221                 </div>
222             </td>
223             <td valign="top" width="50%">
224                 <div>
225                     <h4>{$MOD.LBL_VERIFY_DUPS}&nbsp;{sugar_help text=$MOD.LBL_VERIFY_DUPLCATES_HELP}</h4>
226                     {$TAB_CHOOSER}
227                 </div>
228             </td>
229         </tr>
230         </table>
231     </td>
232 </tr>
233 </table>
234 {$JAVASCRIPT_CHOOSER}
235
236 {if $NOTETEXT != '' || $required_fields != ''}
237 <p>
238 <b>{$MOD.LBL_NOTES}</b>
239 <ul>
240 <li>{$MOD.LBL_REQUIRED_NOTE}{$required_fields}</li>
241 {$NOTETEXT}
242 </ul>
243 </p>
244 {/if}
245
246 <br />
247 <table width="100%" cellpadding="2" cellspacing="0" border="0">
248 <tr>
249     <td align="left">
250         <input title="{$MOD.LBL_BACK}" accessKey="" id="goback" class="button" type="submit" name="button" value="  {$MOD.LBL_BACK}  ">&nbsp;
251         <input title="{$MOD.LBL_IMPORT_NOW}" accessKey="" id="importnow" class="button" type="button" name="button" value="  {$MOD.LBL_IMPORT_NOW}  ">
252     </td>
253 </tr>
254 </table>
255
256 </form>
257 {literal}
258 <script type="text/javascript">
259 <!--
260 /**
261  * Singleton to handle processing the import
262  */
263 ProcessImport = new function()
264 {
265     /*
266      * number of file to process processed
267      */
268     this.fileCount         = 0;
269
270     /*
271      * total files to processs
272      */
273     this.fileTotal         = {/literal}{$FILECOUNT-1}{literal};
274
275     /*
276      * total records to process
277      */
278     this.recordCount       = {/literal}{$RECORDCOUNT}{literal};
279
280     /*
281      * maximum number of records per file
282      */
283     this.recordThreshold   = {/literal}{$RECORDTHRESHOLD}{literal};
284
285     /*
286      * submits the form
287      */
288     this.submit = function()
289     {
290         document.getElementById("importstep3").tmp_file.value =
291             document.getElementById("importstep3").tmp_file_base.value + '-' + this.fileCount;
292         YAHOO.util.Connect.setForm(document.getElementById("importstep3"));
293         YAHOO.util.Connect.asyncRequest('POST', 'index.php',
294             {
295                 success: function(o) {
296                     if (o.responseText.replace(/^\s+|\s+$/g, '') != '') {
297                         this.failure(o);
298                     }
299                     else {
300                         var locationStr = "index.php?module=Import"
301                             + "&action=Last"
302                             + "&type={/literal}{$TYPE}{literal}"
303                             + "&import_module={/literal}{$IMPORT_MODULE}{literal}";
304                         if ( ProcessImport.fileCount >= ProcessImport.fileTotal ) {
305                                 YAHOO.SUGAR.MessageBox.updateProgress(1,'{/literal}{$MOD.LBL_IMPORT_COMPLETE}{literal}');
306                                 SUGAR.util.hrefURL(locationStr);
307                         }
308                         else {
309                             document.getElementById("importstep3").save_map_as.value = '';
310                             ProcessImport.fileCount++;
311                             ProcessImport.submit();
312                         }
313                     }
314                 },
315                 failure: function(o) {
316                         YAHOO.SUGAR.MessageBox.minWidth = 500;
317                         YAHOO.SUGAR.MessageBox.show({
318                         type:  "alert",
319                         title: '{/literal}{$MOD.LBL_IMPORT_ERROR}{literal}',
320                         msg:   o.responseText,
321                         fn: function() { window.location.reload(true); }
322                     });
323                 }
324             }
325         );
326         var move = 0;
327         if ( this.fileTotal > 0 ) {
328             move = this.fileCount/this.fileTotal;
329         }
330         YAHOO.SUGAR.MessageBox.updateProgress( move,
331             "{/literal}{$MOD.LBL_IMPORT_RECORDS}{literal} " + ((this.fileCount * this.recordThreshold) + 1)
332                         + " {/literal}{$MOD.LBL_IMPORT_RECORDS_TO}{literal} " + Math.min(((this.fileCount+1) * this.recordThreshold),this.recordCount)
333                         + " {/literal}{$MOD.LBL_IMPORT_RECORDS_OF}{literal} " + this.recordCount );
334     }
335
336     /*
337      * begins the form submission process
338      */
339     this.begin = function()
340     {
341         datestarted = '{/literal}{$MOD.LBL_IMPORT_STARTED}{literal} ' +
342                 YAHOO.util.Date.format('{/literal}{$datetimeformat}{literal}');
343         YAHOO.SUGAR.MessageBox.show({
344             title: '{/literal}{$STEP4_TITLE}{literal}',
345             msg: datestarted,
346             width: 500,
347             type: "progress",
348             closable:false,
349             animEl: 'importnow'
350         });
351         this.submit();
352     }
353 }
354 -->
355 </script>
356 {/literal}
357 {$JAVASCRIPT}
358 {literal}
359 <script type="text/javascript" language="Javascript">
360 enableQS(false);
361 {/literal}{$getNameJs}{literal}
362 {/literal}{$getNumberJs}{literal}
363 {/literal}{$currencySymbolJs}{literal}
364         setSymbolValue(document.getElementById('currency_select').selectedIndex);
365         setSigDigits();
366
367 {/literal}{$confirmReassignJs}{literal}
368 </script>
369 {/literal}