Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Maarch
MaarchCourrier
Commits
bbfaa2e1
Commit
bbfaa2e1
authored
Jan 27, 2022
by
Jean-Laurent DUZANT
Browse files
FIX #19325 TIME 0:01 fix php
PSR-12
&& table width - Jean-Laurent
parent
63ba0c62
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/app/convert/controllers/ConvertPdfController.php
View file @
bbfaa2e1
...
...
@@ -38,8 +38,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
...
...
src/app/resource/controllers/FolderPrintController.php
View file @
bbfaa2e1
...
...
@@ -980,13 +980,13 @@ class FolderPrintController
$status
=
_EMAIL_ERROR_SENT
;
}
$widthTable_px
=
"1
2
00
px
"
;
$widthTable_px
=
"100
%
"
;
$cellPaddingBottom_px
=
"30px"
;
$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>
...
...
@@ -994,27 +994,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>
...
...
@@ -1023,16 +1023,16 @@ 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
)
{
ValidatorModel
::
notEmpty
(
$args
,
[
'units'
,
'resId'
]);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment