From 532fff5eefebefa7c9046141cd11bcedab7c2610 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Aug 2006 19:15:47 +0000 Subject: [PATCH] New: Ajout outil de dump par mysqldump --- htdocs/admin/tools/dolibarr_export.php | 573 ++++++++++++++++++ htdocs/admin/tools/dolibarr_import.php | 51 ++ htdocs/admin/tools/export.php | 195 ++++++ htdocs/admin/tools/index.php | 61 ++ htdocs/admin/tools/pre.inc.php | 48 ++ htdocs/conf/conf.class.php | 3 + htdocs/document.php | 11 + htdocs/html.form.class.php | 6 +- .../menus/barre_left/eldy_backoffice.php | 58 +- htdocs/langs/en_US/admin.lang | 11 + htdocs/langs/fr_FR/admin.lang | 11 + 11 files changed, 999 insertions(+), 29 deletions(-) create mode 100644 htdocs/admin/tools/dolibarr_export.php create mode 100644 htdocs/admin/tools/dolibarr_import.php create mode 100644 htdocs/admin/tools/export.php create mode 100644 htdocs/admin/tools/index.php create mode 100644 htdocs/admin/tools/pre.inc.php diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php new file mode 100644 index 00000000000..34d0d5ceb44 --- /dev/null +++ b/htdocs/admin/tools/dolibarr_export.php @@ -0,0 +1,573 @@ + + * + * 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. + * + * $Id$ + * $Source$ + */ + +/** + \file htdocs/admin/tools/dolibarr_export.php + \brief Page export de la base + \version $Revision$ +*/ + +require("./pre.inc.php"); +include_once $dolibarr_main_document_root."/lib/databases/".$conf->db->type.".lib.php"; + +$langs->load("admin"); + +if (! $user->admin) + accessforbidden(); + + +llxHeader(); + +print_fiche_titre($langs->trans("Backup"),'','setup'); +print '
'; + +print $langs->trans("DatabaseName").' : '.$dolibarr_main_db_name.'
'; +print '
'; + +?> + + + + +
+ + + + + +
+Schéma et/ou contenu des bases de données + + + + +
+ +
+
+Méthode d'exportation + +
+ + +
+ + + +
+
+ +
+ + +
+ + +
+ Parametres export MySQL + +
+ Path commande mysqldump:
+ +
+ +
+ + + +
+ +
+ + +
+ + + +
+ Options d'exportation + + +
+
+ + + + + + +
+ +
+
+ + + + + + +
+ + +
+ + + +
+ + +
+ + +
+ +
+
+ + + + + + + + + +
+ + +
+ + + +
+ + + +
+ + : + " /> + +

+ +
+ Compression : + + + + + + + + + + + + +
+ + +
+ + +
+

+
+ + +
+ + + + + + \ No newline at end of file diff --git a/htdocs/admin/tools/dolibarr_import.php b/htdocs/admin/tools/dolibarr_import.php new file mode 100644 index 00000000000..190e85db83f --- /dev/null +++ b/htdocs/admin/tools/dolibarr_import.php @@ -0,0 +1,51 @@ + + * + * 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. + * + * $Id$ + * $Source$ + */ + +/** + \file htdocs/admin/tools/dolibarr_import.php + \brief Page import de la base + \version $Revision$ +*/ + +require("./pre.inc.php"); +include_once $dolibarr_main_document_root."/lib/databases/".$conf->db->type.".lib.php"; + +$langs->load("admin"); + +if (! $user->admin) + accessforbidden(); + + +llxHeader(); + +print_fiche_titre($langs->trans("Restore"),'','setup'); +print '
'; + +print $langs->trans("DatabaseName").' : '.$dolibarr_main_db_name.'
'; +print '
'; + + +print $langs->trans("FeatureNotYetAvailable"); + + +llxFooter(); + +?> \ No newline at end of file diff --git a/htdocs/admin/tools/export.php b/htdocs/admin/tools/export.php new file mode 100644 index 00000000000..e6abff9b3ef --- /dev/null +++ b/htdocs/admin/tools/export.php @@ -0,0 +1,195 @@ + + * + * 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. + * + * $Id$ + * $Source$ + */ + +/** + \file htdocs/admin/tools/export.php + \brief Page export de la base + \version $Revision$ +*/ + +require("./pre.inc.php"); +include_once $dolibarr_main_document_root."/lib/databases/".$conf->db->type.".lib.php"; + +$what=$_REQUEST["what"]; +$export_type=$_REQUEST["export_type"]; +$file=isset($_POST['filename_template']) ? $_POST['filename_template'] : ''; + +$langs->load("admin"); + +if (! $user->admin) + accessforbidden(); + + +llxHeader(); + +$html=new Form($db); + +print_fiche_titre($langs->trans("Backup"),'','setup'); +print '
'; + +if ($file && ! $what) +{ + print '
'.$langs->trans("ErrorFieldRequired",$langs->trans("ee")).'
'; + print '
'; +} + + + +/** + * Increase time limit for script execution and initializes some variables + */ +@set_time_limit($cfg['ExecTimeLimit']); +if (!empty($cfg['MemoryLimit'])) { + @ini_set('memory_limit', $cfg['MemoryLimit']); +} + +// Start with empty buffer +$dump_buffer = ''; +$dump_buffer_len = 0; + +// We send fake headers to avoid browser timeout when buffering +$time_start = time(); + + +if ($what == 'mysql') +{ + $mysqldump=$_POST["mysqldump"]; + if ($mysqldump) + { + dolibarr_set_const($db, 'SYSTEMTOOLS_MYSQLDUMP', $mysqldump, $type='chaine'); + } + + create_exdir(DOL_DATA_ROOT.'/admin/temp'); + + // Parameteres execution + $command=escapeshellarg($mysqldump); + //$param=escapeshellarg($dolibarr_main_db_name)." -h ".escapeshellarg($dolibarr_main_db_host)." -u ".escapeshellarg($dolibarr_main_db_user)." -p".escapeshellarg($dolibarr_main_db_pass); + $param=$dolibarr_main_db_name." -h ".$dolibarr_main_db_host." -u ".$dolibarr_main_db_user." -p".$dolibarr_main_db_pass; + $compression=isset($_POST['compression']) ? $_POST['compression'] : 'none'; + if (! $_POST["use_transaction"]) $param.=" -l --single-transaction"; + if ($_POST["disable_fk"]) $param.=" -K"; + if ($_POST["sql_compat"] && $_POST["sql_compat"] != 'NONE') $param.=" --compatible=".$_POST["sql_compat"]; + if ($_POST["drop_database"]) $param.=" --add-drop-database"; + if ($_POST["sql_structure"]) + { + if ($_POST["drop"]) $param.=" --add-drop-table"; + } + else + { + $param.=" -t"; + } + if ($_POST["sql_data"]) + { + $param.=" --tables"; + if ($_POST["showcolumns"]) $param.=" -c"; + if ($_POST["extended_ins"]) $param.=" -e"; + if ($_POST["delayed"]) $param.=" --delayed-insert"; + if ($_POST["sql_ignore"]) $param.=" --insert-ignore"; + if ($_POST["hexforbinary"]) $param.=" --hex-blob"; + } + else + { + $param.=" -d"; + } + $relativepathfile='/admin/temp/'.$file; + $relativepatherr=$relativepathfile.'.err'; + $outputfile=DOL_DATA_ROOT.$relativepathfile; + $outputerror=DOL_DATA_ROOT.$relativepatherr; + + print $langs->trans("RunCommandSummary").':
'; + print '
'; + + print '
'; + + print $langs->trans("BackupResult").': '; + + + // Debut appel methode execution + $fullcommand=$command." ".$param." 2>&1"; + if ($compression == 'none') $handle = fopen($outputfile, 'w'); + if ($compression == 'gz') $handle = gzopen($outputfile, 'w'); + if ($compression == 'bz') $handle = bzopen($outputfile, 'w'); + $handlein = popen($fullcommand, 'r'); + while (!feof($handlein)) + { + $read = fgets($handlein); + fwrite($handle,$read); + } + pclose($handlein); + if ($compression == 'none') fclose($handle); + if ($compression == 'gz') gzclose($handle); + if ($compression == 'bz') bzclose($handle); + + // Get errorstring + $errormsg=''; + if ($compression == 'none') $handle = fopen($outputfile, 'r'); + if ($compression == 'gz') $handle = gzopen($outputfile, 'r'); + if ($compression == 'bz') $handle = bzopen($outputfile, 'r'); + $handle = fopen($outputfile, "r"); + $errormsg = fgets($handle); + if ($compression == 'none') fclose($handle); + if ($compression == 'gz') gzclose($handle); + if ($compression == 'bz') bzclose($handle); + if (eregi('^-- MySql',$errormsg)) $errormsg=''; // Pas erreur + else + { + // Renommer fichier sortie en fichier erreur + //print "$outputfile -> $outputerror"; + @rename($outputfile,$outputerror); + } + // Fin execution commande + +} + +// Si on a demande une generation +if ($what) +{ + if ($errormsg) + { + print '
'.$langs->trans("Error")." : ".$errormsg.'
'; +// print ''.$langs->trans("DownloadErrorFile").'
'; + print '
'; + print '
'; + } + else + { + print '
'; + print $langs->trans("BackupFileSuccessfullyCreated").'.
'; + print $langs->trans("YouCanDownloadBackupFile"); + print '
'; + print '
'; + } +} + +$result=$html->show_documents('systemtools','',DOL_DATA_ROOT.'/admin/temp',$_SERVER['PHP_SELF'],0,1); + +if ($result == 0) +{ + print $langs->trans("NoBackupFileAvailable").'
'; + print $langs->trans("ToBuildBackupFileClickHere",DOL_URL_ROOT.'/admin/tools/dolibarr_export.php').'
'; +} + +print '
'; + +$time_end = time(); + +llxFooter(); +?> diff --git a/htdocs/admin/tools/index.php b/htdocs/admin/tools/index.php new file mode 100644 index 00000000000..d88be9c6c72 --- /dev/null +++ b/htdocs/admin/tools/index.php @@ -0,0 +1,61 @@ + + * Copyright (C) 2004-2006 Laurent Destailleur + * + * 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. + * + * $Id$ + * $Source$ + */ + +/** + \file htdocs/admin/tools/index.php + \brief Page d'accueil de l'espace outils admin + \version $Revision$ +*/ + +require("./pre.inc.php"); + +$langs->load("admin"); +$langs->load("companies"); + +if (!$user->admin) + accessforbidden(); + + + +/* + * Affichage page + */ + +llxHeader(); + +$form = new Form($db); + + +print_fiche_titre($langs->trans("SystemToolsArea"),'','setup'); + +print "
"; + +if ($message) print $message.'
'; + + + + + +$db->close(); + +llxFooter('$Date$ - $Revision$'); +?> diff --git a/htdocs/admin/tools/pre.inc.php b/htdocs/admin/tools/pre.inc.php new file mode 100644 index 00000000000..23f30f33f46 --- /dev/null +++ b/htdocs/admin/tools/pre.inc.php @@ -0,0 +1,48 @@ + + * + * 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. + * + * $Id$ + * $Source$ + */ + +/** + \file htdocs/admin/system/pre.inc.php + \brief Fichier gestionnaire menu page infos système + \version $Revision$ +*/ + +require("../../main.inc.php"); + +function llxHeader($head = "", $urlp = "") +{ + global $langs; + + $langs->load("admin"); + + + top_menu($head); + + $menu = new Menu(); + + $menu->add(DOL_URL_ROOT."/admin/tools/index.php", "SystemTools"); + $menu->add_submenu(DOL_URL_ROOT."/admin/tools/dolibarr_export.php", $langs->trans("Backup")); + $menu->add_submenu(DOL_URL_ROOT."/admin/tools/dolibarr_import.php", $langs->trans("Restore")); + + left_menu($menu->liste); +} + +?> diff --git a/htdocs/conf/conf.class.php b/htdocs/conf/conf.class.php index e0f0a9a596b..6db173b1790 100644 --- a/htdocs/conf/conf.class.php +++ b/htdocs/conf/conf.class.php @@ -291,6 +291,9 @@ class Conf * Modification de quelques variable de conf en fonction des Constantes */ + // outils systemes + if (! $this->global->SYSTEMTOOLS_MYSQLDUMP) $this->global->SYSTEMTOOLS_MYSQLDUMP="mysqldump"; + // societe if (! $this->global->SOCIETE_CODECLIENT_ADDON) $this->global->SOCIETE_CODECLIENT_ADDON="mod_codeclient_leopard"; if (! $this->global->SOCIETE_CODEFOURNISSEUR_ADDON) $this->global->SOCIETE_CODEFOURNISSEUR_ADDON="mod_codeclient_leopard"; diff --git a/htdocs/document.php b/htdocs/document.php index 0daba8ff60e..f87c2422b0f 100644 --- a/htdocs/document.php +++ b/htdocs/document.php @@ -263,6 +263,17 @@ if ($modulepart) $original_file=$conf->fckeditor->dir_output.'/'.$original_file; } + // Wrapping pour les backups + if ($modulepart == 'systemtools') + { + if ($user->admin) + { + $accessallowed=1; + } + $original_file=DOL_DATA_ROOT.'/admin/temp/'.$original_file; + } + + } // Limite accès si droits non corrects diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index 11c202000d4..009da645652 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -2389,7 +2389,7 @@ class Form /** * \brief Affiche la cartouche de la liste des documents d'une propale, facture... * \param modulepart propal=propal, facture=facture, ... - * \param filename Nom fichier sans extension + * \param filename Sous rep à scanner (vide si filedir deja complet) * \param filedir Repertoire à scanner * \param urlsource Url page origine * \param genallowed Génération autorisée (1/0 ou array des formats) @@ -2558,7 +2558,9 @@ class Form { // Défini chemin relatif par rapport au module pour lien download - $relativepath=$filename."/".$file["name"]; + $relativepath=$file["name"]; // Cas general + if ($filename) $relativepath=$filename."/".$file["name"]; // Cas prpal, facture... + // Autre cas if ($modulepart == 'don') { $relativepath = get_exdir($filename).$file["name"]; } if ($modulepart == 'export') { $relativepath = $file["name"]; } diff --git a/htdocs/includes/menus/barre_left/eldy_backoffice.php b/htdocs/includes/menus/barre_left/eldy_backoffice.php index 18ec7bbfa3d..f1e44364c98 100644 --- a/htdocs/includes/menus/barre_left/eldy_backoffice.php +++ b/htdocs/includes/menus/barre_left/eldy_backoffice.php @@ -116,33 +116,37 @@ class MenuLeft { if($user->admin) { - $langs->load("admin"); - - $newmenu->add(DOL_URL_ROOT."/admin/index.php?leftmenu=setup", $langs->trans("Setup")); - if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/company.php", $langs->trans("MenuCompanySetup")); - if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/modules.php", $langs->trans("Modules")); - if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/ihm.php", $langs->trans("GUISetup")); - if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/boxes.php", $langs->trans("Boxes")); - if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/delais.php",$langs->trans("Alerts")); - - if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/triggers.php", $langs->trans("Triggers")); - if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/perms.php", $langs->trans("Security")); - if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/dict.php", $langs->trans("DictionnarySetup")); - if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/const.php", $langs->trans("OtherSetup")); - - $newmenu->add(DOL_URL_ROOT."/admin/system/index.php?leftmenu=system", $langs->trans("SystemInfo")); - if ($leftmenu=="system") $newmenu->add_submenu(DOL_URL_ROOT."/admin/system/dolibarr.php", $langs->trans("Dolibarr"),1); - if ($leftmenu=="system") $newmenu->add_submenu(DOL_URL_ROOT."/admin/system/constall.php", $langs->trans("AllParameters"),2); - if ($leftmenu=="system") $newmenu->add_submenu(DOL_URL_ROOT."/about.php", $langs->trans("About"),2); - if ($leftmenu=="system") $newmenu->add_submenu(DOL_URL_ROOT."/admin/system/os.php", $langs->trans("OS")); - if ($leftmenu=="system") $newmenu->add_submenu(DOL_URL_ROOT."/admin/system/web.php", $langs->trans("WebServer")); - if ($leftmenu=="system") $newmenu->add_submenu(DOL_URL_ROOT."/admin/system/phpinfo.php", $langs->trans("Php")); - if ($leftmenu=="system") $newmenu->add_submenu(DOL_URL_ROOT."/admin/system/phpinfo.php?what=conf", $langs->trans("PhpConf"),2); - if ($leftmenu=="system") $newmenu->add_submenu(DOL_URL_ROOT."/admin/system/phpinfo.php?what=env", $langs->trans("PhpEnv"),2); - if ($leftmenu=="system") $newmenu->add_submenu(DOL_URL_ROOT."/admin/system/phpinfo.php?what=modules", $langs->trans("PhpModules"),2); - if ($leftmenu=="system") $newmenu->add_submenu(DOL_URL_ROOT."/admin/system/database.php", $langs->trans("Database")); - if ($leftmenu=="system") $newmenu->add_submenu(DOL_URL_ROOT."/admin/system/database-tables.php", $langs->trans("Tables"),2); - if ($leftmenu=="system") $newmenu->add_submenu(DOL_URL_ROOT."/admin/system/database-tables-contraintes.php", $langs->trans("Constraints"),2); + $langs->load("admin"); + + $newmenu->add(DOL_URL_ROOT."/admin/index.php?leftmenu=setup", $langs->trans("Setup")); + if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/company.php", $langs->trans("MenuCompanySetup")); + if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/modules.php", $langs->trans("Modules")); + if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/ihm.php", $langs->trans("GUISetup")); + if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/boxes.php", $langs->trans("Boxes")); + if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/delais.php",$langs->trans("Alerts")); + + if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/triggers.php", $langs->trans("Triggers")); + if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/perms.php", $langs->trans("Security")); + if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/dict.php", $langs->trans("DictionnarySetup")); + if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/const.php", $langs->trans("OtherSetup")); + + $newmenu->add(DOL_URL_ROOT."/admin/system/index.php?leftmenu=system", $langs->trans("SystemInfo")); + if ($leftmenu=="system") $newmenu->add_submenu(DOL_URL_ROOT."/admin/system/dolibarr.php", $langs->trans("Dolibarr"),1); + if ($leftmenu=="system") $newmenu->add_submenu(DOL_URL_ROOT."/admin/system/constall.php", $langs->trans("AllParameters"),2); + if ($leftmenu=="system") $newmenu->add_submenu(DOL_URL_ROOT."/about.php", $langs->trans("About"),2); + if ($leftmenu=="system") $newmenu->add_submenu(DOL_URL_ROOT."/admin/system/os.php", $langs->trans("OS")); + if ($leftmenu=="system") $newmenu->add_submenu(DOL_URL_ROOT."/admin/system/web.php", $langs->trans("WebServer")); + if ($leftmenu=="system") $newmenu->add_submenu(DOL_URL_ROOT."/admin/system/phpinfo.php", $langs->trans("Php")); + if ($leftmenu=="system") $newmenu->add_submenu(DOL_URL_ROOT."/admin/system/phpinfo.php?what=conf", $langs->trans("PhpConf"),2); + if ($leftmenu=="system") $newmenu->add_submenu(DOL_URL_ROOT."/admin/system/phpinfo.php?what=env", $langs->trans("PhpEnv"),2); + if ($leftmenu=="system") $newmenu->add_submenu(DOL_URL_ROOT."/admin/system/phpinfo.php?what=modules", $langs->trans("PhpModules"),2); + if ($leftmenu=="system") $newmenu->add_submenu(DOL_URL_ROOT."/admin/system/database.php", $langs->trans("Database")); + if ($leftmenu=="system") $newmenu->add_submenu(DOL_URL_ROOT."/admin/system/database-tables.php", $langs->trans("Tables"),2); + if ($leftmenu=="system") $newmenu->add_submenu(DOL_URL_ROOT."/admin/system/database-tables-contraintes.php", $langs->trans("Constraints"),2); + + $newmenu->add(DOL_URL_ROOT."/admin/tools/index.php?leftmenu=admintools", $langs->trans("SystemTools")); + if ($leftmenu=="admintools") $newmenu->add_submenu(DOL_URL_ROOT."/admin/tools/dolibarr_export.php", $langs->trans("Backup"),1); + if ($leftmenu=="admintools") $newmenu->add_submenu(DOL_URL_ROOT."/admin/tools/dolibarr_import.php", $langs->trans("Restore"),1); } $langs->load("users"); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index a28a6ff60ce..857e3b10e91 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -41,6 +41,17 @@ Box=Box Boxes=Boxes System=System SystemInfo=System informations +SystemTools=System tools +SystemToolsArea=System tools area +Backup=Backup +Restore=Restore +RunCommandSummary=Backup will be done through the following command +WebServerMustHavePermissionForCommand=Your web server must have permissions to run such commands +BackupResult=Backup result +BackupFileSuccessfullyCreated=Backup file successfully generated +YouCanDownloadBackupFile=Generated files can now be downlaoded +NoBackupFileAvailable=No backup files available. +ToBuildBackupFileClickHere=To build one backup file, click here. Yes=Yes No=No AutoDetectLang=Autodetect (browser language) diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index ec5ea8b35fc..d044adcb901 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -41,6 +41,17 @@ Box=Bo Boxes=Boîtes System=Système SystemInfo=Infos Système +SystemTools=Outils Système +SystemToolsArea=Espace outils systèmes +Backup=Sauvegarde +Restore=Restauration +RunCommandSummary=La sauvegarde sera exécutée par la commande suivante +WebServerMustHavePermissionForCommand=Votre serveur web doit avoir les droits pour exécuter une telle commande +BackupResult=Résultat sauvegarde +BackupFileSuccessfullyCreated=Fichier backup généré avec succès +YouCanDownloadBackupFile=Les fichiers générés peuvent maintenant être téléchargés +NoBackupFileAvailable=Aucune fichier backup disponible. +ToBuildBackupFileClickHere=Pour générer un fichier de sauvegarde, cliquez ici. Yes=Oui No=Non AutoDetectLang=Détection auto (navigateur)