This commit is contained in:
Laurent Destailleur 2019-12-20 17:06:32 +01:00
parent c0ef3b46ad
commit 1288eb54c2

View File

@ -99,6 +99,7 @@ if (empty($conf->global->EXPENSEREPORT_DISABLE_ATTACHMENT_ON_LINES))
$checked=''; $checked='';
//var_dump(GETPOST($file['relativename'])); var_dump($file['relativename']); var_dump($_FILES['userfile']['name']); //var_dump(GETPOST($file['relativename'])); var_dump($file['relativename']); var_dump($_FILES['userfile']['name']);
// If a file was just uploaded, we check to preselect it // If a file was just uploaded, we check to preselect it
if (is_array($_FILES['userfile']['name'])) {
foreach($_FILES['userfile']['name'] as $tmpfile) foreach($_FILES['userfile']['name'] as $tmpfile)
{ {
if ($file['relativename'] == (GETPOST('savingdocmask', 'alpha') ? dol_sanitizeFileName($object->ref.'-') : '').$tmpfile) if ($file['relativename'] == (GETPOST('savingdocmask', 'alpha') ? dol_sanitizeFileName($object->ref.'-') : '').$tmpfile)
@ -111,6 +112,7 @@ if (empty($conf->global->EXPENSEREPORT_DISABLE_ATTACHMENT_ON_LINES))
break; break;
} }
} }
}
// If we edit a line already linked, then $filenamelinked is defined to the filename (without path) of linked file // If we edit a line already linked, then $filenamelinked is defined to the filename (without path) of linked file
if (! empty($filenamelinked) && $filenamelinked == $file['relativename']) if (! empty($filenamelinked) && $filenamelinked == $file['relativename'])
{ {