Debug génération PDF

This commit is contained in:
Adrien RENARD 2024-01-27 01:31:22 +01:00
parent 7631ace2d5
commit ec321d26d6
4 changed files with 20 additions and 29 deletions

3
conf/.gitignore vendored
View File

@ -2,4 +2,5 @@
* *
# But not these files... # But not these files...
!.gitignore !.gitignore
!*.php !*.php
!*.sql

View File

@ -286,15 +286,13 @@ function eraseContrat($id) {
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
function printContratsList($list) { function printContratsList($list) {
$GLOBALS['smarty'] -> assign('logo', PUBLIC_HTML_ADMIN.'img/logo.png'); $GLOBALS['smarty'] -> assign('logo', "file://".PUBLIC_HTML_ADMIN_PATH."/img/logo.png");
$GLOBALS['smarty'] -> assign('date', formatDate('', '', 'print_date')); $GLOBALS['smarty'] -> assign('date', formatDate('', '', 'print_date'));
$GLOBALS['smarty'] -> assign('time', formatDate('', '', 'print_time')); $GLOBALS['smarty'] -> assign('time', formatDate('', '', 'print_time'));
$GLOBALS['smarty'] -> assign('cssFiles',array(
$cssFiles = array( "file://".PUBLIC_HTML_ADMIN_PATH."css/bootstrap_print_light.css",
PUBLIC_HTML_ADMIN.'css/bootstrap_print_light.css', "file://".PUBLIC_HTML_ADMIN_PATH."css/print.css"
PUBLIC_HTML_ADMIN.'css/print.css' ));
);
$GLOBALS['smarty'] -> assign('cssFiles',$cssFiles);
// LIST // LIST
$pList = array(); $pList = array();
@ -343,9 +341,8 @@ function printContratsList($list) {
$GLOBALS['smarty'] -> assign('list',$pList); $GLOBALS['smarty'] -> assign('list',$pList);
$html = $GLOBALS['smarty']->fetch("contrats/contrats_list_print.tpl"); $html = $GLOBALS['smarty']->fetch("contrats/contrats_list_print.tpl");
// die($html);
$dompdf = new Dompdf\Dompdf(); $dompdf = new Dompdf\Dompdf(["chroot" => ROOT_DIR_PATH]);
$dompdf->loadHtml($html); $dompdf->loadHtml($html);
$dompdf->setPaper('A4', "portrait"); $dompdf->setPaper('A4', "portrait");
$options = $dompdf->getOptions(); $options = $dompdf->getOptions();

View File

@ -370,19 +370,15 @@ function eraseLegumeTarif($id) {
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
function printLegumesList() { function printLegumesList() {
$root_url = "file://".ROOT_DIR_PATH."public_html_admin"; $GLOBALS['smarty'] -> assign('logo', "file://".PUBLIC_HTML_ADMIN_PATH."/img/logo.png");
$GLOBALS['smarty'] -> assign('logo', "$root_url/img/logo.png");
$GLOBALS['smarty'] -> assign('date', formatDate('', '', 'print_date')); $GLOBALS['smarty'] -> assign('date', formatDate('', '', 'print_date'));
$GLOBALS['smarty'] -> assign('time', formatDate('', '', 'print_time')); $GLOBALS['smarty'] -> assign('time', formatDate('', '', 'print_time'));
$GLOBALS['smarty'] -> assign('cssFiles',array(
$cssFiles = array( "file://".PUBLIC_HTML_ADMIN_PATH."css/bootstrap_print_light.css",
"$root_url/css/bootstrap_print_light.css", "file://".PUBLIC_HTML_ADMIN_PATH."css/print.css"
"$root_url/css/print.css", ));
);
$GLOBALS['smarty'] -> assign('cssFiles',$cssFiles);
$html = $GLOBALS['smarty']->fetch("legumes/legumes_list_print.tpl"); $html = $GLOBALS['smarty']->fetch("legumes/legumes_list_print.tpl");
//die($html);
$dompdf = new Dompdf\Dompdf(["chroot" => ROOT_DIR_PATH]); $dompdf = new Dompdf\Dompdf(["chroot" => ROOT_DIR_PATH]);
$dompdf->loadHtml($html); $dompdf->loadHtml($html);

View File

@ -687,20 +687,17 @@ function clearLivraisonLegumes($livraison) {
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
function exportLivraisonTemplateToPDF($templateFile, $outputFileName, $orientation='portrait') { function exportLivraisonTemplateToPDF($templateFile, $outputFileName, $orientation='portrait') {
$GLOBALS['smarty'] -> assign('logo', PUBLIC_HTML_ADMIN.'img/logo.png'); $GLOBALS['smarty'] -> assign('logo', "file://".PUBLIC_HTML_ADMIN_PATH."/img/logo.png");
$GLOBALS['smarty'] -> assign('cssFiles',array(
$cssFiles = array( "file://".PUBLIC_HTML_ADMIN_PATH."css/bootstrap_print_light.css",
PUBLIC_HTML_ADMIN.'css/bootstrap_print_light.css', "file://".PUBLIC_HTML_ADMIN_PATH."css/print.css",
PUBLIC_HTML_ADMIN.'css/print.css', "file://".PUBLIC_HTML_ADMIN_PATH."css/livraisons.css"
PUBLIC_HTML_ADMIN.'css/livraisons.css' ));
);
$GLOBALS['smarty'] -> assign('cssFiles',$cssFiles);
$GLOBALS['smarty'] -> assign('orientation',$orientation); $GLOBALS['smarty'] -> assign('orientation',$orientation);
$html = $GLOBALS['smarty']->fetch($templateFile); $html = $GLOBALS['smarty']->fetch($templateFile);
// die($html);
$dompdf = new Dompdf\Dompdf(); $dompdf = new Dompdf\Dompdf(["chroot" => ROOT_DIR_PATH]);
$dompdf->loadHtml($html); $dompdf->loadHtml($html);
$dompdf->setPaper('A4', $orientation); $dompdf->setPaper('A4', $orientation);
$options = $dompdf->getOptions(); $options = $dompdf->getOptions();