diff --git a/htdocs/don/document.php b/htdocs/don/document.php index 030ca5cb085..c04d6e4a760 100644 --- a/htdocs/don/document.php +++ b/htdocs/don/document.php @@ -77,7 +77,10 @@ if (!$sortfield) { $object = new Don($db); $object->fetch($id, $ref); -$upload_dir = $conf->don->dir_output.'/'.get_exdir($filename, 0, 0, 0, $object, 'donation').'/'.dol_sanitizeFileName($object->ref); +if ($id > 0 || !empty($ref)) { + $upload_dir = $conf->don->multidir_output[$object->entity ? $object->entity : $conf->entity]."/".get_exdir(0, 0, 0, 1, $object); +} + $modulepart = 'don'; $permissiontoadd = $user->rights->don->creer; // Used by the include of actions_dellink.inc.php