// bootraping of import csv view
This commit is contained in:
1 parent
e5d03f4e7c
commit
12f3a150a7
2 files changed
+106
-80
No files matched your search
@@ -29,45 +29,44 @@
|
|||||||
{l s='Your .CSV file has been sucessfully imported into your shop. Don\'t forget to Re-build the products search index.'}
|
{l s='Your .CSV file has been sucessfully imported into your shop. Don\'t forget to Re-build the products search index.'}
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
<div style="display: none">
|
<div id="upload_file_import" style="display: none">
|
||||||
<div id="upload_file_import">
|
<div class="alert alert-info">{l s='Only UTF-8 and ISO-8859-1 encoding are allowed'}</div>
|
||||||
<div class="alert alert-info">{l s='Only UTF-8 and ISO-8859-1 encoding are allowed'}</div>
|
<form action="{$current}&token={$token}" method="post" enctype="multipart/form-data" class="form-horizontal">
|
||||||
<form action="{$current}&token={$token}" method="post" enctype="multipart/form-data" class="form-horizontal">
|
<div class="panel">
|
||||||
<div class="panel">
|
<div class="clearfix"> </div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-lg-3">{l s='Select your CSV file'}</label>
|
<label class="control-label col-lg-3">{l s='Select your CSV file'}</label>
|
||||||
<div class="col-lg-9">
|
<div class="col-lg-9">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-7">
|
<div class="col-lg-7">
|
||||||
<input id="file" type="file" name="file" class="hide" />
|
<input id="file" type="file" name="file" class="hide" />
|
||||||
<div class="dummyfile input-group">
|
<div class="dummyfile input-group">
|
||||||
<span class="input-group-addon"><i class="icon-file"></i></span>
|
<span class="input-group-addon"><i class="icon-file"></i></span>
|
||||||
<input id="file-name" type="text" class="disabled" name="filename" readonly />
|
<input id="file-name" type="text" class="disabled" name="filename" readonly />
|
||||||
<span class="input-group-btn">
|
<span class="input-group-btn">
|
||||||
<button id="file-selectbutton" type="button" name="submitAddAttachments" class="btn btn-default">
|
<button id="file-selectbutton" type="button" name="submitAddAttachments" class="btn btn-default">
|
||||||
<i class="icon-folder-open"></i> {l s='Choose a file'}
|
<i class="icon-folder-open"></i> {l s='Choose a file'}
|
||||||
</button>
|
</button>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-lg-7">
|
|
||||||
<p class="help-block">
|
|
||||||
{l s='You can also upload your file via FTP to the following directory:'} {$path_import}.
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="row">
|
||||||
<div class="form-group">
|
<div class="col-lg-7">
|
||||||
<div class="col-lg-9 col-lg-offset-3">
|
<p class="help-block">
|
||||||
<input type="submit" name="submitFileUpload" value="{l s='Upload'}" class="btn btn-default" />
|
{l s='You can also upload your file via FTP to the following directory:'} {$path_import}.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
<div class="form-group">
|
||||||
</div>
|
<div class="col-lg-9 col-lg-offset-3">
|
||||||
|
<button type="submit" name="submitFileUpload" class="btn btn-default"><i class="icon-upload"></i> {l s='Upload'}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{* Import fieldset *}
|
{* Import fieldset *}
|
||||||
@@ -93,6 +92,7 @@
|
|||||||
<option value="{$filename}"{if $csv_selected == $filename} selected="selected"{/if}>{$filename|escape:'htmlall':'UTF-8'}</option>
|
<option value="{$filename}"{if $csv_selected == $filename} selected="selected"{/if}>{$filename|escape:'htmlall':'UTF-8'}</option>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</select>
|
</select>
|
||||||
|
<div class="clearfix"> </div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<a href="#upload_file_import" id="upload_file_import_link" class="btn btn-default">
|
<a href="#upload_file_import" id="upload_file_import_link" class="btn btn-default">
|
||||||
@@ -132,10 +132,10 @@
|
|||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<ul id="csv_files_import" style="display:none;">
|
<ul id="csv_files_import" style="display:none;" class="list-group">
|
||||||
{foreach $files_to_import AS $filename}
|
{foreach $files_to_import AS $filename}
|
||||||
<li>
|
<li>
|
||||||
<a href="{$current}&token={$token}&csvfilename={$filename|@base64_encode}">{$filename}</a>
|
<a href="{$current}&token={$token}&csvfilename={$filename|@base64_encode}">{$filename}</a>
|
||||||
<a href="{$current}&token={$token}&csvfilename={$filename|@base64_encode}&delete=1" class="btn btn-default">
|
<a href="{$current}&token={$token}&csvfilename={$filename|@base64_encode}&delete=1" class="btn btn-default">
|
||||||
<i class="icon-trash"></i> {l s='Delete'}
|
<i class="icon-trash"></i> {l s='Delete'}
|
||||||
</a>
|
</a>
|
||||||
@@ -232,7 +232,7 @@
|
|||||||
<input type="submit" name="submitImportFile" id="submitImportFile" value="{l s='Next step'}" class="btn btn-default" {if empty($files_to_import)}disabled{/if}/>
|
<input type="submit" name="submitImportFile" id="submitImportFile" value="{l s='Next step'}" class="btn btn-default" {if empty($files_to_import)}disabled{/if}/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{if empty($files_to_import)}
|
{if empty($files_to_import)}
|
||||||
<div class="alert alert-info">{l s='You must upload a file in order to proceed to the next step'}</div>
|
<div class="alert alert-info">{l s='You must upload a file in order to proceed to the next step'}</div>
|
||||||
{/if}
|
{/if}
|
||||||
@@ -274,7 +274,11 @@
|
|||||||
$("a#upload_file_import_link").fancybox({
|
$("a#upload_file_import_link").fancybox({
|
||||||
'titleShow' : false,
|
'titleShow' : false,
|
||||||
'transitionIn' : 'elastic',
|
'transitionIn' : 'elastic',
|
||||||
'transitionOut' : 'elastic'
|
'transitionOut' : 'elastic',
|
||||||
|
'autoDimensions' : false,
|
||||||
|
'autoSize' : false,
|
||||||
|
'width' : 700,
|
||||||
|
'height' : 300
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#preview_import').submit(function(e){
|
$('#preview_import').submit(function(e){
|
||||||
|
|||||||
@@ -51,7 +51,7 @@
|
|||||||
var btn_submit_import = $('#import');
|
var btn_submit_import = $('#import');
|
||||||
if (btn_save_import.length > 0 && btn_submit_import.length > 0)
|
if (btn_save_import.length > 0 && btn_submit_import.length > 0)
|
||||||
{
|
{
|
||||||
btn_submit_import.hide();
|
btn_submit_import.closest('.form-group').hide();
|
||||||
btn_save_import.find('span').removeClass('process-icon-save-import');
|
btn_save_import.find('span').removeClass('process-icon-save-import');
|
||||||
btn_save_import.find('span').addClass('process-icon-save');
|
btn_save_import.find('span').addClass('process-icon-save');
|
||||||
btn_save_import.click(function(){
|
btn_save_import.click(function(){
|
||||||
@@ -62,31 +62,43 @@
|
|||||||
showTable(current);
|
showTable(current);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<div id="container-customer">
|
<div id="container-customer" class="panel">
|
||||||
<h2>{l s='View your data'}</h2>
|
<h3><i class="icon-list-alt"></i> {l s='View your data'}</h3>
|
||||||
<div>
|
<div class="form-horizontal">
|
||||||
<b>{l s='Save and load your configuration for importing files'} : </b><br/><br/>
|
<div class="form-group">
|
||||||
<input type="text" name="newImportMatchs" id="newImportMatchs" />
|
<label class="control-label col-lg-3">{l s='Save and load your configuration for importing files'} : </label>
|
||||||
<a id="saveImportMatchs" class="button" href="#">{l s='Save'}</a><br /><br />
|
<div class="col-lg-7">
|
||||||
<div id="selectDivImportMatchs" {if !$import_matchs}style="display:none"{/if}>
|
<input type="text" name="newImportMatchs" id="newImportMatchs" />
|
||||||
<select id="valueImportMatchs">
|
</div>
|
||||||
{foreach $import_matchs as $match}
|
<div class="col-lg-2">
|
||||||
<option id="{$match.id_import_match}" value="{$match.match}">{$match.name}</option>
|
<a id="saveImportMatchs" class="btn btn-default" href="#"><i class="icon-save"></i> {l s='Save'}</a>
|
||||||
{/foreach}
|
</div>
|
||||||
</select>
|
</div>
|
||||||
<a class="button" id="loadImportMatchs" href="#">{l s='Load'}</a>
|
<div class="form-group" {if !$import_matchs}style="display:none"{/if}>
|
||||||
<a class="button" id="deleteImportMatchs" href="#">{l s='Delete'}</a>
|
<label class="control-label col-lg-3">{l s='Matches'} : </label>
|
||||||
|
<div id="selectDivImportMatchs" class="col-lg-7">
|
||||||
|
<select id="valueImportMatchs">
|
||||||
|
{foreach $import_matchs as $match}
|
||||||
|
<option id="{$match.id_import_match}" value="{$match.match}">{$match.name}</option>
|
||||||
|
{/foreach}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-2">
|
||||||
|
<a id="loadImportMatchs" href="#" class="btn btn-default"><i class="icon-cogs"></i> {l s='Load'}</a>
|
||||||
|
<a id="deleteImportMatchs" href="#" class="btn btn-default"><i class="icon-remove"></i> {l s='Delete'}</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<h3>{l s='Please set the value type of each column'}</h3>
|
<div class="row">
|
||||||
<div id="error_duplicate_type" class="warning warn" style="display:none;">
|
<p>{l s='Please set the value type of each column'}</p>
|
||||||
<h3>{l s='Columns cannot have the same value type'}</h3>
|
|
||||||
</div>
|
</div>
|
||||||
<div id="required_column" class="warning warn" style="display:none;">
|
<div id="error_duplicate_type" class="alert alert-warning" style="display:none;">
|
||||||
<h3>{l s='Column'} <span id="missing_column"> </span> {l s='must be set'}</h3>
|
{l s='Columns cannot have the same value type'}
|
||||||
</div>
|
</div>
|
||||||
<form action="{$current}&token={$token}" method="post" id="import_form" name="import_form">
|
<div id="required_column" class="alert alert-warning" style="display:none;">
|
||||||
{l s='Skip'} <input type="text" size="2" name="skip" value="1" /> {l s='lines'}
|
{l s='Column'} <span id="missing_column"> </span> {l s='must be set'}
|
||||||
|
</div>
|
||||||
|
<form action="{$current}&token={$token}" method="post" id="import_form" name="import_form" class="form-horizontal">
|
||||||
<input type="hidden" name="csv" value="{$fields_value.csv}" />
|
<input type="hidden" name="csv" value="{$fields_value.csv}" />
|
||||||
<input type="hidden" name="convert" value="{$fields_value.convert}" />
|
<input type="hidden" name="convert" value="{$fields_value.convert}" />
|
||||||
<input type="hidden" name="regenerate" value="{$fields_value.regenerate}" />
|
<input type="hidden" name="regenerate" value="{$fields_value.regenerate}" />
|
||||||
@@ -103,27 +115,37 @@
|
|||||||
{/if}
|
{/if}
|
||||||
<input type="hidden" name="separator" value="{$fields_value.separator}" />
|
<input type="hidden" name="separator" value="{$fields_value.separator}" />
|
||||||
<input type="hidden" name="multiple_value_separator" value="{$fields_value.multiple_value_separator}" />
|
<input type="hidden" name="multiple_value_separator" value="{$fields_value.multiple_value_separator}" />
|
||||||
<table>
|
<div class="form-group">
|
||||||
<tr>
|
<label class="control-label col-lg-3">{l s='Lines to skip'}</label>
|
||||||
<td colspan="3" align="center">
|
<div class="col-lg-9">
|
||||||
<input name="import" type="submit" onclick="return (validateImportation(new Array({$res})));" id="import" value="{l s='Import .CSV data'}" class="button" />
|
<input type="text" size="2" name="skip" value="1" />
|
||||||
</td>
|
</div>
|
||||||
</tr>
|
</div>
|
||||||
<tr>
|
<div class="form-group">
|
||||||
<td valign="top" align="center">
|
<div class="col-lg-12">
|
||||||
<input id="btn_left" value="{l s='<<'}" type="button" class="button" onclick="showTable(current - 1);" />
|
<table class="table">
|
||||||
</td>
|
<tr>
|
||||||
<td align="left">
|
<td valign="top" align="center">
|
||||||
{section name=nb_i start=0 loop=$nb_table step=1}
|
<button id="btn_left" type="button" class="btn btn-default" onclick="showTable(current - 1);">{l s='<<'}</button>
|
||||||
{assign var=i value=$smarty.section.nb_i.index}
|
</td>
|
||||||
{$data.$i}
|
<td align="left">
|
||||||
{/section}
|
{section name=nb_i start=0 loop=$nb_table step=1}
|
||||||
</td>
|
{assign var=i value=$smarty.section.nb_i.index}
|
||||||
<td valign="top" align="center">
|
{$data.$i}
|
||||||
<input id="btn_right" value="{l s='>>'}" type="button" class="button" onclick="showTable(current + 1);" />
|
{/section}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
<td valign="top" align="center">
|
||||||
</table>
|
<button id="btn_right" type="button" class="btn btn-default" onclick="showTable(current + 1);">{l s='>>'}</button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="col-lg-12">
|
||||||
|
<button name="import" type="submit" onclick="return (validateImportation(new Array({$res})));" id="import" class="btn btn-default pull-right"><i class="icon-cloud-upload"></i> {l s='Import .CSV data'}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
{/block}
|
{/block}
|
||||||
Reference in new issue
Block a user