// Updated CSV Import
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11842 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -48,6 +48,11 @@
|
|||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
activeClueTip();
|
activeClueTip();
|
||||||
|
$("a#upload_file_import_link").fancybox({
|
||||||
|
'titleShow' : false,
|
||||||
|
'transitionIn' : 'elastic',
|
||||||
|
'transitionOut' : 'elastic',
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function activeClueTip()
|
function activeClueTip()
|
||||||
@@ -74,38 +79,12 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
{**
|
{**
|
||||||
* Samples fieldset
|
* Upload fancybox
|
||||||
*}
|
*}
|
||||||
<fieldset>
|
<div style="display: none">
|
||||||
<legend><img src="../img/admin/excel_file.png">{l s='Sample files'}</legend>
|
<div id="upload_file_import" style="background-color: #EBEDF4; border: 1px solid #CCCED7">
|
||||||
<a href="#" onClick="$('#sample_files_import').slideToggle();">{l s='Click here to view the samples.'}</a>
|
<div class="clear"> </div>
|
||||||
<div> </div>
|
<form action="{$current}&token={$token}" method="POST" enctype="multipart/form-data">
|
||||||
<ul id="sample_files_import" style="display:none;">
|
|
||||||
<li><a href="../docs/csv_import/categories_import.csv">{l s='Categories sample file'}</a></li>
|
|
||||||
<li><a href="../docs/csv_import/products_import.csv">{l s='Products sample file'}</a></li>
|
|
||||||
<li><a href="../docs/csv_import/combinations_import.csv">{l s='Combinations sample file'}</a></li>
|
|
||||||
<li><a href="../docs/csv_import/customers_import.csv">{l s='Customers sample file'}</a></li>
|
|
||||||
<li><a href="../docs/csv_import/addresses_import.csv">{l s='Addresses sample file'}</a></li>
|
|
||||||
<li><a href="../docs/csv_import/manufacturers_import.csv">{l s='Manufacturers sample file'}</a></li>
|
|
||||||
<li><a href="../docs/csv_import/suppliers_import.csv">{l s='Suppliers sample file'}</a></li>
|
|
||||||
<li><a href="../docs/csv_import/supply_orders_import.csv">{l s='Supply Orders sample file'}</a></li>
|
|
||||||
</ul>
|
|
||||||
</fieldset>
|
|
||||||
|
|
||||||
<div> </div>
|
|
||||||
|
|
||||||
{**
|
|
||||||
* Upload fieldset
|
|
||||||
*}
|
|
||||||
<fieldset>
|
|
||||||
<legend><img src="../img/admin/import.gif" />{l s='Upload'}</legend>
|
|
||||||
<a href="#" onClick="$('#upload_file_import').slideToggle();">
|
|
||||||
{l s='You can either click here to upload your own CSV file, or choose to use an existing one in the form below.'}
|
|
||||||
</a>
|
|
||||||
<div> </div>
|
|
||||||
<div id="upload_file_import" style="display: none;">
|
|
||||||
<form action="{$current}&token={$token}" method="POST" enctype="multipart/form-data">
|
|
||||||
|
|
||||||
<label class="clear" style="width:160px; text-align: left;">{l s='Select your CSV file:'} </label>
|
<label class="clear" style="width:160px; text-align: left;">{l s='Select your CSV file:'} </label>
|
||||||
<div class="margin-form" style="padding-left:190px;">
|
<div class="margin-form" style="padding-left:190px;">
|
||||||
<input name="file" type="file" />
|
<input name="file" type="file" />
|
||||||
@@ -120,10 +99,25 @@
|
|||||||
{l s='Allowed files are only UTF-8 and iso-8859-1 encoded ones'}
|
{l s='Allowed files are only UTF-8 and iso-8859-1 encoded ones'}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
<div class="clear"> </div>
|
||||||
</fieldset>
|
<div style="width:50%; margin: 0 auto;">
|
||||||
|
{l s='Note that our samples our available, below.'}
|
||||||
|
<div class="clear"> </div>
|
||||||
|
<ul id="sample_files_import">
|
||||||
|
<li><a href="../docs/csv_import/categories_import.csfav">{l s='Categories sample file'}</a></li>
|
||||||
|
<li><a href="../docs/csv_import/products_import.csv">{l s='Products sample file'}</a></li>
|
||||||
|
<li><a href="../docs/csv_import/combinations_import.csv">{l s='Combinations sample file'}</a></li>
|
||||||
|
<li><a href="../docs/csv_import/customers_import.csv">{l s='Customers sample file'}</a></li>
|
||||||
|
<li><a href="../docs/csv_import/addresses_import.csv">{l s='Addresses sample file'}</a></li>
|
||||||
|
<li><a href="../docs/csv_import/manufacturers_import.csv">{l s='Manufacturers sample file'}</a></li>
|
||||||
|
<li><a href="../docs/csv_import/suppliers_import.csv">{l s='Suppliers sample file'}</a></li>
|
||||||
|
<li><a href="../docs/csv_import/supply_orders_import.csv">{l s='Supply Orders sample file'}</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="clear"> </div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="clear"> </div>
|
<div class="clear"> </div>
|
||||||
|
|
||||||
@@ -159,6 +153,8 @@
|
|||||||
<option value="{$filename}">{$filename}</option>
|
<option value="{$filename}">{$filename}</option>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</select>
|
</select>
|
||||||
|
<img src="../img/admin/add.gif" alt="Uplaod" title="Upload" />
|
||||||
|
<b><a href="#upload_file_import" id="upload_file_import_link">{l s='Upload'}</a></b>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
|
|||||||
@@ -397,6 +397,10 @@ class AdminImportControllerCore extends AdminController
|
|||||||
$this->toolbar_fix = false;
|
$this->toolbar_fix = false;
|
||||||
$this->toolbar_btn = array();
|
$this->toolbar_btn = array();
|
||||||
|
|
||||||
|
// adds fancybox
|
||||||
|
$this->addCSS(_PS_CSS_DIR_.'jquery.fancybox-1.3.4.css', 'screen');
|
||||||
|
$this->addJqueryPlugin(array('fancybox'));
|
||||||
|
|
||||||
$this->tpl_form_vars = array(
|
$this->tpl_form_vars = array(
|
||||||
'module_confirmation' => (Tools::getValue('import')) && (isset($this->warnings) && !count($this->warnings)),
|
'module_confirmation' => (Tools::getValue('import')) && (isset($this->warnings) && !count($this->warnings)),
|
||||||
'path_import' => _PS_ADMIN_DIR_.'/import/',
|
'path_import' => _PS_ADMIN_DIR_.'/import/',
|
||||||
@@ -1668,6 +1672,16 @@ class AdminImportControllerCore extends AdminController
|
|||||||
$this->closeCsvFile($handle);
|
$this->closeCsvFile($handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @since 1.5.0
|
||||||
|
*/
|
||||||
|
public function supplyOrdersImport()
|
||||||
|
{
|
||||||
|
$handle = $this->openCsvFile();
|
||||||
|
//@TODO
|
||||||
|
$this->closeCsvFile($handle);
|
||||||
|
}
|
||||||
|
|
||||||
public function utf8EncodeArray($array)
|
public function utf8EncodeArray($array)
|
||||||
{
|
{
|
||||||
if (is_array($array))
|
if (is_array($array))
|
||||||
@@ -1853,6 +1867,8 @@ class AdminImportControllerCore extends AdminController
|
|||||||
case $this->entities[$this->l('Suppliers')]:
|
case $this->entities[$this->l('Suppliers')]:
|
||||||
$this->supplierImport();
|
$this->supplierImport();
|
||||||
break;
|
break;
|
||||||
|
case $this->entities[$this->l('Supply Orders')]:
|
||||||
|
$this->supplyOrdersImport();
|
||||||
default:
|
default:
|
||||||
$this->_errors[] = $this->l('no entity selected');
|
$this->_errors[] = $this->l('no entity selected');
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -219,7 +219,7 @@ label {
|
|||||||
font-weight:bold;
|
font-weight:bold;
|
||||||
padding:0.2em 0 0;
|
padding:0.2em 0 0;
|
||||||
text-align:left;
|
text-align:left;
|
||||||
width:270px;
|
width:300px;
|
||||||
}
|
}
|
||||||
|
|
||||||
label.t {
|
label.t {
|
||||||
|
|||||||
Reference in New Issue
Block a user