// bootraping of import csv view
This commit is contained in:
@@ -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.'}
|
||||
</div>
|
||||
{/if}
|
||||
<div 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>
|
||||
<form action="{$current}&token={$token}" method="post" enctype="multipart/form-data" class="form-horizontal">
|
||||
<div class="panel">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3">{l s='Select your CSV file'}</label>
|
||||
<div class="col-lg-9">
|
||||
<div class="row">
|
||||
<div class="col-lg-7">
|
||||
<input id="file" type="file" name="file" class="hide" />
|
||||
<div class="dummyfile input-group">
|
||||
<span class="input-group-addon"><i class="icon-file"></i></span>
|
||||
<input id="file-name" type="text" class="disabled" name="filename" readonly />
|
||||
<span class="input-group-btn">
|
||||
<button id="file-selectbutton" type="button" name="submitAddAttachments" class="btn btn-default">
|
||||
<i class="icon-folder-open"></i> {l s='Choose a file'}
|
||||
</button>
|
||||
</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 id="upload_file_import" style="display: none">
|
||||
<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">
|
||||
<div class="panel">
|
||||
<div class="clearfix"> </div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3">{l s='Select your CSV file'}</label>
|
||||
<div class="col-lg-9">
|
||||
<div class="row">
|
||||
<div class="col-lg-7">
|
||||
<input id="file" type="file" name="file" class="hide" />
|
||||
<div class="dummyfile input-group">
|
||||
<span class="input-group-addon"><i class="icon-file"></i></span>
|
||||
<input id="file-name" type="text" class="disabled" name="filename" readonly />
|
||||
<span class="input-group-btn">
|
||||
<button id="file-selectbutton" type="button" name="submitAddAttachments" class="btn btn-default">
|
||||
<i class="icon-folder-open"></i> {l s='Choose a file'}
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-lg-9 col-lg-offset-3">
|
||||
<input type="submit" name="submitFileUpload" value="{l s='Upload'}" class="btn btn-default" />
|
||||
<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>
|
||||
</form>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<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>
|
||||
|
||||
{* Import fieldset *}
|
||||
@@ -93,6 +92,7 @@
|
||||
<option value="{$filename}"{if $csv_selected == $filename} selected="selected"{/if}>{$filename|escape:'htmlall':'UTF-8'}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<div class="clearfix"> </div>
|
||||
{/if}
|
||||
|
||||
<a href="#upload_file_import" id="upload_file_import_link" class="btn btn-default">
|
||||
@@ -132,10 +132,10 @@
|
||||
</a>
|
||||
</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}
|
||||
<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">
|
||||
<i class="icon-trash"></i> {l s='Delete'}
|
||||
</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}/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{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>
|
||||
{/if}
|
||||
@@ -274,7 +274,11 @@
|
||||
$("a#upload_file_import_link").fancybox({
|
||||
'titleShow' : false,
|
||||
'transitionIn' : 'elastic',
|
||||
'transitionOut' : 'elastic'
|
||||
'transitionOut' : 'elastic',
|
||||
'autoDimensions' : false,
|
||||
'autoSize' : false,
|
||||
'width' : 700,
|
||||
'height' : 300
|
||||
});
|
||||
|
||||
$('#preview_import').submit(function(e){
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
var btn_submit_import = $('#import');
|
||||
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').addClass('process-icon-save');
|
||||
btn_save_import.click(function(){
|
||||
@@ -62,31 +62,43 @@
|
||||
showTable(current);
|
||||
});
|
||||
</script>
|
||||
<div id="container-customer">
|
||||
<h2>{l s='View your data'}</h2>
|
||||
<div>
|
||||
<b>{l s='Save and load your configuration for importing files'} : </b><br/><br/>
|
||||
<input type="text" name="newImportMatchs" id="newImportMatchs" />
|
||||
<a id="saveImportMatchs" class="button" href="#">{l s='Save'}</a><br /><br />
|
||||
<div id="selectDivImportMatchs" {if !$import_matchs}style="display:none"{/if}>
|
||||
<select id="valueImportMatchs">
|
||||
{foreach $import_matchs as $match}
|
||||
<option id="{$match.id_import_match}" value="{$match.match}">{$match.name}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<a class="button" id="loadImportMatchs" href="#">{l s='Load'}</a>
|
||||
<a class="button" id="deleteImportMatchs" href="#">{l s='Delete'}</a>
|
||||
<div id="container-customer" class="panel">
|
||||
<h3><i class="icon-list-alt"></i> {l s='View your data'}</h3>
|
||||
<div class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3">{l s='Save and load your configuration for importing files'} : </label>
|
||||
<div class="col-lg-7">
|
||||
<input type="text" name="newImportMatchs" id="newImportMatchs" />
|
||||
</div>
|
||||
<div class="col-lg-2">
|
||||
<a id="saveImportMatchs" class="btn btn-default" href="#"><i class="icon-save"></i> {l s='Save'}</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" {if !$import_matchs}style="display:none"{/if}>
|
||||
<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>
|
||||
<h3>{l s='Please set the value type of each column'}</h3>
|
||||
<div id="error_duplicate_type" class="warning warn" style="display:none;">
|
||||
<h3>{l s='Columns cannot have the same value type'}</h3>
|
||||
<div class="row">
|
||||
<p>{l s='Please set the value type of each column'}</p>
|
||||
</div>
|
||||
<div id="required_column" class="warning warn" style="display:none;">
|
||||
<h3>{l s='Column'} <span id="missing_column"> </span> {l s='must be set'}</h3>
|
||||
<div id="error_duplicate_type" class="alert alert-warning" style="display:none;">
|
||||
{l s='Columns cannot have the same value type'}
|
||||
</div>
|
||||
<form action="{$current}&token={$token}" method="post" id="import_form" name="import_form">
|
||||
{l s='Skip'} <input type="text" size="2" name="skip" value="1" /> {l s='lines'}
|
||||
<div id="required_column" class="alert alert-warning" style="display:none;">
|
||||
{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="convert" value="{$fields_value.convert}" />
|
||||
<input type="hidden" name="regenerate" value="{$fields_value.regenerate}" />
|
||||
@@ -103,27 +115,37 @@
|
||||
{/if}
|
||||
<input type="hidden" name="separator" value="{$fields_value.separator}" />
|
||||
<input type="hidden" name="multiple_value_separator" value="{$fields_value.multiple_value_separator}" />
|
||||
<table>
|
||||
<tr>
|
||||
<td colspan="3" align="center">
|
||||
<input name="import" type="submit" onclick="return (validateImportation(new Array({$res})));" id="import" value="{l s='Import .CSV data'}" class="button" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" align="center">
|
||||
<input id="btn_left" value="{l s='<<'}" type="button" class="button" onclick="showTable(current - 1);" />
|
||||
</td>
|
||||
<td align="left">
|
||||
{section name=nb_i start=0 loop=$nb_table step=1}
|
||||
{assign var=i value=$smarty.section.nb_i.index}
|
||||
{$data.$i}
|
||||
{/section}
|
||||
</td>
|
||||
<td valign="top" align="center">
|
||||
<input id="btn_right" value="{l s='>>'}" type="button" class="button" onclick="showTable(current + 1);" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3">{l s='Lines to skip'}</label>
|
||||
<div class="col-lg-9">
|
||||
<input type="text" size="2" name="skip" value="1" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-lg-12">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<td valign="top" align="center">
|
||||
<button id="btn_left" type="button" class="btn btn-default" onclick="showTable(current - 1);">{l s='<<'}</button>
|
||||
</td>
|
||||
<td align="left">
|
||||
{section name=nb_i start=0 loop=$nb_table step=1}
|
||||
{assign var=i value=$smarty.section.nb_i.index}
|
||||
{$data.$i}
|
||||
{/section}
|
||||
</td>
|
||||
<td valign="top" align="center">
|
||||
<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>
|
||||
</div>
|
||||
{/block}
|
||||
|
||||
Reference in New Issue
Block a user