From d82e40b0100e518daa3c63d7345efa779e64acc3 Mon Sep 17 00:00:00 2001
From: Regis Houssin <regis@dolibarr.fr>
Date: Thu, 14 Jul 2011 05:21:52 +0000
Subject: [PATCH] Fix: object is a parameter

---
 htdocs/comm/propal/document.php    | 8 ++++----
 htdocs/commande/document.php       | 6 +++---
 htdocs/compta/facture/document.php | 6 +++---
 htdocs/lib/files.lib.php           | 4 ++--
 htdocs/societe/document.php        | 6 +++---
 5 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php
index 561c68482de..c6bbc00d399 100644
--- a/htdocs/comm/propal/document.php
+++ b/htdocs/comm/propal/document.php
@@ -2,7 +2,7 @@
 /* Copyright (C) 2003-2004 Rodolphe Quiedeville  <rodolphe@quiedeville.org>
  * Copyright (C) 2004-2009 Laurent Destailleur   <eldy@users.sourceforge.net>
  * Copyright (C) 2005      Marc Barilley / Ocebo <marc@ocebo.com>
- * Copyright (C) 2005      Regis Houssin         <regis@dolibarr.fr>
+ * Copyright (C) 2005-2011 Regis Houssin         <regis@dolibarr.fr>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -23,7 +23,7 @@
  *       \file       htdocs/comm/propal/document.php
  *       \ingroup    propale
  *       \brief      Page de gestion des documents attaches a une proposition commerciale
- *       \version    $Id: document.php,v 1.66 2011/07/06 20:56:49 eldy Exp $
+ *       \version    $Id: document.php,v 1.67 2011/07/14 05:21:53 hregis Exp $
  */
 
 require("../../main.inc.php");
@@ -110,7 +110,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
 
         $upload_dir = $conf->propale->dir_output . "/" . dol_sanitizeFileName($object->ref);
     	$file = $upload_dir . '/' . $_GET['urlfile'];	// Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
-    	dol_delete_file($file);
+    	dol_delete_file($file,0,0,0,'FILE_DELETE',$object);
         $mesg = '<div class="ok">'.$langs->trans("FileWasRemoved").'</div>';
     }
 }
@@ -209,5 +209,5 @@ else
 
 $db->close();
 
-llxFooter('$Date: 2011/07/06 20:56:49 $ - $Revision: 1.66 $');
+llxFooter('$Date: 2011/07/14 05:21:53 $ - $Revision: 1.67 $');
 ?>
diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php
index 6b27978ce6f..e026511a0c0 100644
--- a/htdocs/commande/document.php
+++ b/htdocs/commande/document.php
@@ -23,7 +23,7 @@
  *	\file       htdocs/commande/document.php
  *	\ingroup    order
  *	\brief      Page de gestion des documents attachees a une commande
- *	\version    $Id: document.php,v 1.34 2011/07/06 20:56:49 eldy Exp $
+ *	\version    $Id: document.php,v 1.35 2011/07/14 05:21:53 hregis Exp $
  */
 
 require("../main.inc.php");
@@ -113,7 +113,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
 
     	$upload_dir = $conf->commande->dir_output . "/" . dol_sanitizeFileName($object->ref);
     	$file = $upload_dir . '/' . $_GET['urlfile'];	// Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
-    	dol_delete_file($file);
+    	dol_delete_file($file,0,0,0,'FILE_DELETE',$object);
     	$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved").'</div>';
     }
 }
@@ -193,5 +193,5 @@ else
 
 $db->close();
 
-llxFooter('$Date: 2011/07/06 20:56:49 $ - $Revision: 1.34 $');
+llxFooter('$Date: 2011/07/14 05:21:53 $ - $Revision: 1.35 $');
 ?>
diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php
index 9c7d62baa30..b042421346d 100644
--- a/htdocs/compta/facture/document.php
+++ b/htdocs/compta/facture/document.php
@@ -23,7 +23,7 @@
  *	\file       htdocs/compta/facture/document.php
  *	\ingroup    facture
  *	\brief      Page for attached files on invoices
- *	\version    $Id: document.php,v 1.44 2011/07/06 20:56:49 eldy Exp $
+ *	\version    $Id: document.php,v 1.45 2011/07/14 05:21:53 hregis Exp $
  */
 
 require("../../main.inc.php");
@@ -115,7 +115,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
 
 		$upload_dir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($object->ref);
 		$file = $upload_dir . '/' . $_GET['urlfile'];	// Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
-		dol_delete_file($file);
+		dol_delete_file($file,0,0,0,'FILE_DELETE',$object);
 		$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved").'</div>';
 	}
 }
@@ -213,5 +213,5 @@ else
 
 $db->close();
 
-llxFooter('$Date: 2011/07/06 20:56:49 $ - $Revision: 1.44 $');
+llxFooter('$Date: 2011/07/14 05:21:53 $ - $Revision: 1.45 $');
 ?>
diff --git a/htdocs/lib/files.lib.php b/htdocs/lib/files.lib.php
index 5dda38dcc5c..95fb3e6adb0 100644
--- a/htdocs/lib/files.lib.php
+++ b/htdocs/lib/files.lib.php
@@ -20,7 +20,7 @@
 /**
  *  \file		htdocs/lib/files.lib.php
  *  \brief		Library for file managing functions
- *  \version	$Id: files.lib.php,v 1.69 2011/07/13 21:33:38 eldy Exp $
+ *  \version	$Id: files.lib.php,v 1.70 2011/07/14 05:21:53 hregis Exp $
  */
 
 /**
@@ -590,7 +590,7 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable
  *  @param      disableglob     Disable usage of glob like *
  *  @param      nophperrors     Disable all PHP output errors
  *  @param		notrigger		Disable all triggers
- *  @param      triggercode     Code of trigger
+ *  @param      triggercode     Code of trigger TODO ???? why ?
  *  @param      object          Object for trigger
  *  @return     boolean         True if file is deleted, False if error
  */
diff --git a/htdocs/societe/document.php b/htdocs/societe/document.php
index cb031662e83..74252ada670 100644
--- a/htdocs/societe/document.php
+++ b/htdocs/societe/document.php
@@ -23,7 +23,7 @@
  *  \file       htdocs/societe/document.php
  *  \brief      Tab for documents linked to third party
  *  \ingroup    societe
- *  \version    $Id: document.php,v 1.37 2011/07/06 20:56:49 eldy Exp $
+ *  \version    $Id: document.php,v 1.38 2011/07/14 05:21:52 hregis Exp $
  */
 
 require("../main.inc.php");
@@ -118,7 +118,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
 	if ($object->fetch($socid))
 	{
 		$file = $upload_dir . "/" . $_GET['urlfile'];	// Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
-		dol_delete_file($file);
+		dol_delete_file($file,0,0,0,'FILE_DELETE',$object);
 		$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved").'</div>';
 	}
 }
@@ -241,6 +241,6 @@ else
 $db->close();
 
 
-llxFooter('$Date: 2011/07/06 20:56:49 $ - $Revision: 1.37 $');
+llxFooter('$Date: 2011/07/14 05:21:52 $ - $Revision: 1.38 $');
 
 ?>
-- 
GitLab