Fix: Utilisation du wrapper scuris

This commit is contained in:
Laurent Destailleur 2004-12-31 17:03:20 +00:00
parent 868c4e1324
commit d701fd8b14
4 changed files with 35 additions and 34 deletions

View File

@ -1205,19 +1205,22 @@ else
$forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
$facref = str_replace($forbidden_chars,"_",$fac->ref);
$file = $conf->facture->dir_output . "/" . $facref . "/" . $facref . ".pdf";
print "<table width=\"100%\" cellspacing=2><tr><td width=\"50%\" valign=\"top\">";
$filedetail = $conf->facture->dir_output . "/" . $facref . "/" . $facref . "-detail.pdf";
$relativepath = "${facref}/${facref}.pdf";
$relativepathdetail = "${facref}/${facref}-detail.pdf";
$var=true;
print "<table width=\"100%\"><tr><td width=\"50%\" valign=\"top\">";
if (file_exists($file))
{
$encfile = urlencode($file);
print_titre("Documents");
print '<table class="border" width="100%">';
print "<tr $bc[0]><td>Facture PDF</td>";
print '<td><a href="'.DOL_URL_ROOT . '/document.php?file='.$encfile.'">'.$fac->ref.'.pdf</a></td>';
print "<tr $bc[$var]><td>".$langs->trans("Bill")." PDF</td>";
print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=facture&file='.urlencode($relativepath).'">'.$fac->ref.'.pdf</a></td>';
print '<td align="right">'.filesize($file). ' bytes</td>';
print '<td align="right">'.strftime("%d %b %Y %H:%M:%S",filemtime($file)).'</td>';
print '</tr>';
@ -1230,12 +1233,11 @@ else
{
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 "<tr $bc[$var]><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 '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=facture&file='.urlencode($relativepathdetail).'">'.$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>';
}
}

View File

@ -129,23 +129,27 @@ if ($_GET["facid"] > 0)
* Documents
*
*/
$forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
$facref = str_replace($forbidden_chars,"_",$fac->ref);
$file = FAC_OUTPUTDIR . "/" . $facref . "/" . $facref . ".pdf";
$filedetail = FAC_OUTPUTDIR . "/" . $facref . "/" . $facref . "-detail.pdf";
$fileimage = $file.".png";
$forbidden_chars=array("/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
$facref = str_replace($forbidden_chars,"_",$fac->ref);
$file = $conf->facture->dir_output . "/" . $facref . "/" . $facref . ".pdf";
$filedetail = $conf->facture->dir_output . "/" . $facref . "/" . $facref . "-detail.pdf";
$relativepath = "${facref}/${facref}.pdf";
$relativepathdetail = "${facref}/${facref}-detail.pdf";
$fileimage = $file.".png";
// Si fichier PDF existe
$var=true;
// Si fichier PDF existe
if (file_exists($file))
{
$encfile = urlencode($file);
print_titre("Documents");
print '<table class="border" width="100%">';
print "<tr $bc[0]><td>".$langs->trans("Bill")." PDF</td>";
print '<td><a href="'.DOL_URL_ROOT . '/document.php?file='.$encfile.'">'.$fac->ref.'.pdf</a></td>';
print "<tr $bc[$var]><td>".$langs->trans("Bill")." PDF</td>";
print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=facture&file='.urlencode($relativepath).'">'.$fac->ref.'.pdf</a></td>';
print '<td align="right">'.filesize($file). ' bytes</td>';
print '<td align="right">'.strftime("%d %b %Y %H:%M:%S",filemtime($file)).'</td>';
print '</tr>';
@ -153,10 +157,9 @@ if ($_GET["facid"] > 0)
// Si fichier detail PDF existe
if (file_exists($filedetail)) // facture détaillée supplémentaire
{
$encfile = urlencode($filedetail);
print "<tr $bc[0]><td>Facture détaillée</td>";
print "<tr $bc[$var]><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><a href="'.DOL_URL_ROOT . '/document.php?modulepart=facture&file='.urlencode($relativepathdetail).'">'.$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>';

View File

@ -146,7 +146,7 @@ if ($year)
$var=!$var;
$tfile = $dir . '/'.$year.'/'.$file;
$relativepath = $year.'/'.$file;
print "<tr $bc[$var]>".'<td><a href="/document.php?modulepart=facture_paiement&file='.urlencode($relativepath).'">'.img_pdf().' '.$file.'</a></td>';
print "<tr $bc[$var]>".'<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=facture_paiement&file='.urlencode($relativepath).'">'.img_pdf().' '.$file.'</a></td>';
print '<td align="right">'.filesize($tfile). ' bytes</td>';
print '<td align="right">'.strftime("%d %b %Y %H:%M:%S",filemtime($tfile)).'</td></tr>';
}

View File

@ -32,9 +32,6 @@ require_once DOL_DOCUMENT_ROOT."/includes/modules/modPrelevement.class.php";
$user->getrights('banque');
$mod = new modPrelevement($db);
$dir = $mod->data_directory;
llxHeader();
print_titre($langs->trans("Bons de prélèvements"));
@ -47,17 +44,16 @@ print '<td>'.$langs->trans("Date").'</td>';
print '<td>&nbsp;</td>';
print "</tr>\n";
$handle=opendir($dir);
$dir = $conf->prelevement->dir_output;
$handle=opendir($dir."/bon");
while (($file = readdir($handle))!==false)
{
if (is_readable($dir.$file) && is_file($dir.$file))
$relativepath="/bon/".$file;
if (is_readable($dir."/".$relativepath) && is_file($dir."/".$relativepath))
{
print '<tr><td><a href="'.DOL_URL_ROOT.'/document.php?file='.$dir.$file.'&amp;type=text/plain">'.$file.'</a><td>';
print '<tr><td><a href="'.DOL_URL_ROOT.'/document.php?modulepart=prelevement&file='.urlencode($relativepath).'&amp;type=text/plain">'.$file.'</a><td>';
print '</tr>';
}
}