diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php index d8f8f284e0e..431de103fd3 100644 --- a/htdocs/admin/system/filecheck.php +++ b/htdocs/admin/system/filecheck.php @@ -77,17 +77,22 @@ if (file_exists($xmlfile)) $xml = simplexml_load_file($xmlfile); if ($xml) { - $ret = getFilesUpdated($xml->dolibarr_root_dir[0]); // Fill array $file_list + $file_list = array(); + $ret = getFilesUpdated($file_list, $xml->dolibarr_root_dir[0]); // Fill array $file_list + print ''; print ''; print ''; + print ''; print ''."\n"; $var = true; - foreach ($file_list['missing'] as $file) + $tmpfilelist = dol_sort_array($file_list['missing'], 'filename'); + foreach ($tmpfilelist as $file) { $var = !$var; print ''; - print '' . "\n"; + print '' . "\n"; + print '' . "\n"; print "\n"; } print '
' . $langs->trans("FilesMissing") . '' . $langs->trans("ExpectedChecksum") . '
'.$file.''.$file['filename'].''.$file['expectedmd5'].'
'; @@ -97,17 +102,22 @@ if (file_exists($xmlfile)) print ''; print ''; print ''; + print ''; + print ''; print ''; - print ''; + print ''; print ''."\n"; $var = true; - foreach ($file_list['updated'] as $file) + $tmpfilelist = dol_sort_array($file_list['updated'], 'filename'); + foreach ($tmpfilelist as $file) { $var = !$var; print ''; - print '' . "\n"; - print '' . "\n"; - print '' . "\n"; + print '' . "\n"; + print '' . "\n"; + print '' . "\n"; + print '' . "\n"; + print '' . "\n"; print "\n"; } print '
' . $langs->trans("FilesUpdated") . '' . $langs->trans("ExpectedChecksum") . '' . $langs->trans("CurrentChecksum") . '' . $langs->trans("Size") . '' . $langs->trans("DateModification") . '' . $langs->trans("DateModification") . '
'.$file.''.dol_print_size(dol_filesize(DOL_DOCUMENT_ROOT.'/'.$file)).''.dol_print_date(dol_filemtime(DOL_DOCUMENT_ROOT.'/'.$file),'dayhour').''.$file['filename'].''.$file['expectedmd5'].''.$file['md5'].''.dol_print_size(dol_filesize(DOL_DOCUMENT_ROOT.'/'.$file['filename'])).''.dol_print_date(dol_filemtime(DOL_DOCUMENT_ROOT.'/'.$file['filename']),'dayhour').'
'; @@ -124,34 +134,36 @@ $db->close(); /** - * Function to get list of updated or modified files + * Function to get list of updated or modified files. + * $file_list is used as global variable * - * @param SimpleXMLElement $dir SimpleXMLElement of files to test - * @param string $path Path of file - * @return array Array of filenames + * @param array $file_list Array for response + * @param SimpleXMLElement $dir SimpleXMLElement of files to test + * @param string $path Path of file + * @return array Array of filenames */ -function getFilesUpdated(SimpleXMLElement $dir, $path = '') +function getFilesUpdated(&$file_list, SimpleXMLElement $dir, $path = '') { - global $file_list; $exclude = 'install'; foreach ($dir->md5file as $file) { $filename = $path.$file['name']; - if (preg_match('#'.$exclude.'#', $filename)) - continue; + if (preg_match('#'.$exclude.'#', $filename)) continue; - if (!file_exists(DOL_DOCUMENT_ROOT.'/'.$filename)) { - $file_list['missing'][] = $filename; - } else { + if (!file_exists(DOL_DOCUMENT_ROOT.'/'.$filename)) + { + $file_list['missing'][] = array('filename'=>$filename, 'expectedmd5'=>(string) $file); + } + else + { $md5_local = md5_file(DOL_DOCUMENT_ROOT.'/'.$filename); - if ($md5_local != (string) $file) - $file_list['updated'][] = $filename; + if ($md5_local != (string) $file) $file_list['updated'][] = array('filename'=>$filename, 'expectedmd5'=>(string) $file, 'md5'=>(string) $md5_local); } } - foreach ($dir->dir as $subdir) - getFilesUpdated($subdir, $path.$subdir['name'].'/'); - return $file_list; + foreach ($dir->dir as $subdir) getFilesUpdated($file_list, $subdir, $path.$subdir['name'].'/'); + + return $file_list; } diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index 88184065574..6f1783e5d11 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2006-2015 Laurent Destailleur * Copyright (C) 2006-2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -66,6 +66,8 @@ $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); @@ -101,8 +103,8 @@ jQuery(document).ready(function() { }); }); @@ -133,7 +135,7 @@ print '
'; print_titre($title?$title:$langs->trans("BackupDumpWizard")); -print ''; +print '
'; print ''; print '
'; print $langs->trans("DatabaseName").' : '.$dolibarr_main_db_name.'
'; @@ -148,7 +150,7 @@ print '
';
trans("ExportMethod"); ?>
@@ -160,7 +162,7 @@ print '
';
@@ -182,7 +184,7 @@ print '
';
trans("MySqlExportParameters"); ?> @@ -317,7 +319,7 @@ print '
';
trans("PostgreSqlExportParameters"); ?> @@ -382,9 +384,9 @@ print '
'; value="" />
@@ -394,7 +396,7 @@ echo $file; // Define compressions array $compression=array(); -if ($label == 'MySQL') +if (in_array($type, array('mysql', 'mysqli'))) { $compression['none'] = array('function' => '', 'id' => 'radio_compression_none', 'label' => $langs->trans("None")); $compression['gz'] = array('function' => 'gzopen', 'id' => 'radio_compression_gzip', 'label' => $langs->trans("Gzip")); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 6d1b24a2bc1..59645976c7c 100755 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1023,7 +1023,7 @@ NoEventOrNoAuditSetup=No security event has been recorded yet. This can be norma NoEventFoundWithCriteria=No security event has been found for such search criterias. SeeLocalSendMailSetup=See your local sendmail setup BackupDesc=To make a complete backup of Dolibarr, you must: -BackupDesc2=Save content of documents directory (%s) that contains all uploaded and generated files (you can make a zip for example). +BackupDesc2=Save content of documents directory (%s) that contains all uploaded and generated files (So it includes all dump files generated at step 1). BackupDesc3=Save content of your database (%s) into a dump file. For this, you can use following assistant. BackupDescX=Archived directory should be stored in a secure place. BackupDescY=The generated dump file should be stored in a secure place.