From 80d4b9b26c5b4ace32c461afe4f9a435cc356d6a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 28 Sep 2009 20:06:15 +0000 Subject: [PATCH] Work on import module --- htdocs/exports/export.php | 6 +- htdocs/exports/index.php | 5 +- htdocs/html.form.class.php | 17 +- htdocs/imports/import.php | 19 +- htdocs/imports/index.php | 5 +- .../modules/export/export_csv.modules.php | 316 +++++++++--------- .../modules/export/export_excel.modules.php | 6 + .../modules/export/export_tsv.modules.php | 8 +- .../modules/export/modules_export.php | 9 + .../modules/import/import_csv.modules.php | 10 +- .../modules/import/modules_import.php | 13 +- htdocs/includes/modules/modProduit.class.php | 2 +- htdocs/langs/ca_ES/other.lang | 1 - htdocs/langs/en_US/exports.lang | 5 +- htdocs/langs/fr_FR/exports.lang | 3 +- 15 files changed, 241 insertions(+), 184 deletions(-) diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index 7946a59d4ee..9812d4640a8 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -701,7 +701,7 @@ if ($step == 4 && $datatoexport) print ''.$langs->trans("AvailableFormats").''; print ''.$langs->trans("LibraryUsed").''; print ''.$langs->trans("LibraryVersion").''; - print ''; + print ''."\n"; $liste=$objmodelexport->liste_modeles($db); foreach($liste as $key) @@ -709,7 +709,9 @@ if ($step == 4 && $datatoexport) $var=!$var; print ''; print ''.img_picto_common($key,$objmodelexport->getPicto($key)).''; - print ''.$objmodelexport->getDriverLabel($key).''.$objmodelexport->getLibLabel($key).''.$objmodelexport->getLibVersion($key).''; + $text=$objmodelexport->getDriverDesc($key); + print ''.$html->textwithpicto($objmodelexport->getDriverLabel($key),$text).''; + print ''.$objmodelexport->getLibLabel($key).''.$objmodelexport->getLibVersion($key).''."\n"; } print ''; diff --git a/htdocs/exports/index.php b/htdocs/exports/index.php index 70fb90bd313..3e628c8fa1f 100644 --- a/htdocs/exports/index.php +++ b/htdocs/exports/index.php @@ -41,6 +41,8 @@ $export->load_arrays($user); * View */ +$html=new Form($db); + llxHeader('',$langs->trans("ExportsArea"),'EN:Module_Exports_En|FR:Module_Exports|ES:Módulo_Exportaciones'); print_fiche_titre($langs->trans("ExportsArea")); @@ -73,7 +75,8 @@ foreach($liste as $key) $var=!$var; print ''; print ''.img_picto_common($model->getDriverLabel($key),$model->getPicto($key)).''; - print ''.dol_trunc($model->getDriverLabel($key),24).''; + $text=$model->getDriverDesc($key); + print ''.$html->textwithpicto($model->getDriverLabel($key),$text).''; print ''.$model->getLibLabel($key).''; print ''.$model->getLibVersion($key).''; print ''; diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index a3edf937843..dc1dfac80ef 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -72,9 +72,9 @@ class Form } /** - * \brief Affiche un texte+picto avec tooltip sur texte ou sur picto + * \brief Show a text and picto with tooltip on text or picto * \param text Texte a afficher - * \param htmltext Contenu html du tooltip, code en html + * \param htmltext Contenu html du tooltip, code en Html / UTF8 * \param tooltipon 1=tooltip sur texte, 2=tooltip sur picto, 3=tooltip sur les 2, 4=tooltip sur les 2 et force en Ajax * \param direction -1=Le picto est avant, 0=pas de picto, 1=le picto est apres * \param img Code img du picto @@ -93,11 +93,12 @@ class Form $paramfortooltippicto =''; // Sanitize tooltip - $htmltext=ereg_replace("'","\'",$htmltext); - $htmltext=ereg_replace("'","\'",$htmltext); - $htmltext=ereg_replace("\r","",$htmltext); - $htmltext=ereg_replace("
\n","
",$htmltext); - $htmltext=ereg_replace("\n","",$htmltext); + $htmltext=str_replace("\\","\\\\",$htmltext); + $htmltext=str_replace("'","\'",$htmltext); + $htmltext=str_replace("'","\'",$htmltext); + $htmltext=str_replace("\r","",$htmltext); + $htmltext=str_replace("
\n","
",$htmltext); + $htmltext=str_replace("\n","",$htmltext); if ($conf->use_javascript_ajax && $tooltipon == 4) { @@ -116,7 +117,7 @@ class Form { if ($conf->use_javascript_ajax) { - $htmltext=eregi_replace('"',"\'",$htmltext); + $htmltext=eregi_replace('"',""",$htmltext); if ($tooltipon==1 || $tooltipon==3) { $paramfortooltiptext.=' onmouseover="showtip(\''.$htmltext.'\')"'; diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index ee11d1d2bfa..d2ac2e86eb3 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -709,7 +709,7 @@ if ($step == 4 && $datatoimport) foreach($fieldstarget as $code=>$label) { $var=!$var; - print ''; + print ''; $i++; @@ -717,8 +717,13 @@ if ($step == 4 && $datatoimport) $entityicon=$entitytoicon[$entity]?$entitytoicon[$entity]:$entity; $entitylang=$entitytolang[$entity]?$entitytolang[$entity]:$entity; - print ''.img_object('',$entityicon).' '.$langs->trans($entitylang).''; - print ''.$langs->trans($label).' ('.$code.')'; + print '=>'.img_object('',$entityicon).' '.$langs->trans($entitylang).''; + print ''; + $text=$langs->trans($label); + if (eregi('\*$',$label)) $text=''.$text.''; + $htmltext=$langs->trans("Table").": ?
".$langs->trans("Field").': '.$code; + print $html->textwithpicto($text,$htmltext); + print ''; print ''; $save_select.=$bit; @@ -740,7 +745,7 @@ if ($step == 4 && $datatoimport) { if (empty($fieldsplaced[$key])) { - $var=!$var; + //$var=!$var; $nbofnotimportedfields++; show_elem($fieldssource,$lefti,$key,'',$var); //print '> '.$lefti.'-'.$key; @@ -855,8 +860,8 @@ if ($step == 4 && $datatoimport) print ''; $var=false; print ''; - print ''; - print ''; + print ''; + print ''; print ''; // List of existing import profils @@ -1001,7 +1006,7 @@ function show_elem($fieldssource,$i,$pos,$key,$var) print '
'."\n"; print ''."\n"; - print ''; + print ''; if ($pos && $pos > sizeof($fieldssource)) // NoFields { print ''; print ''; - print ''; + $text=$model->getDriverDesc($key); + print ''; print ''; print ''; print ''; diff --git a/htdocs/includes/modules/export/export_csv.modules.php b/htdocs/includes/modules/export/export_csv.modules.php index 9bf90418d6d..e26e6cc92ea 100644 --- a/htdocs/includes/modules/export/export_csv.modules.php +++ b/htdocs/includes/modules/export/export_csv.modules.php @@ -1,21 +1,21 @@ -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -* or see http://www.gnu.org/ -*/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * or see http://www.gnu.org/ + */ /** * \file htdocs/includes/modules/export/export_csv.modules.php @@ -34,93 +34,99 @@ require_once(DOL_DOCUMENT_ROOT ."/includes/modules/export/modules_export.php"); */ class ExportCsv extends ModeleExports { - var $id; - var $label; - var $extension; - var $version; + var $id; + var $label; + var $extension; + var $version; - var $label_lib; - var $version_lib; + var $label_lib; + var $version_lib; - var $separator; + var $separator; - var $handle; // Handle fichier + var $handle; // Handle fichier - /** - * \brief Constructeur - * \param db Handler acces base de donnee - */ - function ExportCsv($db) - { - global $conf; - $this->db = $db; + /** + * \brief Constructeur + * \param db Handler acces base de donnee + */ + function ExportCsv($db) + { + global $conf; + $this->db = $db; - $this->separator=','; - if (! empty($conf->global->EXPORT_CSV_SEPARATOR_TO_USE)) $this->separator=$conf->global->EXPORT_CSV_SEPARATOR_TO_USE; - $this->escape="\\"; - $this->string='"'; + $this->separator=','; + if (! empty($conf->global->EXPORT_CSV_SEPARATOR_TO_USE)) $this->separator=$conf->global->EXPORT_CSV_SEPARATOR_TO_USE; + $this->escape='"'; + $this->string='"'; - $this->id='csv'; // Same value then xxx in file name export_xxx.modules.php - $this->label='Csv (Comma Separated Value, separator="'.$this->separator.'")'; // Label of driver - $this->extension='csv'; // Extension for generated file by this driver - $this->picto='mime/other'; // Picto - $ver=split(' ','$Revision$'); - $this->version=$ver[2]; // Driver version + $this->id='csv'; // Same value then xxx in file name export_xxx.modules.php + $this->label='Csv'; // Label of driver + $this->desc='Comma Separated Value file format (.csv). This is a text file format.
Fields are separated by separator [ '.$this->separator.' ]. If separator is found inside a field content, field is rounded by round character [ '.$this->string.' ]. Escape character to escape round character is [ '.$this->escape.' ].'; + $this->extension='csv'; // Extension for generated file by this driver + $this->picto='mime/other'; // Picto + $ver=split(' ','$Revision$'); + $this->version=$ver[2]; // Driver version - // If driver use an external library, put its name here - $this->label_lib='Dolibarr'; - $this->version_lib=DOL_VERSION; + // If driver use an external library, put its name here + $this->label_lib='Dolibarr'; + $this->version_lib=DOL_VERSION; - } + } - function getDriverId() - { - return $this->id; - } + function getDriverId() + { + return $this->id; + } - function getDriverLabel() - { - return $this->label; - } + function getDriverLabel() + { + return $this->label; + } - function getDriverExtension() - { - return $this->extension; - } + function getDriverDesc() + { + return $this->desc; + } - function getDriverVersion() - { - return $this->version; - } + function getDriverExtension() + { + return $this->extension; + } - function getLibLabel() - { - return $this->label_lib; - } + function getDriverVersion() + { + return $this->version; + } - function getLibVersion() - { - return $this->version_lib; - } + function getLibLabel() + { + return $this->label_lib; + } + + function getLibVersion() + { + return $this->version_lib; + } - /** - * \brief Open output file + /** + * \brief Open output file * \param file Path of filename * \return int <0 if KO, >=0 if OK */ function open_file($file,$outputlangs) - { - global $langs; + { + global $langs; - dol_syslog("ExportCsv::open_file file=".$file); + dol_syslog("ExportCsv::open_file file=".$file); $ret=1; - $outputlangs->load("exports"); + $outputlangs->load("exports"); $this->handle = fopen($file, "wt"); - if (! $this->handle) + if (! $this->handle) { $langs->load("errors"); $this->error=$langs->trans("ErrorFailToCreateFile",$file); @@ -134,115 +140,115 @@ class ExportCsv extends ModeleExports * \brief Output header into file * \param langs Output language */ - function write_header($outputlangs) - { - return 0; - } + function write_header($outputlangs) + { + return 0; + } /** * \brief Output title line into file * \param langs Output language */ - function write_title($array_export_fields_label,$array_selected_sorted,$outputlangs) - { - global $conf; + function write_title($array_export_fields_label,$array_selected_sorted,$outputlangs) + { + global $conf; - if (! empty($conf->global->EXPORT_CSV_FORCE_CHARSET)) - { - $outputlangs->charset_output = $conf->global->EXPORT_CSV_FORCE_CHARSET; - } - else - { - $outputlangs->charset_output = 'ISO-8859-1'; - } + if (! empty($conf->global->EXPORT_CSV_FORCE_CHARSET)) + { + $outputlangs->charset_output = $conf->global->EXPORT_CSV_FORCE_CHARSET; + } + else + { + $outputlangs->charset_output = 'ISO-8859-1'; + } - foreach($array_selected_sorted as $code => $value) - { - $newvalue=$outputlangs->transnoentities($array_export_fields_label[$code]); - $newvalue=$this->csv_clean($newvalue); + foreach($array_selected_sorted as $code => $value) + { + $newvalue=$outputlangs->transnoentities($array_export_fields_label[$code]); + $newvalue=$this->csv_clean($newvalue); - fwrite($this->handle,$newvalue.$this->separator); - } - fwrite($this->handle,"\n"); - return 0; - } + fwrite($this->handle,$newvalue.$this->separator); + } + fwrite($this->handle,"\n"); + return 0; + } /** * \brief Output record line into file */ - function write_record($array_alias,$array_selected_sorted,$objp,$outputlangs) - { - global $conf; + function write_record($array_alias,$array_selected_sorted,$objp,$outputlangs) + { + global $conf; - if (! empty($conf->global->EXPORT_CSV_FORCE_CHARSET)) - { - $outputlangs->charset_output = $conf->global->EXPORT_CSV_FORCE_CHARSET; - } - else - { - $outputlangs->charset_output = 'ISO-8859-1'; - } + if (! empty($conf->global->EXPORT_CSV_FORCE_CHARSET)) + { + $outputlangs->charset_output = $conf->global->EXPORT_CSV_FORCE_CHARSET; + } + else + { + $outputlangs->charset_output = 'ISO-8859-1'; + } - $this->col=0; - foreach($array_selected_sorted as $code => $value) - { - $alias=$array_alias[$code]; - if (empty($alias)) dol_print_error('','Bad value for field with code='.$code.'. Try to redefine export.'); - $newvalue=$outputlangs->convToOutputCharset($objp->$alias); + $this->col=0; + foreach($array_selected_sorted as $code => $value) + { + $alias=$array_alias[$code]; + if (empty($alias)) dol_print_error('','Bad value for field with code='.$code.'. Try to redefine export.'); + $newvalue=$outputlangs->convToOutputCharset($objp->$alias); - // Translation newvalue - if (eregi('^\((.*)\)$',$newvalue,$reg)) - { - $newvalue=$outputlangs->transnoentities($reg[1]); - } + // Translation newvalue + if (eregi('^\((.*)\)$',$newvalue,$reg)) + { + $newvalue=$outputlangs->transnoentities($reg[1]); + } - $newvalue=$this->csv_clean($newvalue); + $newvalue=$this->csv_clean($newvalue); - fwrite($this->handle,$newvalue.$this->separator); - $this->col++; - } + fwrite($this->handle,$newvalue.$this->separator); + $this->col++; + } - fwrite($this->handle,"\n"); - return 0; - } + fwrite($this->handle,"\n"); + return 0; + } /** * \brief Output footer into file * \param outputlangs Output language */ - function write_footer($outputlangs) - { + function write_footer($outputlangs) + { return 0; - } + } /** * \brief Close file handle */ - function close_file() - { - fclose($this->handle); - return 0; - } + function close_file() + { + fclose($this->handle); + return 0; + } - /** - * Clean a cell to respect rules of CSV file cells - * @param newvalue String to clean - * @return string Value cleaned - */ - function csv_clean($newvalue) - { - $addquote=0; + /** + * Clean a cell to respect rules of CSV file cells + * @param newvalue String to clean + * @return string Value cleaned + */ + function csv_clean($newvalue) + { + $addquote=0; // Rule Dolibarr: No HTML $newvalue=dol_string_nohtmltag($newvalue); // Rule 1 CSV: No CR, LF in cells - $newvalue=ereg_replace("\r",'',$newvalue); - $newvalue=ereg_replace("\n",'\n',$newvalue); + $newvalue=ereg_replace("\r",'',$newvalue); + $newvalue=ereg_replace("\n",'\n',$newvalue); - // Rule 2 CSV: If value contains ", we must duplicate ", and add " + // Rule 2 CSV: If value contains ", we must escape with ", and add " if (ereg('"',$newvalue)) { $addquote=1; @@ -250,13 +256,13 @@ class ExportCsv extends ModeleExports } // Rule 3 CSV: If value contains separator, we must add " - if (ereg($this->separator,$newvalue)) - { - $addquote=1; - } + if (ereg($this->separator,$newvalue)) + { + $addquote=1; + } - return ($addquote?'"':'').$newvalue.($addquote?'"':''); - } + return ($addquote?'"':'').$newvalue.($addquote?'"':''); + } } diff --git a/htdocs/includes/modules/export/export_excel.modules.php b/htdocs/includes/modules/export/export_excel.modules.php index 598d761ef76..e0b3f9ebda1 100644 --- a/htdocs/includes/modules/export/export_excel.modules.php +++ b/htdocs/includes/modules/export/export_excel.modules.php @@ -63,6 +63,7 @@ class ExportExcel extends ModeleExports $this->id='excel'; // Same value then xxx in file name export_xxx.modules.php $this->label='Excel'; // Label of driver + $this->desc='Native Excel 95 file format (.xls)'; $this->extension='xls'; // Extension for generated file by this driver $this->picto='mime/xls'; // Picto $ver=split(' ','$Revision$'); @@ -85,6 +86,11 @@ class ExportExcel extends ModeleExports return $this->label; } + function getDriverDesc() + { + return $this->desc; + } + function getDriverExtension() { return $this->extension; diff --git a/htdocs/includes/modules/export/export_tsv.modules.php b/htdocs/includes/modules/export/export_tsv.modules.php index ca89ec2eb5b..2fdb32c39a4 100644 --- a/htdocs/includes/modules/export/export_tsv.modules.php +++ b/htdocs/includes/modules/export/export_tsv.modules.php @@ -57,7 +57,8 @@ class ExportTsv extends ModeleExports $this->db = $db; $this->id='tsv'; // Same value then xxx in file name export_xxx.modules.php - $this->label='Tsv (Tab Separated Value)'; // Label of driver + $this->label='Tsv'; // Label of driver + $this->desc='Tab Separated Value file format (.tsv)'; $this->extension='tsv'; // Extension for generated file by this driver $this->picto='mime/other'; // Picto $ver=split(' ','$Revision$'); @@ -78,6 +79,11 @@ class ExportTsv extends ModeleExports return $this->label; } + function getDriverDesc() + { + return $this->desc; + } + function getDriverExtension() { return $this->extension; diff --git a/htdocs/includes/modules/export/modules_export.php b/htdocs/includes/modules/export/modules_export.php index 57c7265953f..5af5c80463e 100644 --- a/htdocs/includes/modules/export/modules_export.php +++ b/htdocs/includes/modules/export/modules_export.php @@ -81,6 +81,7 @@ class ModeleExports $this->picto[$module->id]=$module->picto; // Driver properties $this->driverlabel[$module->id]=$module->getDriverLabel(); + $this->driverdesc[$module->id]=$module->getDriverDesc(); $this->driverversion[$module->id]=$module->getDriverVersion(); // If use an external lib $this->liblabel[$module->id]=$module->getLibLabel(); @@ -110,6 +111,14 @@ class ModeleExports return $this->driverlabel[$key]; } + /** + * \brief Renvoi le descriptif d'un driver export + */ + function getDriverDesc($key) + { + return $this->driverdesc[$key]; + } + /** * \brief Renvoi version d'un driver export */ diff --git a/htdocs/includes/modules/import/import_csv.modules.php b/htdocs/includes/modules/import/import_csv.modules.php index 264b54ff493..b971ec822d6 100644 --- a/htdocs/includes/modules/import/import_csv.modules.php +++ b/htdocs/includes/modules/import/import_csv.modules.php @@ -58,11 +58,12 @@ class ImportCsv extends ModeleImports $this->separator=','; if (! empty($conf->global->EXPORT_CSV_SEPARATOR_TO_USE)) $this->separator=$conf->global->EXPORT_CSV_SEPARATOR_TO_USE; - $this->escape="\\"; + $this->escape='"'; $this->string='"'; $this->id='csv'; // Same value then xxx in file name export_xxx.modules.php - $this->label='Csv (Comma Separated Value, separator="'.$this->separator.'")'; // Label of driver + $this->label='Csv'; // Label of driver + $this->desc='Comma Separated Value file format (.csv). This is a text file format.
Fields are separated by separator [ '.$this->separator.' ]. If separator is found inside a field content, field is rounded by round character [ '.$this->string.' ]. Escape character to escape round character is [ '.$this->escape.' ].'; $this->extension='csv'; // Extension for generated file by this driver $this->picto='mime/other'; // Picto $ver=split(' ','$Revision$'); @@ -83,6 +84,11 @@ class ImportCsv extends ModeleImports return $this->label; } + function getDriverDesc() + { + return $this->desc; + } + function getDriverExtension() { return $this->extension; diff --git a/htdocs/includes/modules/import/modules_import.php b/htdocs/includes/modules/import/modules_import.php index daf9cd576b7..53680d6c276 100644 --- a/htdocs/includes/modules/import/modules_import.php +++ b/htdocs/includes/modules/import/modules_import.php @@ -80,6 +80,7 @@ class ModeleImports $this->picto[$module->id]=$module->picto; // Driver properties $this->driverlabel[$module->id]=$module->getDriverLabel(); + $this->driverdesc[$module->id]=$module->getDriverDesc(); $this->driverversion[$module->id]=$module->getDriverVersion(); // If use an external lib $this->liblabel[$module->id]=$module->getLibLabel(); @@ -102,7 +103,7 @@ class ModeleImports } /** - * \brief Renvoi libelle d'un driver export + * \brief Renvoi libelle d'un driver import */ function getDriverLabel($key) { @@ -110,7 +111,15 @@ class ModeleImports } /** - * \brief Renvoi version d'un driver export + * \brief Renvoi la description d'un driver import + */ + function getDriverDesc($key) + { + return $this->driverdesc[$key]; + } + + /** + * \brief Renvoi version d'un driver import */ function getDriverVersion($key) { diff --git a/htdocs/includes/modules/modProduit.class.php b/htdocs/includes/modules/modProduit.class.php index d587bb5e902..119faa13c6d 100644 --- a/htdocs/includes/modules/modProduit.class.php +++ b/htdocs/includes/modules/modProduit.class.php @@ -153,7 +153,7 @@ class modProduit extends DolibarrModules $this->import_code[$r]=$this->rights_class.'_'.$r; $this->import_label[$r]="Products"; // Translation key //$this->import_permission[$r]=array(array("societe","import")); - $this->import_fields_array[$r]=array('p.ref'=>"Ref",'p.label'=>"Label",'p.description'=>"Description",'p.note'=>"Note",'p.price'=>"SellingPriceHT",'p.price_ttc'=>"SellingPriceTTC",'p.tva_tx'=>'VAT','p.envente'=>"OnSell",'p.duration'=>"Duration"); + $this->import_fields_array[$r]=array('p.ref'=>"Ref*",'p.label'=>"Label*",'p.description'=>"Description",'p.note'=>"Note",'p.price'=>"SellingPriceHT",'p.price_ttc'=>"SellingPriceTTC",'p.tva_tx'=>'VAT','p.envente'=>"OnSell*",'p.duration'=>"Duration"); $this->import_entities_array[$r]=array('p.ref'=>"product",'p.label'=>"product",'p.description'=>"product",'p.note'=>"product",'p.price'=>"product",'p.price_ttc'=>"product",'p.tva_tx'=>'product','p.envente'=>"product",'p.duration'=>"product"); $this->import_examplevalues_array[$r]=array('p.ref'=>"PR123456",'p.label'=>"My product",'p.description'=>"This is a description example for record",'p.note'=>"Some note",'p.price'=>"100",'p.price_ttc'=>"110",'p.tva_tx'=>'10','p.envente'=>"0 or 1",'p.duration'=>"1y"); diff --git a/htdocs/langs/ca_ES/other.lang b/htdocs/langs/ca_ES/other.lang index 7032ce4a82d..ff95bc0ee13 100644 --- a/htdocs/langs/ca_ES/other.lang +++ b/htdocs/langs/ca_ES/other.lang @@ -155,7 +155,6 @@ MemberDeletedInDolibarr = Membre %s eliminat de Dolibarr MemberSubscriptionAddedInDolibarr = Subscripció del membre %s afegida a Dolibar ##### Export ##### = = ExportsArea = Àrea d'exportacions -AvailableFormats = Formats disponibles LibraryUsed = Llibreria utilitzada LibraryVersion = Versió ExportableDatas = Dades exportables diff --git a/htdocs/langs/en_US/exports.lang b/htdocs/langs/en_US/exports.lang index 89ee2a77c4c..0f4ce8b8ddc 100644 --- a/htdocs/langs/en_US/exports.lang +++ b/htdocs/langs/en_US/exports.lang @@ -30,7 +30,7 @@ FieldsOrder=Fields order FieldsTitle=Fields title ChooseExportFormat=Choose export format NowClickToGenerateToBuildExportFile=Now, click on "Generate" to build export file... -AvailableFormats=Formats disponibles +AvailableFormats=Available formats LibraryShort=Library LibraryUsed=Library used LibraryVersion=Version @@ -63,8 +63,9 @@ ChooseFormatOfFileToImport=Choose file format to use as import file format by cl ChooseFileToImport=Upload file then click on picto %s to select file as source import file... SourceFileFormat=Source file format FieldsInSourceFile=Fields in source file -FieldsInTargetDatabase=Target fields in Dolibarr database +FieldsInTargetDatabase=Target fields in Dolibarr database (*=mandatory) NoFields=No fields MoveField=Move field column number %s ExampleOfImportFile=Example_of_import_file +SaveImportProfile=Save this import profile ErrorImportDuplicateProfil=Failed to save this import profile with this name. An existing profile already exists with this name. diff --git a/htdocs/langs/fr_FR/exports.lang b/htdocs/langs/fr_FR/exports.lang index e7d1895b092..aff1a8892f4 100644 --- a/htdocs/langs/fr_FR/exports.lang +++ b/htdocs/langs/fr_FR/exports.lang @@ -63,8 +63,9 @@ ChooseFileToImport=Ajouter le fichier à importer puis cliquez sur le picto %s p DownloadEmptyExample=Télécharger fichier vierge exemple SourceFileFormat=Format du fichier source FieldsInSourceFile=Champs dans le fichier source -FieldsInTargetDatabase=Champs cibles dans la base Dolibarr +FieldsInTargetDatabase=Champs cibles dans la base Dolibarr (*=obligatoire) NoFields=Aucun champ MoveField=Déplacer champ colonne numéro %s ExampleOfImportFile=Exemple_de_fichier_import +SaveImportProfile=Sauvegarder ce profil d'import ErrorImportDuplicateProfil=Impossible de sauvegarder le profil d'import sous ce nom. Un profil existant existe déjà pour ce nom. \ No newline at end of file
'; diff --git a/htdocs/imports/index.php b/htdocs/imports/index.php index ab42a221f0e..bbbe321166d 100644 --- a/htdocs/imports/index.php +++ b/htdocs/imports/index.php @@ -39,6 +39,8 @@ $import->load_arrays($user); * View */ +$html=new Form($db); + llxHeader('',$langs->trans("ImportArea"),'EN:Module_Imports_En|FR:Module_Imports|ES:Módulo_Importaciones'); print_fiche_titre($langs->trans("ImportArea")); @@ -70,7 +72,8 @@ foreach($liste as $key) $var=!$var; print '
'.img_picto_common($model->getDriverLabel($key),$model->getPicto($key)).''.dol_trunc($model->getDriverLabel($key),24).''.$html->textwithpicto($model->getDriverLabel($key),$text).''.$model->getLibLabel($key).''.$model->getLibVersion($key).'