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 '