Update actions_massactions.inc.php

This commit is contained in:
Laurent Destailleur 2019-06-12 12:33:31 +02:00 committed by GitHub
parent 47746fd17d
commit 0bf7512f28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -257,10 +257,14 @@ if (! $error && $massaction == 'confirm_presend')
{
// TODO Use future field $objectobj->fullpathdoc to know where is stored default file
// TODO If not defined, use $objectobj->modelpdf (or defaut invoice config) to know what is template to use to regenerate doc.
$filename=dol_sanitizeFileName($objectobj->ref).'.pdf';
$filedir=$uploaddir . '/' . dol_sanitizeFileName($objectobj->ref);
$filename = dol_sanitizeFileName($objectobj->ref).'.pdf';
$subdir = '';
// TODO Set subdir to be compatible with multi levels dir trees
// $subdir = get_exdir($objectobj->id, 2, 0, 0, $objectobj, $objectobj->element)
$filedir = $uploaddir . '/' . $subdir . dol_sanitizeFileName($objectobj->ref);
$file = $filedir . '/' . $filename;
// For supplier invoices, we use the file provided by supplier, not the one we generate
if ($objectobj->element == 'invoice_supplier')
{
$fileparams = dol_most_recent_file($uploaddir . '/' . get_exdir($objectobj->id,2,0,0,$objectobj,$objectobj->element).$objectobj->ref, preg_quote($objectobj->ref,'/').'([^\-])+');