diff --git a/htdocs/comm/propal/apercu.php b/htdocs/comm/propal/apercu.php
index 7864f3eba8d..b7ce71ff61b 100644
--- a/htdocs/comm/propal/apercu.php
+++ b/htdocs/comm/propal/apercu.php
@@ -163,15 +163,15 @@ if ($_GET["propalid"] > 0)
* Documents
*/
$propalref = sanitize_string($propal->ref);
- $file = $conf->propal->dir_output . "/" . $propalref . "/" . $propalref . ".pdf";
- $filedetail = $conf->propal->dir_output . "/" . $propalref . "/" . $propalref . "-detail.pdf";
+ $dir_output = $conf->propal->dir_output . "/";
+ $filepath = $dir_output . $propalref . "/";
+ $file = $filepath . $propalref . ".pdf";
+ $filedetail = $filepath . $propalref . "-detail.pdf";
$relativepath = "${propalref}/${propalref}.pdf";
$relativepathdetail = "${propalref}/${propalref}-detail.pdf";
// Chemin vers png aperçus
$relativepathimage = "${propalref}/${propalref}.pdf.png";
- $relativepathimagebis = "${propalref}/${propalref}.pdf.png.0";
- $relativepathimagebis2 = "${propalref}/${propalref}.pdf.png.1";
$fileimage = $file.".png"; // Si PDF d'1 page
$fileimagebis = $file.".png.0"; // Si PDF de plus d'1 page
@@ -262,8 +262,16 @@ if (file_exists($fileimage))
// Si fichier png PDF de plus d'1 page trouvé
elseif (file_exists($fileimagebis))
{
- print '
';
- print '
';
+ }
}
diff --git a/htdocs/compta/facture/apercu.php b/htdocs/compta/facture/apercu.php
index 13111f41971..dba3d33bdc6 100644
--- a/htdocs/compta/facture/apercu.php
+++ b/htdocs/compta/facture/apercu.php
@@ -130,18 +130,17 @@ if ($_GET["facid"] > 0)
* Documents
*/
$facref = sanitize_string($fac->ref);
- $file = $conf->facture->dir_output . "/" . $facref . "/" . $facref . ".pdf";
- $filedetail = $conf->facture->dir_output . "/" . $facref . "/" . $facref . "-detail.pdf";
+ $dir_output = $conf->facture->dir_output . "/";
+ $filepath = $dir_output . $facref . "/";
+ $file = $filepath . $facref . ".pdf";
+ $filedetail = $filepath . $facref . "-detail.pdf";
$relativepath = "${facref}/${facref}.pdf";
$relativepathdetail = "${facref}/${facref}-detail.pdf";
// Chemin vers png aperçus
- $relativepathimage = "${facref}/${facref}.pdf.png";
- $relativepathimagebis = "${facref}/${facref}.pdf.png.0";
- $relativepathimagebis2 = "${facref}/${facref}.pdf.png.1";
-
- $fileimage = $file.".png"; // Si PDF d'1 page
- $fileimagebis = $file.".png.0"; // Si PDF de plus d'1 page
+ $relativepathimage = "${facref}/${facref}.pdf.png";
+ $fileimage = $file.".png"; // Si PDF d'1 page
+ $fileimagebis = $file.".png.0"; // Si PDF de plus d'1 page
$var=true;
@@ -258,8 +257,16 @@ if (file_exists($fileimage))
// Si fichier png PDF de plus d'1 page trouvé
elseif (file_exists($fileimagebis))
{
- print '
';
- print '
'; + } }