Commit ade7b968 authored by Jean-Laurent DUZANT's avatar Jean-Laurent DUZANT
Browse files

FIX #19325 TIME 0:01 fix php PSR-12 && table width - Jean-Laurent

parent ca73fe12
......@@ -37,8 +37,8 @@ class ConvertPdfController
$tmpPath = CoreConfigModel::getTmpPath();
$extension = pathinfo($aArgs['fullFilename'], PATHINFO_EXTENSION);
if (strtolower($extension) == 'html' || strtolower($extension) == 'htm') {
$pdfFilepath = str_replace('.'.$extension, '', $aArgs['fullFilename']) . '.pdf';
$command = "wkhtmltopdf -B 10mm -L 10mm -R 10mm -T 10mm --load-error-handling ignore --load-media-error-handling ignore --encoding utf-8 ".$aArgs['fullFilename']." ".$pdfFilepath;
$pdfFilepath = str_replace('.' . $extension, '', $aArgs['fullFilename']) . '.pdf';
$command = "wkhtmltopdf -B 10mm -L 10mm -R 10mm -T 10mm --load-error-handling ignore --load-media-error-handling ignore --encoding utf-8 " . $aArgs['fullFilename'] . " " . $pdfFilepath;
// Check if xvfb-run is installed, and run wkhtmltopdf with it
// Necessary when running in a headless debian server
......
......@@ -976,7 +976,7 @@ class FolderPrintController
$emailMeta = "<table style=\"width: $widthTable_px;\" cellspacing=\"0\" cellpadding=\"5\">
<tbody>
<tr style=\"border-syle: none;\">
<td style=\"\"><b>"._EMAIL."</b></td>
<td style=\"\"><b>" . _EMAIL . "</b></td>
<td style=\"text-align: right; \">$sentDate</td>
</tr>
</tbody>
......@@ -984,27 +984,27 @@ class FolderPrintController
<table style=\"width: $widthTable_px; border-style: solid; border-color: #000000;\" border=\"1\" cellspacing=\"0\" cellpadding=\"5\">
<tbody>
<tr>
<td style=\"padding-bottom: $cellPaddingBottom_px;\"><b>"._SENDER."</b></td>
<td style=\"padding-bottom: $cellPaddingBottom_px;\"><b>" . _SENDER . "</b></td>
<td style=\"padding-bottom: $cellPaddingBottom_px;\">$sender</td>
</tr>
<tr>
<td style=\"padding-bottom: $cellPaddingBottom_px;\"><b>"._RECIPIENTS."</b></td>
<td style=\"padding-bottom: $cellPaddingBottom_px;\"><b>" . _RECIPIENTS . "</b></td>
<td style=\"padding-bottom: $cellPaddingBottom_px;\">$recipients</td>
</tr>
<tr>
<td style=\"padding-bottom: $cellPaddingBottom_px;\"><b>"._TO_CC."</b></td>
<td style=\"padding-bottom: $cellPaddingBottom_px;\"><b>" . _TO_CC . "</b></td>
<td style=\"padding-bottom: $cellPaddingBottom_px;\">$recipientsCopy</td>
</tr>
<tr>
<td style=\"padding-bottom: $cellPaddingBottom_px;\"><b>"._TO_CCI."</b></td>
<td style=\"padding-bottom: $cellPaddingBottom_px;\"><b>" . _TO_CCI . "</b></td>
<td style=\"padding-bottom: $cellPaddingBottom_px;\">$recipientsCopyHidden</td>
</tr>
<tr>
<td style=\"padding-bottom: $cellPaddingBottom_px;\"><b>"._SUBJECT."</b></td>
<td style=\"padding-bottom: $cellPaddingBottom_px;\"><b>" . _SUBJECT . "</b></td>
<td style=\"padding-bottom: $cellPaddingBottom_px;\">$subject</td>
</tr>
<tr>
<td style=\"padding-bottom: $cellPaddingBottom_px;\"><b>"._STATUS."</b></td>
<td style=\"padding-bottom: $cellPaddingBottom_px;\"><b>" . _STATUS . "</b></td>
<td style=\"padding-bottom: $cellPaddingBottom_px;\">$status</td>
</tr>
</tbody>
......@@ -1013,14 +1013,14 @@ class FolderPrintController
$tmpDir = CoreConfigModel::getTmpPath();
$filePathInTmpNoExtension = $tmpDir . 'email_' . $email['id'] . '_' . $GLOBALS['id'];
file_put_contents($filePathInTmpNoExtension.'.html', mb_convert_encoding($emailMeta_emailDataBody, 'HTML', 'UTF-8'));
ConvertPdfController::convertInPdf(['fullFilename' => $filePathInTmpNoExtension.'.html']);
file_put_contents($filePathInTmpNoExtension . '.html', mb_convert_encoding($emailMeta_emailDataBody, 'HTML', 'UTF-8'));
ConvertPdfController::convertInPdf(['fullFilename' => $filePathInTmpNoExtension . '.html']);
if (file_exists($filePathInTmpNoExtension.'.html')) {
unlink($filePathInTmpNoExtension.'.html');
if (file_exists($filePathInTmpNoExtension . '.html')) {
unlink($filePathInTmpNoExtension . '.html');
}
return $filePathInTmpNoExtension.'.pdf';
return $filePathInTmpNoExtension . '.pdf';
}
private static function getSummarySheet(array $args)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment