* Copyright (C) 2006-2012 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 3 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, see . */ /** * \file htdocs/admin/tools/dolibarr_export.php * \ingroup core * \brief Page to export database */ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; $langs->load("admin"); $action=GETPOST('action','alpha'); $sortfield = GETPOST('sortfield','alpha'); $sortorder = GETPOST('sortorder','alpha'); $page = GETPOST('page','int'); if (! $sortorder) $sortorder="DESC"; if (! $sortfield) $sortfield="date"; if ($page < 0) { $page = 0; } $limit = $conf->liste_limit; $offset = $limit * $page; if (! $user->admin) accessforbidden(); /* * Actions */ if ($action == 'delete') { $file=$conf->admin->dir_output.'/'.GETPOST('urlfile'); $ret=dol_delete_file($file, 1); if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); $action=''; } /* * View */ $form=new Form($db); $formfile = new FormFile($db); $label=$db::LABEL; $type=$db->type; //var_dump($db); $help_url='EN:Backups|FR:Sauvegardes|ES:Copias_de_seguridad'; llxHeader('','',$help_url); ?> trans("Backup"),'','title_setup'); print $langs->trans("BackupDesc",DOL_DATA_ROOT).'

'; ?>
1 trans("BackupDesc3",$dolibarr_main_db_name).'
'; //print $langs->trans("BackupDescY").'
'; print '
'; ?>
trans("BackupDumpWizard")); print ''; print ''; print ''; print ''; print '
'; print $langs->trans("DatabaseName").' : '.$dolibarr_main_db_name.'
'; print '
'; ?>
trans("ExportMethod"); ?>

trans("MySqlExportParameters"); ?>
trans("FullPathToMysqldumpCommand"); if (empty($conf->global->SYSTEMTOOLS_MYSQLDUMP)) { $fullpathofmysqldump=$db->getPathOfDump(); } else { $fullpathofmysqldump=$conf->global->SYSTEMTOOLS_MYSQLDUMP; } ?>

trans("ExportOptions"); ?>


id="checkbox_dump_drop" />








trans("MySqlExportParameters"); ?>
trans("ExportOptions"); ?>

trans('ExportStructure') ?> id="checkbox_dump_drop" />

trans("Datas"); ?>



trans("PostgreSqlExportParameters"); ?>
trans("FullPathToPostgreSQLdumpCommand"); if (empty($conf->global->SYSTEMTOOLS_POSTGRESQLDUMP)) { $fullpathofpgdump=$db->getPathOfDump(); } else { $fullpathofpgdump=$conf->global->SYSTEMTOOLS_POSTGRESQLDUMP; } ?>

trans("ExportOptions"); ?>





" />

'', 'id' => 'radio_compression_none', 'label' => $langs->trans("None")); $compression['gz'] = array('function' => 'gzopen', 'id' => 'radio_compression_gzip', 'label' => $langs->trans("Gzip")); // $compression['zip']= array('function' => 'dol_compress', 'id' => 'radio_compression_zip', 'label' => $langs->trans("FormatZip")); // Not open source format. Must implement dol_compress function $compression['bz'] = array('function' => 'bzopen', 'id' => 'radio_compression_bzip', 'label' => $langs->trans("Bzip2")); } else { $compression['none'] = array('function' => '', 'id' => 'radio_compression_none', 'label' => $langs->trans("Default")); $compression['gz'] = array('function' => 'gzopen', 'id' => 'radio_compression_gzip', 'label' => $langs->trans("Gzip")); } // Show compression choices print '
'; print "\n"; print $langs->trans("Compression").':   '; foreach($compression as $key => $val) { if (! $val['function'] || function_exists($val['function'])) // Enabled export format { print ''; print ' '; } else // Disabled export format { print ''; print ' '; print ' ('.$langs->trans("NotAvailable").')'; } print '     '; } print '
'; print "\n"; ?>
" id="buttonGo" />

'.$langs->trans("RunCommandSummary").':
'."\n"; print '
'."\n"; print '
'; //print $paramclear; // Now run command and show result print ''.$langs->trans("BackupResult").': '; print $_SESSION["commandbackupresult"]; $_SESSION["commandbackuplastdone"]=''; $_SESSION["commandbackuptorun"]=''; $_SESSION["commandbackupresult"]=''; } ?>
'; ?>
admin->dir_output.'/backup','files',0,'','',$sortfield,(strtolower($sortorder)=='asc'?SORT_ASC:SORT_DESC),1); $result=$formfile->list_of_documents($filearray,null,'systemtools','',1,'backup/',1,0,$langs->trans("NoBackupFileAvailable"),0,$langs->trans("PreviousDumpFiles")); print '
'; ?>

2 trans("BackupDesc2",DOL_DATA_ROOT).'
'; print $langs->trans("BackupDescX").'

'; ?>
close();