diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php
index 3b28f6a746b..75ee1b0c721 100755
--- a/htdocs/comm/action/document.php
+++ b/htdocs/comm/action/document.php
@@ -96,23 +96,18 @@ llxHeader();
if ($_GET["id"] > 0)
{
- if ( $error_msg )
- {
- echo '
| '.$langs->trans("Ref").' | '.$act->id.' | ';
+ // Ref
+ print '| '.$langs->trans("Ref").' | '.$act->id.' |
';
- // Type
- print '| '.$langs->trans("Type").' | '.$act->type.' |
';
+ // Type
+ print '| '.$langs->trans("Type").' | '.$act->type.' |
';
- // Libelle
- print '| '.$langs->trans("Title").' | '.$act->label.' |
';
+ // Libelle
+ print '| '.$langs->trans("Title").' | '.$act->label.' |
';
- // Societe - contact
- print '| '.$langs->trans("Company").' | '.$act->societe->getNomUrl(1).' | ';
- print ''.$langs->trans("Contact").' | ';
- print '';
- if ($act->contact->id > 0)
- {
- print $act->contact->getNomUrl(1);
- }
- else
- {
- print $langs->trans("None");
- }
-
- print ' |
';
-
- // Construit liste des fichiers
- clearstatcache();
-
- $totalsize=0;
- $filearray=array();
-
- if (is_dir($upload_dir))
- {
- $errorlevel=error_reporting();
- error_reporting(0);
- $handle=opendir($upload_dir);
- error_reporting($errorlevel);
- if ($handle)
- {
- $i=0;
- while (($file = readdir($handle))!==false)
- {
- if (!is_dir($dir.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS')
- {
- $filearray[$i]=$file;
- $totalsize+=filesize($upload_dir."/".$file);
- $i++;
- }
- }
- closedir($handle);
- }
- else
- {
- print ''.$langs->trans("ErrorCanNotReadDir",$upload_dir).'
';
- }
- }
-
- print '| '.$langs->trans("NbOfAttachedFiles").' | '.sizeof($filearray).' |
';
- print '| '.$langs->trans("TotalSizeOfAttachedFiles").' | '.$totalsize.' '.$langs->trans("bytes").' |
';
- print '
';
-
- print '';
-
-
- // Affiche formulaire upload
- if ($conf->upload)
- {
- print_titre($langs->trans('AttachANewFile'));
-
- print '';
-
- if ($handle)
+ // Societe - contact
+ print '| '.$langs->trans("Company").' | '.$act->societe->getNomUrl(1).' | ';
+ print ''.$langs->trans("Contact").' | ';
+ print '';
+ if ($act->contact->id > 0)
{
- print ' |
';
- print '| '.$langs->trans('Document').' | ';
- print ''.$langs->trans('Size').' | ';
- print ''.$langs->trans('Date').' | ';
- print ' | ';
- print '
';
- $var=true;
- while (($file = readdir($handle))!==false)
- {
- if (!is_dir($dir.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS')
- {
- $var=!$var;
- print '';
- print '| ';
- echo ''.$file.'';
- print " | \n";
- print ''.filesize($upload_dir.'/'.$file). ' bytes | ';
- print ''.strftime('%d %b %Y %H:%M:%S',filemtime($upload_dir.'/'.$file)).' | ';
- print '';
- print ''.img_delete($langs->trans('Delete')).'';
- print " |
\n";
- }
- }
- closedir($handle);
+ print $act->contact->getNomUrl(1);
}
+ else
+ {
+ print $langs->trans("None");
+ }
+
+ print '';
+
+ // Construit liste des fichiers
+ clearstatcache();
+
+ $totalsize=0;
+ $filearray=array();
+
+ if (is_dir($upload_dir))
+ {
+ $errorlevel=error_reporting();
+ error_reporting(0);
+ $handle=opendir($upload_dir);
+ error_reporting($errorlevel);
+ if ($handle)
+ {
+ $i=0;
+ while (($file = readdir($handle))!==false)
+ {
+ if (!is_dir($dir.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS')
+ {
+ $filearray[$i]=$file;
+ $totalsize+=filesize($upload_dir."/".$file);
+ $i++;
+ }
+ }
+ closedir($handle);
+ }
+ else
+ {
+ print ''.$langs->trans("ErrorCanNotReadDir",$upload_dir).'
';
+ }
+ }
+
+ print '| '.$langs->trans("NbOfAttachedFiles").' | '.sizeof($filearray).' |
';
+ print '| '.$langs->trans("TotalSizeOfAttachedFiles").' | '.$totalsize.' '.$langs->trans("bytes").' |
';
print '
';
- print '';
+ print '';
+
+ if ($mesg) { print $mesg."';
+ print '';
+ print '| '.$langs->trans('Document').' | ';
+ print ''.$langs->trans('Size').' | ';
+ print ''.$langs->trans('Date').' | ';
+ print ' | ';
+ print '
';
+
+ if (is_dir($upload_dir))
+ {
+ $errorlevel=error_reporting();
+ $handle=opendir($upload_dir);
+ if ($handle)
+ {
+ $var=true;
+ while (($file = readdir($handle))!==false)
+ {
+ if (!is_dir($dir.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS')
+ {
+ $var=!$var;
+ print '';
+ print '| ';
+ echo ''.$file.'';
+ print " | \n";
+ print ''.filesize($upload_dir.'/'.$file). ' bytes | ';
+ print ''.strftime('%d %b %Y %H:%M:%S',filemtime($upload_dir.'/'.$file)).' | ';
+ print '';
+ print ''.img_delete($langs->trans('Delete')).'';
+ print " |
\n";
+ }
+ }
+ closedir($handle);
+ }
+ else
+ {
+ print ''.$langs->trans('ErrorCantOpenDir').' '.$upload_dir.'
';
+ }
+ }
+ print '
';
}
else
{