From ea0589cbc3cd8a1d8cfcb0e3faeb80c723eb28a7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Jun 2022 18:10:07 +0200 Subject: [PATCH] Debug the new import tool --- htdocs/imports/import.php | 30 +++++++++++++++--------------- htdocs/langs/en_US/exports.lang | 1 + 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index 1fd9794581a..ab7bbd95266 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -492,9 +492,9 @@ if ($step == 2 && $datatoimport) { print ''; print ''; print img_picto('', 'download', 'class="paddingright opacitymedium"'); - print $langs->trans("DownloadEmptyExample"); + print $langs->trans("DownloadEmptyExampleShort"); print ''; - print $form->textwithpicto('', $langs->trans("StarAreMandatory")); + print $form->textwithpicto('', $langs->trans("DownloadEmptyExample").'.
'.$langs->trans("StarAreMandatory")); print ''; // Action button print ''; @@ -583,9 +583,9 @@ if ($step == 3 && $datatoimport) { print ''; print ''; print img_picto('', 'download', 'class="paddingright opacitymedium"'); - print $langs->trans("DownloadEmptyExample"); + print $langs->trans("DownloadEmptyExampleShort"); print ''; - print $form->textwithpicto('', $langs->trans("StarAreMandatory")); + print $form->textwithpicto('', $langs->trans("DownloadEmptyExample").'.
'.$langs->trans("StarAreMandatory")); print ''; print ''; @@ -600,9 +600,9 @@ if ($step == 3 && $datatoimport) { } - print '
'; + print '

'; - print '
'; + print ''; print ''; print ''; @@ -984,10 +984,10 @@ if ($step == 4 && $datatoimport) { print ''; print ''; print $langs->trans("Separator").' : '; - print ''; + print ''; print '    '.$langs->trans("Enclosure").' : '; - print ' '; - print ''; + print ' '; + print ''; print '
'; print ''; } @@ -1014,7 +1014,7 @@ if ($step == 4 && $datatoimport) { // List of source fields print ''."\n"; - print '
'; + print ''; print ''; print ''; print ''; @@ -1448,7 +1448,7 @@ if ($step == 4 && $datatoimport) { print ''; $nameofimportprofile = str_replace(' ', '-', $langs->trans("ImportProfile").' '.$titleofmodule.' '.dol_print_date(dol_now('gmt'), 'dayxcard')); - if (is_object($objimport)) { + if (is_object($objimport) && !empty($objimport->model_name)) { $nameofimportprofile = $objimport->model_name; } @@ -1459,7 +1459,7 @@ if ($step == 4 && $datatoimport) { print $form->selectarray('visibility', $arrayvisibility, 'private'); print ''; print ''; - print ''; + print ''; print ''; // List of existing import profils @@ -1489,7 +1489,7 @@ if ($step == 4 && $datatoimport) { print $langs->trans("Everybody"); } else { $tmpuser->fetch($obj->fk_user); - print $tmpuser->getNomUrl(1); + print $tmpuser->getNomUrl(-1); } print ''; print ''; @@ -1778,9 +1778,9 @@ if ($step == 5 && $datatoimport) { } //print $code.'-'.$label; $alias = preg_replace('/(\..*)$/i', '', $label); - $listfields[$i] = $langs->trans("Column").' '.num2Alpha($code - 1).' -> '.$label; + $listfields[$i] = ''.$langs->trans("Column").' '.num2Alpha($code - 1).' -> '.$label.''; } - print count($listfields) ? (join(',  ', $listfields)) : $langs->trans("Error"); + print count($listfields) ? (join(', ', $listfields)) : $langs->trans("Error"); print ''; print ''; diff --git a/htdocs/langs/en_US/exports.lang b/htdocs/langs/en_US/exports.lang index f9b30ab0131..f06acd49f41 100644 --- a/htdocs/langs/en_US/exports.lang +++ b/htdocs/langs/en_US/exports.lang @@ -54,6 +54,7 @@ TypeOfLineServiceOrProduct=Type of line (0=product, 1=service) FileWithDataToImport=File with data to import FileToImport=Source file to import FileMustHaveOneOfFollowingFormat=File to import must have one of following formats +DownloadEmptyExampleShort=Download a sample file DownloadEmptyExample=Download a template file with examples and information on fields you can import StarAreMandatory=Into the template file, all fields with a * are mandatory fields ChooseFormatOfFileToImport=Choose the file format to use as import file format by clicking on the %s icon to select it...