[-] BO : fix #PSCFV-4607

This commit is contained in:
lLefevre
2012-10-04 13:33:13 +00:00
parent c9588c9460
commit 98135572df
7 changed files with 25 additions and 9 deletions
+3 -1
View File
@@ -474,6 +474,7 @@ class AdminImportControllerCore extends AdminController
'languages' => Language::getLanguages(false),
'id_language' => $this->context->language->id,
'available_fields' => $this->getAvailableFields(),
'truncateAuthorized' => (Shop::isFeatureActive() && $this->context->employee->isSuperAdmin()) || !Shop::isFeatureActive(),
'PS_ADVANCED_STOCK_MANAGEMENT' => Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT'),
);
@@ -2667,7 +2668,8 @@ class AdminImportControllerCore extends AdminController
// Check if the CSV file exist
if (Tools::getValue('csv'))
{
if (Tools::getValue('truncate'))
// If i am a superadmin, i can truncate table
if (((Shop::isFeatureActive() && $this->context->employee->isSuperAdmin()) || !Shop::isFeatureActive()) && Tools::getValue('truncate'))
$this->truncateTables((int)Tools::getValue('entity'));
switch ((int)Tools::getValue('entity'))