';
-// Liste des formats d'exports disponibles
+// Liste des formats d'imports disponibles
$var=true;
print '';
print '';
@@ -62,8 +62,8 @@ print '| '.$langs->trans("LibraryUsed").' | ';
print ''.$langs->trans("LibraryVersion").' | ';
print ' ';
-include_once(DOL_DOCUMENT_ROOT.'/includes/modules/export/modules_export.php');
-$model=new ModeleExports();
+include_once(DOL_DOCUMENT_ROOT.'/includes/modules/import/modules_import.php');
+$model=new ModeleImports();
$liste=$model->liste_modeles($db);
foreach($liste as $key)
@@ -79,10 +79,10 @@ foreach($liste as $key)
print ' ';
-print ' | ';
+print ' | ';
-// Affiche les modules d'exports
+// Affiche les modules d'imports
print '';
print '';
print '| '.$langs->trans("Module").' | ';
@@ -90,26 +90,26 @@ print ''.$langs->trans("ImportableDatas").' | ';
//print ' | ';
print ' ';
$val=true;
-if (sizeof($export->array_export_code))
+if (sizeof($import->array_import_code))
{
- foreach ($export->array_export_code as $key => $value)
+ foreach ($import->array_import_code as $key => $value)
{
$val=!$val;
print '| ';
- print img_object($export->array_export_module[$key]->getName(),$export->array_export_module[$key]->picto).' ';
- print $export->array_export_module[$key]->getName();
+ 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($export->array_export_label[$key]);
- print ($string!=$export->array_export_label[$key]?$string:$export->array_export_label[$key]);
+ $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("NewExport"),'filenew').'';
+// print ''.img_picto($langs->trans("NewImport"),'filenew').'';
// print ' | ';
print ' ';
}
- print ' | ';
+ print ' | ';
}
else
{
diff --git a/htdocs/imports/pre.inc.php b/htdocs/imports/pre.inc.php
new file mode 100644
index 00000000000..c83a81f1a58
--- /dev/null
+++ b/htdocs/imports/pre.inc.php
@@ -0,0 +1,43 @@
+
+ *
+ * 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.
+ */
+
+/**
+ * \file htdocs/exports/pre.inc.php
+ * \ingroup core
+ * \brief Fichier de gestion du menu gauche de l'espace exports
+ * \version $Id$
+ */
+
+require("../main.inc.php");
+
+
+function llxHeader($head = '', $title='', $help_url='')
+{
+ global $user, $conf, $langs;
+
+ top_menu($head, $title);
+
+ $menu = new Menu();
+
+ $menu->add(DOL_URL_ROOT."/exports/index.php", $langs->trans("Exports"));
+ $menu->add_submenu(DOL_URL_ROOT."/exports/export.php", $langs->trans("NewExport"));
+
+ left_menu($menu->liste, $help_url);
+}
+
+?>
diff --git a/htdocs/admin/import/sample.csv b/htdocs/imports/sample.csv
similarity index 100%
rename from htdocs/admin/import/sample.csv
rename to htdocs/imports/sample.csv
diff --git a/htdocs/includes/menus/barre_left/eldy_backoffice.php b/htdocs/includes/menus/barre_left/eldy_backoffice.php
index 33d3e4b698e..3da1a614dcf 100644
--- a/htdocs/includes/menus/barre_left/eldy_backoffice.php
+++ b/htdocs/includes/menus/barre_left/eldy_backoffice.php
@@ -813,8 +813,8 @@ class MenuLeft {
if (! empty($conf->global->MAIN_MODULE_IMPORT))
{
$langs->load("exports");
- $newmenu->add_submenu(DOL_URL_ROOT."/admin/import/index.php?leftmenu=import",$langs->trans("FormatedImport"),0, $user->rights->import->lire);
- $newmenu->add_submenu(DOL_URL_ROOT."/admin/import/import.php?leftmenu=import",$langs->trans("NewImport"),1, $user->rights->import->creer);
+ $newmenu->add_submenu(DOL_URL_ROOT."/imports/index.php?leftmenu=import",$langs->trans("FormatedImport"),0, $user->rights->import->lire);
+ $newmenu->add_submenu(DOL_URL_ROOT."/imports/import.php?leftmenu=import",$langs->trans("NewImport"),1, $user->rights->import->creer);
}
if (! empty($conf->global->MAIN_MODULE_DOMAIN))
diff --git a/htdocs/includes/menus/barre_left/eldy_frontoffice.php b/htdocs/includes/menus/barre_left/eldy_frontoffice.php
index 3fc4ac9cf73..0657f3547d9 100644
--- a/htdocs/includes/menus/barre_left/eldy_frontoffice.php
+++ b/htdocs/includes/menus/barre_left/eldy_frontoffice.php
@@ -771,13 +771,20 @@ class MenuLeft {
*/
}
- if ($conf->export->enabled)
+ if (! empty($conf->export->enabled))
{
$langs->load("exports");
$newmenu->add_submenu(DOL_URL_ROOT."/exports/index.php?leftmenu=export",$langs->trans("FormatedExport"),0, $user->rights->export->lire);
$newmenu->add_submenu(DOL_URL_ROOT."/exports/export.php?leftmenu=export",$langs->trans("NewExport"),1, $user->rights->export->creer);
}
+ if (! empty($conf->global->MAIN_MODULE_IMPORT))
+ {
+ $langs->load("exports");
+ $newmenu->add_submenu(DOL_URL_ROOT."/imports/index.php?leftmenu=import",$langs->trans("FormatedImport"),0, $user->rights->import->lire);
+ $newmenu->add_submenu(DOL_URL_ROOT."/imports/import.php?leftmenu=import",$langs->trans("NewImport"),1, $user->rights->import->creer);
+ }
+
if ($conf->global->MAIN_MODULE_DOMAIN)
{
$langs->load("domains");
diff --git a/htdocs/includes/menus/init_menu_auguria.sql b/htdocs/includes/menus/init_menu_auguria.sql
index d2710fa0aa0..6a6414ef53d 100644
--- a/htdocs/includes/menus/init_menu_auguria.sql
+++ b/htdocs/includes/menus/init_menu_auguria.sql
@@ -264,8 +264,8 @@ insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`,
insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 3902__+MAX_llx_menu__, 'tools', '', 3900__+MAX_llx_menu__, '/comm/mailing/liste.php?leftmenu=mailing', 'List', 1, 'mails', '$user->rights->mailing->lire', '', 0, 1);
insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 4100__+MAX_llx_menu__, 'tools', '', 8__+MAX_llx_menu__, '/exports/index.php?leftmenu=export', 'FormatedExport', 0, 'exports', '$user->rights->export->lire', '', 2, 2);
insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 4101__+MAX_llx_menu__, 'tools', '', 4100__+MAX_llx_menu__, '/exports/export.php?leftmenu=export', 'NewExport', 1, 'exports', '$user->rights->export->creer', '', 2, 0);
-insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 4130__+MAX_llx_menu__, 'tools', '', 8__+MAX_llx_menu__, '/admin/import/index.php?leftmenu=import', 'FormatedImport', 0, 'exports', '$user->rights->import->lire', '', 2, 2);
-insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 4131__+MAX_llx_menu__, 'tools', '', 4130__+MAX_llx_menu__, '/admin/import/import.php?leftmenu=import', 'NewImport', 1, 'exports', '$user->rights->import->creer', '', 2, 0);
+insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 4130__+MAX_llx_menu__, 'tools', '', 8__+MAX_llx_menu__, '/imports/index.php?leftmenu=import', 'FormatedImport', 0, 'exports', '$user->rights->import->lire', '', 2, 2);
+insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 4131__+MAX_llx_menu__, 'tools', '', 4130__+MAX_llx_menu__, '/imports/import.php?leftmenu=import', 'NewImport', 1, 'exports', '$user->rights->import->creer', '', 2, 0);
insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 4200__+MAX_llx_menu__, 'members', '', 13__+MAX_llx_menu__, '/adherents/index.php?leftmenu=members&mainmenu=members', 'Members', 0, 'members', '$user->rights->adherent->lire', '', 2, 0);
insert into `llx_menu` (`menu_handler`, `type`, `rowid`, `mainmenu`, `leftmenu`, `fk_menu`, `url`, `titre`, `level`, `langs`, perms, `target`, `user`, position) values ('auguria', 'left', 4201__+MAX_llx_menu__, 'members', '', 4200__+MAX_llx_menu__, '/adherents/fiche.php?action=create', 'NewMember', 1, 'members', '$user->rights->adherent->creer', '', 2, 0);
diff --git a/htdocs/includes/modules/export/export_csv.modules.php b/htdocs/includes/modules/export/export_csv.modules.php
index d829c624334..28ab9c5c63e 100644
--- a/htdocs/includes/modules/export/export_csv.modules.php
+++ b/htdocs/includes/modules/export/export_csv.modules.php
@@ -30,7 +30,7 @@ require_once(DOL_DOCUMENT_ROOT ."/includes/modules/export/modules_export.php");
/**
* \class ExportCsv
- * \brief Classe permettant de generer les factures au modele Crabe
+ * \brief Classe permettant de generer les fichiers exports au format CSV
*/
class ExportCsv extends ModeleExports
{
diff --git a/htdocs/includes/modules/export/modules_export.php b/htdocs/includes/modules/export/modules_export.php
index f79d1630fa5..bf29faa1d67 100644
--- a/htdocs/includes/modules/export/modules_export.php
+++ b/htdocs/includes/modules/export/modules_export.php
@@ -19,29 +19,28 @@
*/
/**
- \file htdocs/includes/modules/export/modules_export.php
- \ingroup export
- \brief Fichier contenant la classe mère de generation des exports
- \version $Id$
+ * \file htdocs/includes/modules/export/modules_export.php
+ * \ingroup export
+ * \brief File of parent class for export modules
+ * \version $Id$
*/
require_once(DOL_DOCUMENT_ROOT.'/lib/functions.lib.php');
/**
- \class ModeleExports
- \brief Classe mère des modèles de format d'export
+ * \class ModeleExports
+ * \brief Parent class for export modules
*/
-
class ModeleExports
{
var $error='';
- var $driverlabel;
- var $driverversion;
+ var $driverlabel=array();
+ var $driverversion=array();
- var $libabel;
- var $libversion;
+ var $liblabel=array();
+ var $libversion=array();
/**
@@ -52,7 +51,7 @@ class ModeleExports
}
/**
- * \brief Charge en memoire et renvoie la liste des modèles actifs
+ * \brief Charge en memoire et renvoie la liste des modeles actifs
* \param db Handler de base
*/
function liste_modeles($db)
@@ -129,8 +128,8 @@ class ModeleExports
/**
* \brief Lance la generation du fichier
- * \remarks Les tableaux array_export_xxx sont déjà chargées pour le bon datatoexport
- * aussi le parametre datatoexport est inutilisé
+ * \remarks Les tableaux array_export_xxx sont d�j� charg�es pour le bon datatoexport
+ * aussi le parametre datatoexport est inutilis�
*/
function build_file($model, $datatoexport, $array_selected)
{
diff --git a/htdocs/includes/modules/import/import_csv.modules.php b/htdocs/includes/modules/import/import_csv.modules.php
new file mode 100644
index 00000000000..2281daf1df8
--- /dev/null
+++ b/htdocs/includes/modules/import/import_csv.modules.php
@@ -0,0 +1,212 @@
+
+*
+* 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
+ * \ingroup export
+ * \brief File to build exports with CSV format
+ * \author Laurent Destailleur
+ * \version $Id$
+ */
+
+require_once(DOL_DOCUMENT_ROOT ."/includes/modules/import/modules_import.php");
+
+
+/**
+ * \class ImportCsv
+ * \brief Classe permettant de lire les fichiers imports CSV
+ */
+class ImportCsv extends ModeleImports
+{
+ var $id;
+ var $label;
+ var $extension;
+ var $version;
+
+ var $label_lib;
+ var $version_lib;
+
+ var $separator;
+
+ var $handle; // Handle fichier
+
+
+ /**
+ * \brief Constructeur
+ * \param db Handler acces base de donnee
+ */
+ function ImportCsv($db)
+ {
+ global $conf;
+ $this->db = $db;
+
+ $this->id='csv'; // Same value then xxx in file name export_xxx.modules.php
+ $this->label='Csv (Comma Separated Value)'; // Label of driver
+ $this->extension='csv'; // Extension for generated file by this driver
+ $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;
+
+ $this->separator=',';
+ if (! empty($conf->global->EXPORT_CSV_SEPARATOR_TO_USE)) $this->separator=$conf->global->EXPORT_CSV_SEPARATOR_TO_USE;
+ }
+
+ function getDriverId()
+ {
+ return $this->id;
+ }
+
+ function getDriverLabel()
+ {
+ return $this->label;
+ }
+
+ function getDriverExtension()
+ {
+ return $this->extension;
+ }
+
+ function getDriverVersion()
+ {
+ return $this->version;
+ }
+
+ function getLibLabel()
+ {
+ return $this->label_lib;
+ }
+
+ function getLibVersion()
+ {
+ return $this->version_lib;
+ }
+
+
+ /**
+ * \brief Open output file
+ * \param file Path of filename
+ * \return int <0 if KO, >=0 if OK
+ */
+ function open_file($file,$outputlangs)
+ {
+ global $langs;
+
+ dol_syslog("ImportCsv::open_file file=".$file);
+
+ $ret=1;
+
+ $outputlangs->load("exports");
+ $this->handle = fread($file, "wt");
+ if (! $this->handle)
+ {
+ $langs->load("errors");
+ $this->error=$langs->trans("ErrorFailToOpenFile",$file);
+ $ret=-1;
+ }
+
+ return $ret;
+ }
+
+ /**
+ * \brief Output header into file
+ * \param langs Output language
+ */
+ function read_header($outputlangs)
+ {
+ return 0;
+ }
+
+
+ /**
+ * \brief Output record line into file
+ */
+ function read_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;
+
+ $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]);
+ }
+
+ $newvalue=$this->csv_clean($newvalue);
+
+ fwrite($this->handle,$newvalue.$this->separator);
+ $this->col++;
+ }
+ fwrite($this->handle,"\n");
+ return 0;
+ }
+
+ /**
+ * \brief Close file handle
+ */
+ 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;
+
+ // 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);
+
+ // Rule 2 CSV: If value contains ", we must duplicate ", and add "
+ if (ereg('"',$newvalue))
+ {
+ $addquote=1;
+ $newvalue=ereg_replace('"','""',$newvalue);
+ }
+
+ // Rule 3 CSV: If value contains separator, we must add "
+ if (ereg($this->separator,$newvalue))
+ {
+ $addquote=1;
+ }
+
+ return ($addquote?'"':'').$newvalue.($addquote?'"':'');
+ }
+
+}
+
+?>
diff --git a/htdocs/includes/modules/import/modules_import.php b/htdocs/includes/modules/import/modules_import.php
new file mode 100644
index 00000000000..7622c70cc61
--- /dev/null
+++ b/htdocs/includes/modules/import/modules_import.php
@@ -0,0 +1,164 @@
+
+ * Copyright (C) 2005-2007 Regis Houssin
+ *
+ * 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/import/modules_import.php
+ * \ingroup export
+ * \brief File of parent class for import file readers
+ * \version $Id$
+ */
+
+require_once(DOL_DOCUMENT_ROOT.'/lib/functions.lib.php');
+
+
+/**
+ * \class ModeleImports
+ * \brief Parent class for import file readers
+ */
+class ModeleImports
+{
+ var $error='';
+
+ var $driverlabel=array();
+ var $driverversion=array();
+
+ var $liblabel=array();
+ var $libversion=array();
+
+
+ /**
+ * \brief Constructeur
+ */
+ function ModeleImports()
+ {
+ }
+
+ /**
+ * \brief Charge en memoire et renvoie la liste des modeles actifs
+ * \param db Handler de base
+ */
+ function liste_modeles($db)
+ {
+ dol_syslog("ModeleImport::loadFormat");
+
+ $dir=DOL_DOCUMENT_ROOT."/includes/modules/import/";
+ $handle=opendir($dir);
+
+ // Recherche des fichiers drivers imports disponibles
+ $var=True;
+ $i=0;
+ while (($file = readdir($handle))!==false)
+ {
+ if (eregi("^import_(.*)\.modules\.php",$file,$reg))
+ {
+ $moduleid=$reg[1];
+
+ // Chargement de la classe
+ $file = $dir."/import_".$moduleid.".modules.php";
+ $classname = "Import".ucfirst($moduleid);
+
+ require_once($file);
+ $module = new $classname($db);
+
+ // Driver properties
+ $this->driverlabel[$module->id]=$module->getDriverLabel();
+ $this->driverversion[$module->id]=$module->getDriverVersion();
+ // If use an external lib
+ $this->liblabel[$module->id]=$module->getLibLabel();
+ $this->libversion[$module->id]=$module->getLibVersion();
+
+ $i++;
+ }
+ }
+
+ return array_keys($this->driverlabel);
+ }
+
+
+ /**
+ * \brief Renvoi libelle d'un driver export
+ */
+ function getDriverLabel($key)
+ {
+ return $this->driverlabel[$key];
+ }
+
+ /**
+ * \brief Renvoi version d'un driver export
+ */
+ function getDriverVersion($key)
+ {
+ return $this->driverversion[$key];
+ }
+
+ /**
+ * \brief Renvoi libelle de librairie externe du driver
+ */
+ function getLibLabel($key)
+ {
+ return $this->liblabel[$key];
+ }
+
+ /**
+ * \brief Renvoi version de librairie externe du driver
+ */
+ function getLibVersion($key)
+ {
+ return $this->libversion[$key];
+ }
+
+
+
+ /**
+ * \brief Lance lecture fichier
+ * \remarks Les tableaux array_import_xxx sont deja chargees pour le bon datatoexport
+ */
+ function load_file($model, $array_selected)
+ {
+ global $langs;
+
+ dol_syslog("Import::load_file $model, $array_selected");
+
+ // Creation de la classe d'export du model ImportXXX
+ $dir = DOL_DOCUMENT_ROOT . "/includes/modules/import/";
+ $file = "import_".$model.".modules.php";
+ $classname = "Import".$model;
+ require_once($dir.$file);
+ $obj = new $classname($db);
+
+ // Execute requete import
+ $sql=$this->array_export_sql[0];
+ $resql = $this->db->query($sql);
+ if ($resql)
+ {
+
+ }
+ else
+ {
+ $this->error=$this->db->error();
+ dol_syslog("Error: sql=$sql ".$this->error, LOG_ERR);
+ return -1;
+ }
+ }
+
+}
+
+
+?>
diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang
index 3ce3d75ab91..293d16c465f 100644
--- a/htdocs/langs/en_US/bills.lang
+++ b/htdocs/langs/en_US/bills.lang
@@ -261,7 +261,6 @@ PaymentNumber=Payment number
RemoveDiscount=Remove discount
WatermarkOnDraftBill=Watermark on draft invoices (nothing if empty)
CloneInvoice=Clone invoice
-CloneMainAttributes=Clone object with its main attributes
ConfirmCloneInvoice=Are you sure you want to clone this invoice %s ?
DisabledBecauseReplacedInvoice=Action disabled because invoice has been replaced
diff --git a/htdocs/langs/en_US/exports.lang b/htdocs/langs/en_US/exports.lang
index 8376d4afa9b..80233930f48 100644
--- a/htdocs/langs/en_US/exports.lang
+++ b/htdocs/langs/en_US/exports.lang
@@ -7,13 +7,21 @@ NewImport=New import
ExportableDatas=Exportable dataset
ImportableDatas=Importable dataset
SelectExportDataSet=Choose dataset you want to export...
+SelectImportDataSet=Choose dataset you want to import...
SelectExportFields=Choose fields you want to export, or select a predefined export profil
+SelectImportFields=Choose fields you want to import, or select a predefined import profil
SaveExportModel=Save this export profile if you plan to reuse it later...
+SaveImportModel=Save this import profile if you plan to reuse it later...
ExportModelName=Export profile name
ExportModelSaved=Export profile saved under name %s.
ExportableFields=Exportable fields
ExportedFields=Exported fields
+ImportModelName=Import profile name
+ImportModelSaved=Import profile saved under name %s.
+ImportableFields=Importable fields
+ImportedFields=Imported fields
DatasetToExport=Dataset to export
+DatasetToImport=Dataset to import
Dataset=Dataset
ChooseFieldsOrdersAndTitle=Choose fields order...
FieldsOrder=Fields order
diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang
index 2e3cf4f3e2a..b85bafcb45c 100644
--- a/htdocs/langs/en_US/main.lang
+++ b/htdocs/langs/en_US/main.lang
@@ -502,6 +502,7 @@ Page=Page
Notes=Notes
AddNewLine=Add new line
FreeZone=Free text
+CloneMainAttributes=Clone object with its main attributes
# Week day
Day1=Monday
Day2=Tuesday
diff --git a/htdocs/langs/en_US/orders.lang b/htdocs/langs/en_US/orders.lang
index f235005c70e..57f23abae51 100755
--- a/htdocs/langs/en_US/orders.lang
+++ b/htdocs/langs/en_US/orders.lang
@@ -100,6 +100,8 @@ UseCustomerContactAsOrderRecipientIfExist=Use customer contact address if define
RunningOrders=Orders on process
UserWithApproveOrderGrant=Useres granted with "approve orders" permission.
PaymentOrderRef=Payment of order %s
+CloneOrder=Clone order
+ConfirmCloneOrder=Are you sure you want to clone this order %s ?
Error_COMMANDE_SUPPLIER_ADDON_NotDefined=Constant COMMANDE_SUPPLIER_ADDON not defined
Error_COMMANDE_ADDON_NotDefined=Constant COMMANDE_ADDON not defined
diff --git a/htdocs/langs/fr_FR/bills.lang b/htdocs/langs/fr_FR/bills.lang
index 02fe6ecc0ea..b685b34de0e 100644
--- a/htdocs/langs/fr_FR/bills.lang
+++ b/htdocs/langs/fr_FR/bills.lang
@@ -261,7 +261,6 @@ RemoveDiscount=Supprimer remise
WatermarkOnDraftBill=Filigrane sur les brouillons de factures (aucun si vide)
UnpayedNotChecked=Aucune facture impayées n'a été sélectionnée
CloneInvoice=Cloner facture
-CloneMainAttributes=Cloner l'objet avec ces attributs principaux
ConfirmCloneInvoice=Etes-vous sur de vouloir cloner cette facture %s ?
DisabledBecauseReplacedInvoice=Action désactivée car facture remplacée
diff --git a/htdocs/langs/fr_FR/exports.lang b/htdocs/langs/fr_FR/exports.lang
index 122e6c2bc01..1c3657065ca 100644
--- a/htdocs/langs/fr_FR/exports.lang
+++ b/htdocs/langs/fr_FR/exports.lang
@@ -6,14 +6,22 @@ NewExport=Nouvel export
NewImport=Nouvel import
ExportableDatas=Lot de données exportables
ImportableDatas=Lot de données importables
+SelectImportDataSet=Choisissez un lot prédéfini de données que vous désirez importer...
SelectExportDataSet=Choisissez un lot prédéfini de données que vous désirez exporter...
+SelectImportFields=Choisissez les champs à importer, ou choisissez un profil d'import prédéfini
SelectExportFields=Choisissez les champs à exporter, ou choisissez un profil d'export prédéfini
SaveExportModel=Enregistrer ce profil d'export si vous désirez le réutiliser ultérieurement...
+SaveImportModel=Enregistrer ce profil d'import si vous désirez le réutiliser ultérieurement...
ExportModelName=Nom du profil d'export
ExportModelSaved=Profil d'export sauvé sous le nom %s.
ExportableFields=Champs exportables
ExportedFields=Champs à exporter
+ImportModelName=Nom du profil d'import
+ImportModelSaved=Profil d'import sauvé sous le nom %s.
+ImportableFields=Champs importables
+ImportedFields=Champs à importer
DatasetToExport=Lot de données à exporter
+DatasetToImport=Lot de données à importer
Dataset=Lot de données
ChooseFieldsOrdersAndTitle=Choisissez l'ordre des champs...
FieldsOrder=Ordre des champs
@@ -32,6 +40,6 @@ FormatedExportDesc1=Cet espace permet de réaliser des exports personalisés des
FormatedExportDesc2=La première étape est de choisir un des lots de données prédéfinis, ensuite de choisir les champs que vous voulez dans votre fichier résultat, et dans quel ordre.
FormatedExportDesc3=Une fois les données sélectionnées, il est possible de choisir le format du fichier export généré.
Sheet=Feuille
-NoImportableData=Pas de type de données importable (aucun module contenant des définitions de données importable n'est actif)
+NoImportableData=Pas tables de données importable (aucun module contenant des définitions de profils d'import n'est actif)
FileSuccessfullyBuilt=Fichier export généré
SQLUsedForExport=Requête SQL utilisée pour construire le fichier export
\ No newline at end of file
diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang
index 6dfb7d3f940..cc158e550d1 100644
--- a/htdocs/langs/fr_FR/main.lang
+++ b/htdocs/langs/fr_FR/main.lang
@@ -502,6 +502,7 @@ Page=Page
Notes=Notes
AddNewLine=Ajout nouvelle ligne
FreeZone=Zone libre
+CloneMainAttributes=Cloner l'objet avec ces attributs principaux
# Week day
Day1=Lundi
Day2=Mardi
diff --git a/htdocs/langs/fr_FR/orders.lang b/htdocs/langs/fr_FR/orders.lang
index e8c1b82d05e..f6c13ea2e08 100755
--- a/htdocs/langs/fr_FR/orders.lang
+++ b/htdocs/langs/fr_FR/orders.lang
@@ -100,6 +100,8 @@ UseCustomerContactAsOrderRecipientIfExist=Utiliser adresse contact suivi client
RunningOrders=Commandes en cours
UserWithApproveOrderGrant=Utilisateurs habilités à approuver les commandes
PaymentOrderRef=Paiement commande %s
+CloneOrder=Cloner commande
+ConfirmCloneOrder=Etes-vous sur de vouloir cloner cette commande %s ?
Error_COMMANDE_SUPPLIER_ADDON_NotDefined=Constante COMMANDE_SUPPLIER_ADDON non définie
Error_COMMANDE_ADDON_NotDefined=Constante COMMANDE_ADDON non définie
diff --git a/htdocs/lib/fourn.lib.php b/htdocs/lib/fourn.lib.php
index 794605e9197..eeb28facd23 100644
--- a/htdocs/lib/fourn.lib.php
+++ b/htdocs/lib/fourn.lib.php
@@ -83,7 +83,7 @@ function ordersupplier_prepare_head($commande)
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/fourn/commande/fiche.php?id='.$commande->id;
- $head[$h][1] = $langs->trans("Card");
+ $head[$h][1] = $langs->trans("OrderCard");
$head[$h][2] = 'card';
$h++;
@@ -102,7 +102,7 @@ function ordersupplier_prepare_head($commande)
$h++;
$head[$h][0] = DOL_URL_ROOT.'/fourn/commande/note.php?id='.$commande->id;
- $head[$h][1] = $langs->trans("Note");
+ $head[$h][1] = $langs->trans("Notes");
$head[$h][2] = 'note';
$h++;
diff --git a/htdocs/pre.inc.php b/htdocs/pre.inc.php
index ba5ced1fc25..00c0f2ccbcb 100644
--- a/htdocs/pre.inc.php
+++ b/htdocs/pre.inc.php
@@ -161,7 +161,15 @@ function llxHeader($head = '', $title='', $help_url='')
if (! empty($conf->export->enabled))
{
$langs->load("exports");
- $menu->add(DOL_URL_ROOT."/exports/index.php", $langs->trans("Exports"));
+ $menu->add_submenu(DOL_URL_ROOT."/exports/index.php?leftmenu=export",$langs->trans("FormatedExport"),0, $user->rights->export->lire);
+ $menu->add_submenu(DOL_URL_ROOT."/exports/export.php?leftmenu=export",$langs->trans("NewExport"),1, $user->rights->export->creer);
+ }
+
+ if (! empty($conf->global->MAIN_MODULE_IMPORT))
+ {
+ $langs->load("exports");
+ $menu->add_submenu(DOL_URL_ROOT."/imports/index.php?leftmenu=import",$langs->trans("FormatedImport"),0, $user->rights->import->lire);
+ $menu->add_submenu(DOL_URL_ROOT."/imports/import.php?leftmenu=import",$langs->trans("NewImport"),1, $user->rights->import->creer);
}
if ($user->rights->user->user->lire || $user->admin)
|