Merge branch '11.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2020-01-17 11:35:16 +01:00
commit 9c1e409feb
6 changed files with 40 additions and 21 deletions

View File

@ -413,11 +413,6 @@ print '<br>';
// Define compressions array
$compression=array();
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',
@ -434,13 +429,18 @@ if (in_array($type, array('mysql', 'mysqli'))) {
'id' => 'radio_compression_bzip',
'label' => $langs->trans("Bzip2")
);
$compression['none'] = array(
'function' => '',
'id' => 'radio_compression_none',
'label' => $langs->trans("None")
);
}
else
{
$compression['none'] = array(
'function' => '',
'id' => 'radio_compression_none',
'label' => $langs->trans("Default")
'label' => $langs->trans("None")
);
$compression['gz'] = array(
'function' => 'gzopen',
@ -455,11 +455,14 @@ print "\n";
print $langs->trans("Compression").': &nbsp; ';
$i = 0;
foreach($compression as $key => $val)
{
if (! $val['function'] || function_exists($val['function'])) {
// Enabled export format
print '<input type="radio" name="compression" value="'.$key.'" id="'.$val['id'].'" checked>';
$checked = '';
if ($key == 'gz') $checked = ' checked';
print '<input type="radio" name="compression" value="'.$key.'" id="'.$val['id'].'"'.$checked.'>';
print ' <label for="'.$val['id'].'">'.$val['label'].'</label>';
}
else
@ -467,9 +470,10 @@ foreach($compression as $key => $val)
// Disabled export format
print '<input type="radio" name="compression" value="'.$key.'" id="'.$val['id'].'" disabled>';
print ' <label for="'.$val['id'].'">'.$val['label'].'</label>';
print ' ('.$langs->trans("NotAvailable").')';
print ' <span class="opacitymedium">('.$langs->trans("NotAvailable").')</span>';
}
print ' &nbsp; &nbsp; ';
$i++;
}
print '</div>';
@ -542,6 +546,7 @@ print "<!-- Dump of a server -->\n";
print '<form method="post" action="export_files.php" name="dump">';
print '<input type="hidden" name="token" value="'.newToken().'" />';
print '<input type="hidden" name="export_type" value="server" />';
print '<input type="hidden" name="page_y" value="" />';
print '<fieldset><legend class="legendforfieldsetstep" style="font-size: 3em">2</legend>';
@ -561,28 +566,33 @@ print '<br>';
// Show compression choices
// Example: With gz choice, you can compress in 5mn, a file of 2GB directory (after compression) with 10 Mb memory.
print '<div class="formelementrow">';
print "\n";
print $langs->trans("Compression").': &nbsp; ';
$filecompression = $compression;
array_shift($filecompression);
unset($filecompression['none']);
$filecompression['zip']= array('function' => 'dol_compress_dir', 'id' => 'radio_compression_zip', 'label' => $langs->trans("FormatZip"));
$i = 0;
foreach($filecompression as $key => $val)
{
if (! $val['function'] || function_exists($val['function'])) // Enabled export format
{
print '<input type="radio" name="compression" value="'.$key.'" id="'.$val['id'].'" checked>';
$checked = '';
if ($key == 'gz') $checked = ' checked';
print '<input type="radio" name="compression" value="'.$key.'" id="'.$val['id'].'"'.$checked.'>';
print ' <label for="'.$val['id'].'">'.$val['label'].'</label>';
}
else // Disabled export format
{
print '<input type="radio" name="compression" value="'.$key.'" id="'.$val['id'].'" disabled>';
print ' <label for="'.$val['id'].'">'.$val['label'].'</label>';
print ' ('.$langs->trans("NotAvailable").')';
print ' <span class="opacitymedium">('.$langs->trans("NotAvailable").')</span>';
}
print ' &nbsp; &nbsp; ';
$i++;
}
print '</div>';
@ -600,7 +610,7 @@ print '<div id="backupdatabaseright" class="fichehalfright" style="height:480px;
print '<div class="ficheaddleft">';
$filearray=dol_dir_list($conf->admin->dir_output.'/documents', 'files', 0, '', '', $sortfield, (strtolower($sortorder)=='asc'?SORT_ASC:SORT_DESC), 1);
$result=$formfile->list_of_documents($filearray, null, 'systemtools', '', 1, 'documents/', 1, 0, $langs->trans("NoBackupFileAvailable"), 0, $langs->trans("PreviousDumpFiles"));
$result=$formfile->list_of_documents($filearray, null, 'systemtools', '', 1, 'documents/', 1, 0, $langs->trans("NoBackupFileAvailable"), 0, $langs->trans("ArchiveFiles"));
print '<br>';
print '</div>';

View File

@ -18,8 +18,8 @@
*/
/**
* \file htdocs/admin/tools/export.php
* \brief Page to export a database into a dump file
* \file htdocs/admin/tools/export_files.php
* \brief Page to export documents into a compressed file
*/
require '../../main.inc.php';
@ -73,7 +73,7 @@ if ($action == 'delete')
*/
// Increase limit of time. Works only if we are not in safe mode
$ExecTimeLimit=600;
$ExecTimeLimit=1800; // 30mn
if (!empty($ExecTimeLimit))
{
$err=error_reporting();
@ -88,7 +88,7 @@ if (!empty($MemoryLimit))
@ini_set('memory_limit', $MemoryLimit);
}
$form=new Form($db);
$form = new Form($db);
$formfile = new FormFile($db);
//$help_url='EN:Backups|FR:Sauvegardes|ES:Copias_de_seguridad';
@ -115,7 +115,14 @@ if ($compression == 'zip')
$ret = dol_compress_dir(DOL_DATA_ROOT, $outputdir."/".$file, $compression, '/(\.log|\/temp\/|documents\/admin\/documents\/)/');
if ($ret < 0)
{
$errormsg = $langs->trans("ErrorFailedToWriteInDir", $outputdir);
if ($ret == -2) {
$langs->load("errors");
$errormsg = $langs->trans("ErrNoZipEngine");
}
else {
$langs->load("errors");
$errormsg = $langs->trans("ErrorFailedToWriteInDir", $outputdir);
}
}
}
elseif (in_array($compression, array('gz', 'bz')))

View File

@ -158,7 +158,7 @@ print '
}
else
{
console.log("We click on tag with .reposition class but element is not an <a> html tag, so we try to update input form field page_y with value "+page_y);
console.log("We click on tag with .reposition class but element is not an <a> html tag, so we try to update input form field with name=page_y with value "+page_y);
jQuery("input[type=hidden][name=page_y]").val(page_y);
}
}

View File

@ -6040,7 +6040,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
$substitutionarray['__REFCLIENT__'] = (isset($object->ref_client) ? $object->ref_client : (isset($object->ref_customer) ? $object->ref_customer : null));
$substitutionarray['__REFSUPPLIER__'] = (isset($object->ref_supplier) ? $object->ref_supplier : null);
$substitutionarray['__SUPPLIER_ORDER_DATE_DELIVERY__'] = (isset($object->date_livraison) ? dol_print_date($object->date_livraison, 'day', 0, $outputlangs) : '');
$substitutionarray['__SUPPLIER_ORDER_DELAY_DELIVERY__'] = (isset($object->availability_code) ? $outputlangs->transnoentities("AvailabilityType".$object->availability_code) : '');
$substitutionarray['__SUPPLIER_ORDER_DELAY_DELIVERY__'] = $outputlangs->transnoentities("AvailabilityType".$object->availability_code)!=('AvailabilityType'.$object->availability_code)?$outputlangs->transnoentities("AvailabilityType".$object->availability_code):$outputlangs->convToOutputCharset(isset($object->availability)?$object->availability:'');
$birthday = dol_print_date($object->birth, 'day');

View File

@ -991,7 +991,9 @@ if ((empty($id) && empty($ref)) || $action == 'add' || $action == 'request' || $
{
$nb_type = $object->getCPforUser($user->id, $val['rowid']);
$nb_holiday += $nb_type;
$out .= ' - '.$val['label'].': <strong>'.($nb_type ?price2num($nb_type) : 0).'</strong><br>';
$out .= ' - ' . ($langs->trans($val['code']) != $val['code'] ? $langs->trans($val['code']) : $val['label']) .': <strong>'.($nb_type ?price2num($nb_type) : 0).'</strong><br>';
//$out .= ' - '.$val['label'].': <strong>'.($nb_type ?price2num($nb_type) : 0).'</strong><br>';
}
print $langs->trans('SoldeCPUser', round($nb_holiday, 5)).'<br>';
print $out;

View File

@ -1156,7 +1156,7 @@ NoEventOrNoAuditSetup=No security event has been logged. This is normal if Audit
NoEventFoundWithCriteria=No security event has been found for this search criteria.
SeeLocalSendMailSetup=See your local sendmail setup
BackupDesc=A <b>complete</b> backup of a Dolibarr installation requires two steps.
BackupDesc2=Backup the contents of the "documents" directory (<b>%s</b>) containing all uploaded and generated files. This will also include all the dump files generated in Step 1.
BackupDesc2=Backup the contents of the "documents" directory (<b>%s</b>) containing all uploaded and generated files. This will also include all the dump files generated in Step 1. This operation may last several minutes.
BackupDesc3=Backup the structure and contents of your database (<b>%s</b>) into a dump file. For this, you can use the following assistant.
BackupDescX=The archived directory should be stored in a secure place.
BackupDescY=The generated dump file should be stored in a secure place.