-

+

diff --git a/controllers/admin/AdminAddressesController.php b/controllers/admin/AdminAddressesController.php
index cc411b8eb..7d0e0c6be 100644
--- a/controllers/admin/AdminAddressesController.php
+++ b/controllers/admin/AdminAddressesController.php
@@ -77,7 +77,7 @@ class AdminAddressesControllerCore extends AdminController
parent::initToolbar();
if (!$this->display)
$this->toolbar_btn['import'] = array(
- 'href' => $this->context->link->getAdminLink('AdminImport', true).'&import_type='.$this->table,
+ 'href' => $this->context->link->getAdminLink('AdminImport', true).'&import_type=addresses',
'desc' => $this->l('Import')
);
}
diff --git a/controllers/admin/AdminCategoriesController.php b/controllers/admin/AdminCategoriesController.php
index 69db3dc17..e605472ff 100644
--- a/controllers/admin/AdminCategoriesController.php
+++ b/controllers/admin/AdminCategoriesController.php
@@ -246,7 +246,7 @@ class AdminCategoriesControllerCore extends AdminController
'desc' => $this->l('Add New')
);
$this->toolbar_btn['import'] = array(
- 'href' => $this->context->link->getAdminLink('AdminImport', true).'&import_type='.$this->table,
+ 'href' => $this->context->link->getAdminLink('AdminImport', true).'&import_type=categories',
'desc' => $this->l('Import')
);
}
diff --git a/controllers/admin/AdminCustomersController.php b/controllers/admin/AdminCustomersController.php
index d4edc5926..98194a0f5 100644
--- a/controllers/admin/AdminCustomersController.php
+++ b/controllers/admin/AdminCustomersController.php
@@ -190,7 +190,7 @@ class AdminCustomersControllerCore extends AdminController
else if (!$this->display) //display import button only on listing
{
$this->toolbar_btn['import'] = array(
- 'href' => $this->context->link->getAdminLink('AdminImport', true).'&import_type='.$this->table,
+ 'href' => $this->context->link->getAdminLink('AdminImport', true).'&import_type=customers',
'desc' => $this->l('Import')
);
}
diff --git a/controllers/admin/AdminImportController.php b/controllers/admin/AdminImportController.php
index b0bef57b6..cc6e3fa89 100644
--- a/controllers/admin/AdminImportController.php
+++ b/controllers/admin/AdminImportController.php
@@ -464,12 +464,15 @@ class AdminImportControllerCore extends AdminController
// adds fancybox
$this->addCSS(_PS_CSS_DIR_.'jquery.fancybox-1.3.4.css', 'screen');
$this->addJqueryPlugin(array('fancybox'));
+ $entity_selected = 0;
+ if (isset($this->entities[$this->l(Tools::ucfirst(Tools::getValue('import_type')))]))
+ $entity_selected = $this->entities[$this->l(Tools::ucfirst(Tools::getValue('import_type')))];
$this->tpl_form_vars = array(
'module_confirmation' => (Tools::getValue('import')) && (isset($this->warnings) && !count($this->warnings)),
'path_import' => _PS_ADMIN_DIR_.'/import/',
'entities' => $this->entities,
- 'entity' => Tools::getValue('entity'),
+ 'entity_selected' => $entity_selected,
'files_to_import' => $files_to_import,
'languages' => Language::getLanguages(false),
'id_language' => $this->context->language->id,
@@ -1451,7 +1454,7 @@ class AdminImportControllerCore extends AdminController
$error = true;
if ($error)
- $this->warnings[] = sprintf(Tools::displayError('Product n°%1$d: the picture cannot be saved: %2$s'), $image->id_product, $url);
+ $this->warnings[] = sprintf(Tools::displayError('Product n°%1$d: the picture cannot be saved: %2$s'), $image->id_product, $url);
}
}
if (isset($product->id_category))
diff --git a/controllers/admin/AdminManufacturersController.php b/controllers/admin/AdminManufacturersController.php
index 4d26c7627..2ec73737a 100644
--- a/controllers/admin/AdminManufacturersController.php
+++ b/controllers/admin/AdminManufacturersController.php
@@ -570,7 +570,7 @@ class AdminManufacturersControllerCore extends AdminController
default:
parent::initToolbar();
$this->toolbar_btn['import'] = array(
- 'href' => $this->context->link->getAdminLink('AdminImport', true).'&import_type='.$this->table,
+ 'href' => $this->context->link->getAdminLink('AdminImport', true).'&import_type=manufacturers',
'desc' => $this->l('Import')
);
}
diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php
index 187a8ce49..03764fe67 100644
--- a/controllers/admin/AdminProductsController.php
+++ b/controllers/admin/AdminProductsController.php
@@ -2437,7 +2437,7 @@ class AdminProductsControllerCore extends AdminController
}
else
$this->toolbar_btn['import'] = array(
- 'href' => $this->context->link->getAdminLink('AdminImport', true).'&import_type='.$this->table,
+ 'href' => $this->context->link->getAdminLink('AdminImport', true).'&import_type=products',
'desc' => $this->l('Import')
);
diff --git a/controllers/admin/AdminSuppliersController.php b/controllers/admin/AdminSuppliersController.php
index bfe5618a3..d2eb52b8d 100644
--- a/controllers/admin/AdminSuppliersController.php
+++ b/controllers/admin/AdminSuppliersController.php
@@ -262,6 +262,24 @@ class AdminSuppliersControllerCore extends AdminController
return parent::renderForm();
}
+ /**
+ * AdminController::initToolbar() override
+ * @see AdminController::initToolbar()
+ *
+ */
+ public function initToolbar()
+ {
+ switch ($this->display)
+ {
+ default:
+ parent::initToolbar();
+ $this->toolbar_btn['import'] = array(
+ 'href' => $this->context->link->getAdminLink('AdminImport', true).'&import_type=suppliers',
+ 'desc' => $this->l('Import')
+ );
+ }
+ }
+
public function renderView()
{
$products = $this->object->getProductsLite($this->context->language->id);