FIX 11.0 - when using pdftk as per hidden conf USE_PDFTK_FOR_PDF_CONCAT, check that the file exists before displaying a success message
This commit is contained in:
parent
2b317120d3
commit
3213148d87
@ -1030,14 +1030,18 @@ if (!$error && $massaction == "builddoc" && $permissiontoread && !GETPOST('butto
|
|||||||
$input_files .= ' '.escapeshellarg($f);
|
$input_files .= ' '.escapeshellarg($f);
|
||||||
}
|
}
|
||||||
|
|
||||||
$cmd = 'pdftk '.escapeshellarg($input_files).' cat output '.escapeshellarg($file);
|
$cmd = 'pdftk ' . $input_files . ' cat output '.escapeshellarg($file);
|
||||||
exec($cmd);
|
exec($cmd);
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_UMASK))
|
// check if pdftk is installed
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
if (file_exists($file)) {
|
||||||
|
if (!empty($conf->global->MAIN_UMASK))
|
||||||
$langs->load("exports");
|
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||||
setEventMessages($langs->trans('FileSuccessfullyBuilt', $filename.'_'.dol_print_date($now, 'dayhourlog')), null, 'mesgs');
|
$langs->load("exports");
|
||||||
|
setEventMessages($langs->trans('FileSuccessfullyBuilt', $filename.'_'.dol_print_date($now, 'dayhourlog')), null, 'mesgs');
|
||||||
|
} else {
|
||||||
|
setEventMessages($langs->trans('ErrorPDFTkOutputFileNotFound'), null, 'errors');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -837,6 +837,7 @@ Sincerely=Sincerely
|
|||||||
ConfirmDeleteObject=Are you sure you want to delete this object?
|
ConfirmDeleteObject=Are you sure you want to delete this object?
|
||||||
DeleteLine=Delete line
|
DeleteLine=Delete line
|
||||||
ConfirmDeleteLine=Are you sure you want to delete this line?
|
ConfirmDeleteLine=Are you sure you want to delete this line?
|
||||||
|
ErrorPDFTkOutputFileNotFound=Error: the file was not generated. Please check that the 'pdftk' command is installed in a directory included in the $PATH environment variable (linux/unix only) or contact your system administrator.
|
||||||
NoPDFAvailableForDocGenAmongChecked=No PDF were available for the document generation among checked record
|
NoPDFAvailableForDocGenAmongChecked=No PDF were available for the document generation among checked record
|
||||||
TooManyRecordForMassAction=Too many records selected for mass action. The action is restricted to a list of %s records.
|
TooManyRecordForMassAction=Too many records selected for mass action. The action is restricted to a list of %s records.
|
||||||
NoRecordSelected=No record selected
|
NoRecordSelected=No record selected
|
||||||
@ -1017,4 +1018,4 @@ ContactDefault_ticket=Ticket
|
|||||||
ContactAddedAutomatically=Contact added from contact thirdparty roles
|
ContactAddedAutomatically=Contact added from contact thirdparty roles
|
||||||
More=More
|
More=More
|
||||||
ShowDetails=Show details
|
ShowDetails=Show details
|
||||||
CustomReports=Custom reports
|
CustomReports=Custom reports
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user