[-] BO : Fix bug #PSCFV-8214 import entity pre selected
This commit is contained in:
@@ -112,7 +112,6 @@
|
|||||||
|
|
||||||
<fieldset style="float: left; margin: 0pt 20px 0pt 0pt; width: 70%;">
|
<fieldset style="float: left; margin: 0pt 20px 0pt 0pt; width: 70%;">
|
||||||
<legend><img src="../img/admin/import.gif" />{l s='Import '}</legend>
|
<legend><img src="../img/admin/import.gif" />{l s='Import '}</legend>
|
||||||
|
|
||||||
<label class="clear">{if count($files_to_import) > 1}{l s='Your CSV file (%d files):' sprintf=count($files_to_import)}{else}{l s='Your CSV file (%d file):' sprintf=count($files_to_import)}{/if}</label>
|
<label class="clear">{if count($files_to_import) > 1}{l s='Your CSV file (%d files):' sprintf=count($files_to_import)}{else}{l s='Your CSV file (%d file):' sprintf=count($files_to_import)}{/if}</label>
|
||||||
<div class="margin-form">
|
<div class="margin-form">
|
||||||
{if count($files_to_import)}
|
{if count($files_to_import)}
|
||||||
@@ -146,7 +145,7 @@
|
|||||||
<div class="margin-form">
|
<div class="margin-form">
|
||||||
<select name="entity" id="entity">
|
<select name="entity" id="entity">
|
||||||
{foreach $entities AS $entity => $i}
|
{foreach $entities AS $entity => $i}
|
||||||
<option value="{$i}" {if $entity == $i}selected="selected"{/if}>
|
<option value="{$i}"{if $entity_selected == $i} selected="selected"{/if}>
|
||||||
{$entity}
|
{$entity}
|
||||||
</option>
|
</option>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
{if $k == 'modules-list'}
|
{if $k == 'modules-list'}
|
||||||
<div id="modules_list_container" style="display:none">
|
<div id="modules_list_container" style="display:none">
|
||||||
<div style="float:right;margin:5px">
|
<div style="float:right;margin:5px">
|
||||||
<a href="#" onclick="$('#modules_list_container').slideUp();return false;"><img alt="X" src="../img/admin/close.png"></a>
|
<a href="#" onclick="$('#modules_list_container').slideUp();return false;"><img alt="X" src="../img/admin/close.png" /></a>
|
||||||
</div>
|
</div>
|
||||||
<div id="modules_list_loader"><img src="../img/loader.gif" alt="" border="0" /></div>
|
<div id="modules_list_loader"><img src="../img/loader.gif" alt="" border="0" /></div>
|
||||||
<div id="modules_list_container_tab" style="display:none;"></div>
|
<div id="modules_list_container_tab" style="display:none;"></div>
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ class AdminAddressesControllerCore extends AdminController
|
|||||||
parent::initToolbar();
|
parent::initToolbar();
|
||||||
if (!$this->display)
|
if (!$this->display)
|
||||||
$this->toolbar_btn['import'] = array(
|
$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')
|
'desc' => $this->l('Import')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -246,7 +246,7 @@ class AdminCategoriesControllerCore extends AdminController
|
|||||||
'desc' => $this->l('Add New')
|
'desc' => $this->l('Add New')
|
||||||
);
|
);
|
||||||
$this->toolbar_btn['import'] = array(
|
$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')
|
'desc' => $this->l('Import')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ class AdminCustomersControllerCore extends AdminController
|
|||||||
else if (!$this->display) //display import button only on listing
|
else if (!$this->display) //display import button only on listing
|
||||||
{
|
{
|
||||||
$this->toolbar_btn['import'] = array(
|
$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')
|
'desc' => $this->l('Import')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -464,12 +464,15 @@ class AdminImportControllerCore extends AdminController
|
|||||||
// adds fancybox
|
// adds fancybox
|
||||||
$this->addCSS(_PS_CSS_DIR_.'jquery.fancybox-1.3.4.css', 'screen');
|
$this->addCSS(_PS_CSS_DIR_.'jquery.fancybox-1.3.4.css', 'screen');
|
||||||
$this->addJqueryPlugin(array('fancybox'));
|
$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(
|
$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/',
|
||||||
'entities' => $this->entities,
|
'entities' => $this->entities,
|
||||||
'entity' => Tools::getValue('entity'),
|
'entity_selected' => $entity_selected,
|
||||||
'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,
|
||||||
@@ -1451,7 +1454,7 @@ class AdminImportControllerCore extends AdminController
|
|||||||
$error = true;
|
$error = true;
|
||||||
|
|
||||||
if ($error)
|
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))
|
if (isset($product->id_category))
|
||||||
|
|||||||
@@ -570,7 +570,7 @@ class AdminManufacturersControllerCore extends AdminController
|
|||||||
default:
|
default:
|
||||||
parent::initToolbar();
|
parent::initToolbar();
|
||||||
$this->toolbar_btn['import'] = array(
|
$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')
|
'desc' => $this->l('Import')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2437,7 +2437,7 @@ class AdminProductsControllerCore extends AdminController
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
$this->toolbar_btn['import'] = array(
|
$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')
|
'desc' => $this->l('Import')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -262,6 +262,24 @@ class AdminSuppliersControllerCore extends AdminController
|
|||||||
return parent::renderForm();
|
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()
|
public function renderView()
|
||||||
{
|
{
|
||||||
$products = $this->object->getProductsLite($this->context->language->id);
|
$products = $this->object->getProductsLite($this->context->language->id);
|
||||||
|
|||||||
Reference in New Issue
Block a user