diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index f7c8df2a6c0..e878c0fc7f0 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -1803,13 +1803,6 @@ class Form $var=true; $filename = sanitize_string($filename); - // Par defaut - $extension = 'pdf'; - $relativepath = "${filename}/${filename}.${extension}"; - // Autre cas - if ($modulepart == 'expedition') { $extension='pdf'; $relativepath = get_exdir("${filename}")."${filename}.pdf"; } - if ($modulepart == 'don') { $extension='html'; $relativepath = get_exdir("${filename}")."${filename}.html"; } - $headershown=0; // Affiche en-tete tableau @@ -1864,7 +1857,10 @@ class Form while (($file = readdir($handle))!==false) { // Si fichier non lisible ou mauvaise extension, on passe au suivant - if (! is_readable($filedir."/".$file) || ! eregi('\.'.$extension.'$',$file)) continue; + if (! is_readable($filedir."/".$file) || + eregi('\.meta$',$file) || + eregi('\.$',$file) + ) continue; if (! $headershown) { @@ -1875,19 +1871,29 @@ class Form print ''; } - print ""; + // Défini chemin relatif par rapport au module pour lien download + $relativepath=$filename."/".$file; + if ($modulepart == 'expedition') { $relativepath = get_exdir("${filename}")."${file}"; } + if ($modulepart == 'don') { $relativepath = get_exdir("${filename}")."${file}"; } + + // Défini le type MIME du document + if (eregi('\.([^\.]+)$',$file,$reg)) $extension=$reg[1]; $mimetype=strtoupper($extension); if ($extension == 'pdf') $mimetype='PDF'; if ($extension == 'html') $mimetype='HTML'; if (eregi('\-detail\.pdf',$file)) $mimetype='PDF Détaillé'; + + print ""; + + // Affiche colonne type MIME print ''; - // print ''; - - print ''; - - + // Affiche nom fichier avec lien download + print ''; + // Affiche taille fichier print ''; + // Affiche date fichier print ''; + print ''; $i++;
'.$mimetype.''.$file.''.$file.''.$file.''.filesize($filedir."/".$file). ' bytes'.strftime("%d %b %Y %H:%M:%S",filemtime($filedir."/".$file)).'