// Updated CSV Import
This commit is contained in:
1 parent
ae68d6c49d
commit
10fe42a005
2 files changed
+24
-4
No files matched your search
@@ -199,7 +199,7 @@
|
|||||||
<p>{l s='Note that you can have serveral products with the same reference.'}</p>
|
<p>{l s='Note that you can have serveral products with the same reference.'}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="warn import_supply_orders_details" style="margin-top: 20px; display:none">
|
<div class="warn import_supply_orders_details" style="margin-top: 20px; display:none">
|
||||||
<p>{l s='Importing Supply Order Details will first reset the products ordered.'}</p>
|
<p>{l s='Importing Supply Order Details will first reset the products ordered, if any.'}</p>
|
||||||
</div>
|
</div>
|
||||||
{if !count($files_to_import)}
|
{if !count($files_to_import)}
|
||||||
<div class="warn" style="margin-top: 20px;">
|
<div class="warn" style="margin-top: 20px;">
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ class AdminImportControllerCore extends AdminController
|
|||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->entities = array_flip(array(
|
$this->entities = array(
|
||||||
$this->l('Categories'),
|
$this->l('Categories'),
|
||||||
$this->l('Products'),
|
$this->l('Products'),
|
||||||
$this->l('Combinations'),
|
$this->l('Combinations'),
|
||||||
@@ -84,9 +84,21 @@ class AdminImportControllerCore extends AdminController
|
|||||||
$this->l('Addresses'),
|
$this->l('Addresses'),
|
||||||
$this->l('Manufacturers'),
|
$this->l('Manufacturers'),
|
||||||
$this->l('Suppliers'),
|
$this->l('Suppliers'),
|
||||||
|
);
|
||||||
|
|
||||||
|
// @since 1.5.0
|
||||||
|
if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT'))
|
||||||
|
{
|
||||||
|
$this->entities = array_merge(
|
||||||
|
$this->entities,
|
||||||
|
array(
|
||||||
$this->l('SupplyOrders'),
|
$this->l('SupplyOrders'),
|
||||||
$this->l('SupplyOrdersDetails'),
|
$this->l('SupplyOrdersDetails'),
|
||||||
));
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->entities = array_flip($this->entities);
|
||||||
|
|
||||||
switch ((int)Tools::getValue('entity'))
|
switch ((int)Tools::getValue('entity'))
|
||||||
{
|
{
|
||||||
@@ -342,6 +354,8 @@ class AdminImportControllerCore extends AdminController
|
|||||||
break;
|
break;
|
||||||
// @since 1.5.0
|
// @since 1.5.0
|
||||||
case $this->entities[$this->l('SupplyOrders')]:
|
case $this->entities[$this->l('SupplyOrders')]:
|
||||||
|
if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT'))
|
||||||
|
{
|
||||||
// required fields
|
// required fields
|
||||||
$this->required_fields = array(
|
$this->required_fields = array(
|
||||||
'id_supplier',
|
'id_supplier',
|
||||||
@@ -369,9 +383,12 @@ class AdminImportControllerCore extends AdminController
|
|||||||
'discount_rate' => '0',
|
'discount_rate' => '0',
|
||||||
'is_template' => '0',
|
'is_template' => '0',
|
||||||
);
|
);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
// @since 1.5.0
|
// @since 1.5.0
|
||||||
case $this->entities[$this->l('SupplyOrdersDetails')]:
|
case $this->entities[$this->l('SupplyOrdersDetails')]:
|
||||||
|
if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT'))
|
||||||
|
{
|
||||||
// required fields
|
// required fields
|
||||||
$this->required_fields = array(
|
$this->required_fields = array(
|
||||||
'supply_order_reference',
|
'supply_order_reference',
|
||||||
@@ -396,6 +413,7 @@ class AdminImportControllerCore extends AdminController
|
|||||||
'tax_rate' => '0',
|
'tax_rate' => '0',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
@@ -438,7 +456,7 @@ class AdminImportControllerCore extends AdminController
|
|||||||
'files_to_import' => $files_to_import,
|
'files_to_import' => $files_to_import,
|
||||||
'languages' => Language::getLanguages(false),
|
'languages' => Language::getLanguages(false),
|
||||||
'id_language' => $this->context->language->id,
|
'id_language' => $this->context->language->id,
|
||||||
'available_fields' => $this->getAvailableFields()
|
'available_fields' => $this->getAvailableFields(),
|
||||||
);
|
);
|
||||||
|
|
||||||
return parent::renderForm();
|
return parent::renderForm();
|
||||||
@@ -2104,10 +2122,12 @@ class AdminImportControllerCore extends AdminController
|
|||||||
break;
|
break;
|
||||||
// @since 1.5.0
|
// @since 1.5.0
|
||||||
case $this->entities[$this->l('SupplyOrders')]:
|
case $this->entities[$this->l('SupplyOrders')]:
|
||||||
|
if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT'))
|
||||||
$this->supplyOrdersImport();
|
$this->supplyOrdersImport();
|
||||||
break;
|
break;
|
||||||
// @since 1.5.0
|
// @since 1.5.0
|
||||||
case $this->entities[$this->l('SupplyOrdersDetails')]:
|
case $this->entities[$this->l('SupplyOrdersDetails')]:
|
||||||
|
if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT'))
|
||||||
$this->supplyOrdersDetailsImport();
|
$this->supplyOrdersDetailsImport();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in new issue
Block a user