diff --git a/htdocs/imports/class/import.class.php b/htdocs/imports/class/import.class.php
index 12dfc5d19e9..72d1eb16f66 100644
--- a/htdocs/imports/class/import.class.php
+++ b/htdocs/imports/class/import.class.php
@@ -171,7 +171,7 @@ class Import
// Sql request to run after import
$this->array_import_run_sql_after[$i] = (isset($module->import_run_sql_after_array[$r]) ? $module->import_run_sql_after_array[$r] : '');
// Module
- $this->array_import_module[$i] = $module;
+ $this->array_import_module[$i] = array('position_of_profile'=>($module->module_position.'-'.$module->import_code[$r]), 'module'=>$module);
dol_syslog("Import loaded for module ".$modulename." with index ".$i.", dataset=".$module->import_code[$r].", nb of fields=".count($module->import_fields_array[$r]));
$i++;
diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php
index 1ca191f5124..d886796f7b0 100644
--- a/htdocs/imports/import.php
+++ b/htdocs/imports/import.php
@@ -346,17 +346,17 @@ if ($step == 1 || !$datatoimport)
if (count($objimport->array_import_module))
{
- $sortedarrayofmodules = dol_sort_array($objimport->array_import_module, 'module_position', 'asc', 0, 0, 1);
+ $sortedarrayofmodules = dol_sort_array($objimport->array_import_module, 'position_of_profile', 'asc', 0, 0, 1);
foreach ($sortedarrayofmodules as $key => $value)
{
- //var_dump($objimport->array_import_code[$key]);
+ //var_dump($key.' '.$value['position_of_profile'].' '.$value['import_code'].' '.$objimport->array_import_module[$key]['module']->getName().' '.$objimport->array_import_code[$key]);
print '
| ';
- $titleofmodule = $objimport->array_import_module[$key]->getName();
+ $titleofmodule = $objimport->array_import_module[$key]['module']->getName();
// Special cas for import common to module/services
if (in_array($objimport->array_import_code[$key], array('produit_supplierprices', 'produit_multiprice', 'produit_languages'))) $titleofmodule = $langs->trans("ProductOrService");
print $titleofmodule;
print ' | ';
- print img_object($objimport->array_import_module[$key]->getName(), $objimport->array_import_icon[$key]).' ';
+ print img_object($objimport->array_import_module[$key]['module']->getName(), $objimport->array_import_icon[$key]).' ';
print $objimport->array_import_label[$key];
print ' | ';
if ($objimport->array_import_perms[$key])
@@ -400,7 +400,7 @@ if ($step == 2 && $datatoimport)
// Module
print ' |
| '.$langs->trans("Module").' | ';
print '';
- $titleofmodule = $objimport->array_import_module[0]->getName();
+ $titleofmodule = $objimport->array_import_module[0]['module']->getName();
// Special cas for import common to module/services
if (in_array($objimport->array_import_code[0], array('produit_supplierprices', 'produit_multiprice', 'produit_languages'))) $titleofmodule = $langs->trans("ProductOrService");
print $titleofmodule;
@@ -409,7 +409,7 @@ if ($step == 2 && $datatoimport)
// Lot de donnees a importer
print ' |
| '.$langs->trans("DatasetToImport").' | ';
print '';
- print img_object($objimport->array_import_module[0]->getName(), $objimport->array_import_icon[0]).' ';
+ print img_object($objimport->array_import_module[0]['module']->getName(), $objimport->array_import_icon[0]).' ';
print $objimport->array_import_label[0];
print ' |
';
@@ -490,7 +490,7 @@ if ($step == 3 && $datatoimport)
// Module
print '| '.$langs->trans("Module").' | ';
print '';
- $titleofmodule = $objimport->array_import_module[0]->getName();
+ $titleofmodule = $objimport->array_import_module[0]['module']->getName();
// Special cas for import common to module/services
if (in_array($objimport->array_import_code[0], array('produit_supplierprices', 'produit_multiprice', 'produit_languages'))) $titleofmodule = $langs->trans("ProductOrService");
print $titleofmodule;
@@ -499,7 +499,7 @@ if ($step == 3 && $datatoimport)
// Lot de donnees a importer
print ' |
| '.$langs->trans("DatasetToImport").' | ';
print '';
- print img_object($objimport->array_import_module[0]->getName(), $objimport->array_import_icon[0]).' ';
+ print img_object($objimport->array_import_module[0]['module']->getName(), $objimport->array_import_icon[0]).' ';
print $objimport->array_import_label[0];
print ' |
';
@@ -773,7 +773,7 @@ if ($step == 4 && $datatoimport)
// Module
print '| '.$langs->trans("Module").' | ';
print '';
- $titleofmodule = $objimport->array_import_module[0]->getName();
+ $titleofmodule = $objimport->array_import_module[0]['module']->getName();
// Special cas for import common to module/services
if (in_array($objimport->array_import_code[0], array('produit_supplierprices', 'produit_multiprice', 'produit_languages'))) $titleofmodule = $langs->trans("ProductOrService");
print $titleofmodule;
@@ -782,7 +782,7 @@ if ($step == 4 && $datatoimport)
// Lot de donnees a importer
print ' |
| '.$langs->trans("DatasetToImport").' | ';
print '';
- print img_object($objimport->array_import_module[0]->getName(), $objimport->array_import_icon[0]).' ';
+ print img_object($objimport->array_import_module[0]['module']->getName(), $objimport->array_import_icon[0]).' ';
print $objimport->array_import_label[0];
print ' |
';
@@ -1239,7 +1239,7 @@ if ($step == 5 && $datatoimport)
// Module
print '| '.$langs->trans("Module").' | ';
print '';
- $titleofmodule = $objimport->array_import_module[0]->getName();
+ $titleofmodule = $objimport->array_import_module[0]['module']->getName();
// Special cas for import common to module/services
if (in_array($objimport->array_import_code[0], array('produit_supplierprices', 'produit_multiprice', 'produit_languages'))) $titleofmodule = $langs->trans("ProductOrService");
print $titleofmodule;
@@ -1248,7 +1248,7 @@ if ($step == 5 && $datatoimport)
// Lot de donnees a importer
print ' |
| '.$langs->trans("DatasetToImport").' | ';
print '';
- print img_object($objimport->array_import_module[0]->getName(), $objimport->array_import_icon[0]).' ';
+ print img_object($objimport->array_import_module[0]['module']->getName(), $objimport->array_import_icon[0]).' ';
print $objimport->array_import_label[0];
print ' |
';
@@ -1662,7 +1662,7 @@ if ($step == 6 && $datatoimport)
// Module
print '| '.$langs->trans("Module").' | ';
print '';
- $titleofmodule = $objimport->array_import_module[0]->getName();
+ $titleofmodule = $objimport->array_import_module[0]['module']->getName();
// Special cas for import common to module/services
if (in_array($objimport->array_import_code[0], array('produit_supplierprices', 'produit_multiprice', 'produit_languages'))) $titleofmodule = $langs->trans("ProductOrService");
print $titleofmodule;
@@ -1671,7 +1671,7 @@ if ($step == 6 && $datatoimport)
// Lot de donnees a importer
print ' |
| '.$langs->trans("DatasetToImport").' | ';
print '';
- print img_object($objimport->array_import_module[0]->getName(), $objimport->array_import_icon[0]).' ';
+ print img_object($objimport->array_import_module[0]['module']->getName(), $objimport->array_import_icon[0]).' ';
print $objimport->array_import_label[0];
print ' |
';
diff --git a/htdocs/imports/index.php b/htdocs/imports/index.php
index 365df6086f4..bc68b53cfd0 100644
--- a/htdocs/imports/index.php
+++ b/htdocs/imports/index.php
@@ -45,69 +45,18 @@ llxHeader('', $langs->trans("ImportArea"), 'EN:Module_Imports_En|FR:Module_Impor
print load_fiche_titre($langs->trans("ImportArea"));
print $langs->trans("FormatedImportDesc1").'
';
-//print $langs->trans("FormatedImportDesc2").'
';
print '
';
-//print '';
-
-
-// List of import set
-/*
-print '
';
-print '
';
-print '';
-print '| '.$langs->trans("Module").' | ';
-print ''.$langs->trans("ImportableDatas").' | ';
-//print ' | ';
-print '
';
-
-if (count($import->array_import_code))
-{
- foreach ($import->array_import_code as $key => $value)
- {
- print '| ';
- print img_object($import->array_import_module[$key]->getName(),$import->array_import_module[$key]->picto).' ';
- print $import->array_import_module[$key]->getName();
- print ' | ';
- $string=$langs->trans($import->array_import_label[$key]);
- print ($string!=$import->array_import_label[$key]?$string:$import->array_import_label[$key]);
- print ' | ';
- // print '';
- // print ''.img_picto($langs->trans("NewImport"),'filenew').'';
- // print ' | ';
- print '
';
-
- }
-}
-else
-{
- print '| '.$langs->trans("NoImportableData").' |
';
-}
-print '
';
-print '
';
-print '
';
-*/
-
print '
';
if (count($import->array_import_code))
{
- //if ($user->rights->import->run)
- //{
print dolGetButtonTitle($langs->trans('NewImport'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/imports/import.php?leftmenu=import');
- //}
- //else
- //{
- // print '
'.$langs->trans("NewImport").'';
- //}
}
print '
';
print '
';
-//print '
';
-
-
// List of available import format
print '
';
print '
';
@@ -136,8 +85,6 @@ print '
';
print '
';
-//print '
';
-
// End of page
llxFooter();
$db->close();