From eb5b6efd4000c822fe29589990b65ff9612f85c2 Mon Sep 17 00:00:00 2001 From: "cam.lafit" Date: Mon, 6 Jan 2014 19:25:25 +0100 Subject: [PATCH 1/2] Execute in background process libreoffice listener * If listener is not started, script try to run it but can't continue processus --- scripts/odt2pdf/odt2pdf.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/odt2pdf/odt2pdf.sh b/scripts/odt2pdf/odt2pdf.sh index 9268b4a680f..0599e4291c5 100755 --- a/scripts/odt2pdf/odt2pdf.sh +++ b/scripts/odt2pdf/odt2pdf.sh @@ -22,7 +22,7 @@ if [ -f "$1.odt" ] nbprocess=$(pgrep -c soffice) if [ $nbprocess -ne 1 ] then - soffice --invisible --accept="socket,host=127.0.0.1,port=8100;urp;" --nofirststartwizard --headless + soffice --invisible --accept="socket,host=127.0.0.1,port=8100;urp;" --nofirststartwizard --headless& retcode=$? if [ $retcode -ne 0 ] then From 1229842dc67a9a046e7e12d526685d737afacb0f Mon Sep 17 00:00:00 2001 From: "cam.lafit" Date: Mon, 6 Jan 2014 19:27:12 +0100 Subject: [PATCH 2/2] Provide a new constant about odt2pdf mangement : Don't remove odt source * MAIN_ODT_AS_PDF_DEL_SOURCE by default disable * If set then initial behaviour is conserved, odt file is removed --- htdocs/includes/odtphp/odf.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/includes/odtphp/odf.php b/htdocs/includes/odtphp/odf.php index d2cb8e0b6e1..2848ddc8ddb 100644 --- a/htdocs/includes/odtphp/odf.php +++ b/htdocs/includes/odtphp/odf.php @@ -478,7 +478,8 @@ IMG; header('Content-Disposition: attachment; filename="'.$name.'.pdf"'); readfile("$name.pdf"); } - unlink("$name.odt"); + if (!empty($conf->global->MAIN_ODT_AS_PDF_DEL_SOURCE)) + unlink("$name.odt"); } else { dol_syslog(get_class($this).'::exportAsAttachedPDF $ret_val='.$retval, LOG_DEBUG); dol_syslog(get_class($this).'::exportAsAttachedPDF $output_arr='.var_export($output_arr,true), LOG_DEBUG); @@ -555,4 +556,4 @@ IMG; } } -?> \ No newline at end of file +?>