From 563b157844a1fc240bfafc475d00e95dbb8357e4 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville <rodolphe@quiedeville.org> Date: Tue, 9 Nov 2004 08:58:35 +0000 Subject: [PATCH] =?UTF-8?q?Modifie=20l'affichage=20des=20facture=20detaill?= =?UTF-8?q?=E9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/compta/facture.php | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 8160f798db3..7fb01c3a1ff 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1176,11 +1176,11 @@ else * Documents g�n�r�s * */ - $forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","="); - $facref = str_replace($forbidden_chars,"_",$fac->ref); - $file = FAC_OUTPUTDIR . "/" . $facref . "/" . $facref . ".pdf"; - $filedetail = FAC_OUTPUTDIR . "/" . $facref . "/" . $facref . "-detail.pdf"; - + + $forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","="); + $facref = str_replace($forbidden_chars,"_",$fac->ref); + $file = FAC_OUTPUTDIR . "/" . $facref . "/" . $facref . ".pdf"; + print "<table width=\"100%\" cellspacing=2><tr><td width=\"50%\" valign=\"top\">"; if (file_exists($file)) @@ -1196,18 +1196,24 @@ else print '<td align="right">'.filesize($file). ' bytes</td>'; print '<td align="right">'.strftime("%d %b %Y %H:%M:%S",filemtime($file)).'</td>'; print '</tr>'; - - if (file_exists($filedetail)) // facture d�taill�e suppl�mentaire + + + $dir = FAC_OUTPUTDIR . "/" . $facref . "/"; + $handle=opendir($dir); + + while (($file = readdir($handle))!==false) { - $encfile = urlencode($filedetail); - print "<tr $bc[0]><td>Facture d�taill�e</td>"; - - print '<td><a href="'.DOL_URL_ROOT . '/document.php?file='.$encfile.'">'.$fac->ref.'-detail.pdf</a></td>'; - print '<td align="right">'.filesize($filedetail). ' bytes</td>'; - print '<td align="right">'.strftime("%d %b %Y %H:%M:%S",filemtime($filedetail)).'</td>'; - print '</tr>'; + if (is_readable($dir.$file) && substr($file, -10) == 'detail.pdf') + { + $encfile = urlencode($dir.$file); + print "<tr $bc[0]><td>Facture d�taill�e</td>"; + + print '<td><a href="'.DOL_URL_ROOT . '/document.php?file='.$encfile.'">'.$fac->ref.'-detail.pdf</a></td>'; + print '<td align="right">'.filesize($dir.$file). ' bytes</td>'; + print '<td align="right">'.strftime("%d %b %Y %H:%M:%S",filemtime($dir.$file)).'</td>'; + print '</tr>'; + } } - print "</table>\n"; } -- GitLab