Merge pull request #14067 from atm-john/11.0_fix_ticket_file_save

Fix ticket file save
This commit is contained in:
Laurent Destailleur 2020-06-11 23:01:33 +02:00 committed by GitHub
commit 7d4a7a4be0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2455,8 +2455,9 @@ class Ticket extends CommonObject
// If destination file already exists, we add a suffix to avoid to overwrite
if (is_file($destfile))
{
$now = dol_now();
$destfile .= '.'.dol_print_date($now, 'dayhourlog');
$pathinfo = pathinfo($filename[$i]);
$now = dol_now();
$destfile = $destdir.'/'.$pathinfo['filename'].' - '.dol_print_date($now, 'dayhourlog').'.'.$pathinfo['extension'];
}
$res = dol_move($filepath[$i], $destfile, 0, 1);