From b3c9e925f21b3b6c3f4b1c1d6a76b6961de12772 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 25 Dec 2004 20:23:24 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20Pb=20register=5Fglobals=20et=20uniformis?= =?UTF-8?q?ation=20r=E9pertoire=20stockage.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/docsoc.php | 52 +++++++++++++++++++++++++++++++---------------- 1 file changed, 35 insertions(+), 17 deletions(-) diff --git a/htdocs/docsoc.php b/htdocs/docsoc.php index 660e487a0fc..845083e5e60 100644 --- a/htdocs/docsoc.php +++ b/htdocs/docsoc.php @@ -20,7 +20,7 @@ * $Source$ */ -/*! \file htdocs/docsoc.php +/** \file htdocs/docsoc.php \brief Fichier onglet documents liés à la société \ingroup societe \version $Revision$ @@ -36,10 +36,12 @@ llxHeader(); $mesg = ""; $socid=$_GET["socid"]; + +/* + * Creation répertoire si n'existe pas + */ if (! is_dir($conf->societe->dir_output)) { mkdir($conf->societe->dir_output); } - $upload_dir = $conf->societe->dir_output . "/" . $socid ; - if (! is_dir($upload_dir)) { umask(0); @@ -49,6 +51,10 @@ if (! is_dir($upload_dir)) } } + +/* + * Action envoie fichier + */ if ( $_POST["sendit"] && defined('MAIN_UPLOAD_DOC') && MAIN_UPLOAD_DOC == 1) { if (is_dir($upload_dir)) @@ -71,9 +77,15 @@ if ( $error_msg ) { print ''.$error_msg.'

'; } -if ($action=='delete') + + +/* + * Action suppression fichier + */ + +if ($_GET["action"]=='delete') { - $file = $upload_dir . "/" . urldecode($urlfile); + $file = $upload_dir . "/" . urldecode($_GET["urlfile"]); dol_delete_file($file); $mesg = "Le fichier a été supprimé"; } @@ -142,13 +154,11 @@ if ($socid > 0) /* - * + * */ + print_titre("Documents associés"); - /* - * - * - */ + if (defined('MAIN_UPLOAD_DOC') && MAIN_UPLOAD_DOC == 1) { echo '
'; @@ -173,7 +183,11 @@ if ($socid > 0) } print '
'; - print $mesg; + + if ($mesg) { print "$mesg

"; } + + + // Affiche liste des documents existant clearstatcache(); @@ -181,20 +195,24 @@ if ($socid > 0) if ($handle) { - print ''; + print '
'; + print ''; + + $var=true; while (($file = readdir($handle))!==false) { if (!is_dir($dir.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS') { - print '\n"; print ''; - print ''; + print ''; - print '\n"; } }
'.$langs->trans("Document").''.$langs->trans("Size").''.$langs->trans("Date").' 
'; - echo ''.$file.''; + $var=!$var; + print "
"; + echo ''.$file.''; print "'.filesize($upload_dir."/".$file). ' bytes'.strftime("%d %b %Y %H:%M:%S",filemtime($upload_dir."/".$file)).''.dolibarr_print_date(filemtime($upload_dir."/".$file),"%d %b %Y %H:%M:%S").''; - echo 'Delete'; + print ''; + echo ''.img_delete().''; print "