From 1277e3617978241de8196e4789e82f7e76056ae2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 Jun 2019 13:30:18 +0200 Subject: [PATCH 1/3] Prepare 9.0.4 --- ChangeLog | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/ChangeLog b/ChangeLog index 2a4aa492055..0ec173983e1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,54 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 9.0.4 compared to 9.0.3 ***** +FIX: #5249 +FIX: #11025 +FIX: #11032 +FIX: #11097 +FIX: #11169 +FIX: #11202 +FIX: #11244 +FIX: #11296 +FIX: #11316 +FIX: #11335 +FIX: Add missing end date of subscription in export +FIX: A user may read holiday and expense report without permissions +FIX: better syntax +FIX: condition +FIX: confirmation of mass email sending + option MAILING_NO_USING_PHPMAIL +FIX: crabe pdf: bad detailed VAT for situation invoices, in situations S2 and above +FIX: default value for duration of validity can be set from generic +FIX: do not include tpl from disabled modules +FIX: Error management when MAILING_NO_USING_PHPMAIL is set +FIX: Even with permission, can't validate leave once validator defined. +FIX: extrafield list search: SQL error when field is multiselect +FIX: if last char of customercode is accent making the truncate of first +FIX: Import of chart of account +FIX: in edit mode, dictionary inputs do not escape the string inside the 'value' attribute, causing errors if there are any double quotes +FIX: invalid link on user.fk_user +FIX: invoice class: bad SQL request if product type not set +FIX: javascript error when ckeditor module not enabled +FIX: mail presend: can overwrite a file previously uploaded (Issue #11056) +FIX: mass send mail +FIX: missing compatibility with multicompany transverse mode +FIX: missing llx_const encrypt +FIX: modulebuilder: hardcoded llx_ +FIX: Not showing Contract and Project columns on ficheinter list +FIX: only profid1 to 4 were editable for pdf option to show. Not 5 and 6. +FIX: productaccount buylist with pages +FIX: remove isolated transaction commit +FIX: security (a user can read leave or holiday of other without perm. +FIX: situation invoices: bad detailed VAT in situations following the first one +FIX: situation invoices: block progress percentage change for discount lines +FIX: syntax error +FIX: the id was not loaded in fetch of accounting system +FIX: try to use WHERE EXISTS instead of DISTINCT +FIX: use dol_sanitizeFileName() function to remove double spaces in filenames, as well as done on document.php when we want to download pdf +FIX: Use of cron with multicompany +FIX: var name +FIX: we need to fetch fourn invoice with ref in current entity +FIX: Wrong stock movement on supplier credit notes ***** ChangeLog for 9.0.3 compared to 9.0.2 ***** FIX: #11013 From 4696d35bcbc5db53a46fd66a03bb4d8ecd08ab7b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 Jun 2019 19:02:24 +0200 Subject: [PATCH 2/3] Fix we need to keep temp dir --- htdocs/core/class/utils.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index 3d43a319e51..8f2b1ef303e 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -165,6 +165,12 @@ class Utils } else $this->output=$langs->trans("PurgeNothingToDelete").($choice == 'tempfilesold' ? ' (older than 24h)':''); + // Recreate temp dir that are not automatically recreated for performance purpose + if (! empty($conf->api->enabled)) + { + dol_mkdir($conf->api->dir_temp); + } + //return $count; return 0; // This function can be called by cron so must return 0 if OK } From d41850c7cdf0e326815b3e7a9906506f0655d124 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 Jun 2019 20:02:14 +0200 Subject: [PATCH 3/3] Fix purge of old files --- htdocs/core/class/utils.class.php | 25 +++++++++++++++---------- htdocs/langs/en_US/admin.lang | 2 +- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index 8f2b1ef303e..6b6d2d42c67 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -50,33 +50,36 @@ class Utils * Purge files into directory of data files. * CAN BE A CRON TASK * - * @param string $choice Choice of purge mode ('tempfiles', '' or 'tempfilesold' to purge temp older than 24h, 'allfiles', 'logfile') - * @return int 0 if OK, < 0 if KO (this function is used also by cron so only 0 is OK) + * @param string $choice Choice of purge mode ('tempfiles', '' or 'tempfilesold' to purge temp older than $nbsecondsold seconds, 'allfiles', 'logfile') + * @param int $nbsecondsold Nb of seconds old to accept deletion of a directory if $choice is 'tempfilesold' + * @return int 0 if OK, < 0 if KO (this function is used also by cron so only 0 is OK) */ - function purgeFiles($choice='tempfilesold') + function purgeFiles($choice = 'tempfilesold', $nbsecondsold = 86400) { global $conf, $langs, $dolibarr_main_data_root; $langs->load("admin"); - dol_syslog("Utils::purgeFiles choice=".$choice, LOG_DEBUG); require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $filesarray=array(); if (empty($choice)) $choice='tempfilesold'; + dol_syslog("Utils::purgeFiles choice=".$choice, LOG_DEBUG); + if ($choice=='tempfiles' || $choice=='tempfilesold') { // Delete temporary files if ($dolibarr_main_data_root) { - $filesarray=dol_dir_list($dolibarr_main_data_root, "directories", 1, '^temp$', '', 'name', SORT_ASC, 2, 0, '', 1); // Do not follow symlinks - if ($choice == 'tempfilesold') + $filesarray=dol_dir_list($dolibarr_main_data_root, "directories", 1, '^temp$', '', 'name', SORT_ASC, 2, 0, '', 1); // Do not follow symlinks + + if ($choice == 'tempfilesold') { $now = dol_now(); foreach($filesarray as $key => $val) { - if ($val['date'] > ($now - (24 * 3600))) unset($filesarray[$key]); // Discard files not older than 24h + if ($val['date'] > ($now - ($nbsecondsold))) unset($filesarray[$key]); // Discard temp dir not older than $nbsecondsold } } } @@ -119,13 +122,14 @@ class Utils $counterror=0; if (count($filesarray)) { - foreach($filesarray as $key => $value) + foreach($filesarray as $key => $value) { //print "x ".$filesarray[$key]['fullname']."-".$filesarray[$key]['type']."
\n"; - if ($filesarray[$key]['type'] == 'dir') + if ($filesarray[$key]['type'] == 'dir') { $startcount=0; $tmpcountdeleted=0; + $result=dol_delete_dir_recursive($filesarray[$key]['fullname'], $startcount, 1, 0, $tmpcountdeleted); $count+=$result; $countdeleted+=$tmpcountdeleted; @@ -165,11 +169,12 @@ class Utils } else $this->output=$langs->trans("PurgeNothingToDelete").($choice == 'tempfilesold' ? ' (older than 24h)':''); - // Recreate temp dir that are not automatically recreated for performance purpose + // Recreate temp dir that are not automatically recreated by core code for performance purpose, we need them if (! empty($conf->api->enabled)) { dol_mkdir($conf->api->dir_temp); } + dol_mkdir($conf->user->dir_temp); //return $count; return 0; // This function can be called by cron so must return 0 if OK diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 256cdc46105..a05eb631e13 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -145,7 +145,7 @@ SystemToolsAreaDesc=This area provides administration features. Use the menu to Purge=Purge PurgeAreaDesc=This page allows you to delete all files generated or stored by Dolibarr (temporary files or all files in %s directory). Using this feature is not necessary. It is provided as a workaround for users whose Dolibarr is hosted by a provider that does not offer permissions to delete files generated by the web server. PurgeDeleteLogFile=Delete log files, including %s defined for Syslog module (no risk of losing data) -PurgeDeleteTemporaryFiles=Delete all temporary files (no risk of losing data) +PurgeDeleteTemporaryFiles=Delete all temporary files (no risk of losing data). Note: Deletion is done only if the temp directory was created 24 hours ago. PurgeDeleteTemporaryFilesShort=Delete temporary files PurgeDeleteAllFilesInDocumentsDir=Delete all files in directory %s. Temporary files but also database backup dumps, files attached to elements (third parties, invoices, ...) and uploaded into the ECM module will be deleted. PurgeRunNow=Purge now