forked from Wavyzz/dolibarr
Qual: Prepare move of function dol_delete_file into file.lib.php
This commit is contained in:
@@ -198,6 +198,8 @@ if ($_GET["action"] == 'addthumb')
|
|||||||
|
|
||||||
if ($_GET["action"] == 'removelogo')
|
if ($_GET["action"] == 'removelogo')
|
||||||
{
|
{
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||||
|
|
||||||
$logofile=$conf->mycompany->dir_output.'/logos/'.$mysoc->logo;
|
$logofile=$conf->mycompany->dir_output.'/logos/'.$mysoc->logo;
|
||||||
dol_delete_file($logofile);
|
dol_delete_file($logofile);
|
||||||
dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO",$conf->entity);
|
dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO",$conf->entity);
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
require("../main.inc.php");
|
require("../main.inc.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
|
require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||||
|
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
$langs->load("products");
|
$langs->load("products");
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
require("../../main.inc.php");
|
require("../../main.inc.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
|
require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||||
include_once $dolibarr_main_document_root."/lib/databases/".$conf->db->type.".lib.php";
|
include_once $dolibarr_main_document_root."/lib/databases/".$conf->db->type.".lib.php";
|
||||||
|
|
||||||
|
|||||||
@@ -1197,6 +1197,8 @@ class Categorie
|
|||||||
*/
|
*/
|
||||||
function delete_photo($file)
|
function delete_photo($file)
|
||||||
{
|
{
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||||
|
|
||||||
$dir = dirname($file).'/'; // Chemin du dossier contenant l'image d'origine
|
$dir = dirname($file).'/'; // Chemin du dossier contenant l'image d'origine
|
||||||
$dirthumb = $dir.'/thumbs/'; // Chemin du dossier contenant la vignette
|
$dirthumb = $dir.'/thumbs/'; // Chemin du dossier contenant la vignette
|
||||||
$filename = preg_replace('/'.preg_quote($dir,'/').'/i','',$file); // Nom du fichier
|
$filename = preg_replace('/'.preg_quote($dir,'/').'/i','',$file); // Nom du fichier
|
||||||
|
|||||||
@@ -1592,6 +1592,7 @@ class Propal extends CommonObject
|
|||||||
function delete($user, $notrigger=0)
|
function delete($user, $notrigger=0)
|
||||||
{
|
{
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||||
|
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
|
|||||||
@@ -170,6 +170,7 @@ class Commande extends CommonObject
|
|||||||
function valid($user)
|
function valid($user)
|
||||||
{
|
{
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||||
|
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
@@ -2034,6 +2035,7 @@ class Commande extends CommonObject
|
|||||||
function delete($user)
|
function delete($user)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||||
|
|
||||||
$err = 0;
|
$err = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -862,6 +862,8 @@ if ($_REQUEST['action'] == 'remove_file')
|
|||||||
{
|
{
|
||||||
if ($object->fetch($id))
|
if ($object->fetch($id))
|
||||||
{
|
{
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||||
|
|
||||||
$upload_dir = $conf->commande->dir_output . "/";
|
$upload_dir = $conf->commande->dir_output . "/";
|
||||||
$file = $upload_dir . '/' . $_GET['file'];
|
$file = $upload_dir . '/' . $_GET['file'];
|
||||||
dol_delete_file($file);
|
dol_delete_file($file);
|
||||||
|
|||||||
@@ -1383,6 +1383,7 @@ class Facture extends CommonObject
|
|||||||
function validate($user, $force_number='')
|
function validate($user, $force_number='')
|
||||||
{
|
{
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||||
|
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
|
|||||||
@@ -108,6 +108,7 @@ if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
|||||||
// Delete
|
// Delete
|
||||||
if ($action=='delete')
|
if ($action=='delete')
|
||||||
{
|
{
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||||
$facture = new Facture($db);
|
$facture = new Facture($db);
|
||||||
|
|
||||||
$facid=$_GET["id"];
|
$facid=$_GET["id"];
|
||||||
|
|||||||
@@ -21,11 +21,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/contrat/document.php
|
* \file htdocs/contrat/document.php
|
||||||
\ingroup contrat
|
* \ingroup contrat
|
||||||
\brief Page des documents joints sur les contrats
|
* \brief Page des documents joints sur les contrats
|
||||||
\version $Id$
|
* \version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require ("../main.inc.php");
|
require ("../main.inc.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/lib/contract.lib.php");
|
require_once(DOL_DOCUMENT_ROOT."/lib/contract.lib.php");
|
||||||
|
|||||||
@@ -3,15 +3,16 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/ecm/docother.php
|
* \file htdocs/ecm/docother.php
|
||||||
\ingroup ecm
|
* \ingroup ecm
|
||||||
\brief Main ecm page
|
* \brief Main ecm page
|
||||||
\version $Id$
|
* \version $Id$
|
||||||
\author Laurent Destailleur
|
* \author Laurent Destailleur
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("../main.inc.php");
|
require("../main.inc.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||||
|
|
||||||
// Load traductions files
|
// Load traductions files
|
||||||
$langs->load("ecm");
|
$langs->load("ecm");
|
||||||
|
|||||||
@@ -389,6 +389,7 @@ class Expedition extends CommonObject
|
|||||||
function valid($user)
|
function valid($user)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||||
|
|
||||||
dol_syslog("Expedition::valid");
|
dol_syslog("Expedition::valid");
|
||||||
|
|
||||||
@@ -727,10 +728,11 @@ class Expedition extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Delete shipping
|
* Delete shipping
|
||||||
*/
|
*/
|
||||||
function delete()
|
function delete()
|
||||||
{
|
{
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."expeditiondet";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."expeditiondet";
|
||||||
|
|||||||
@@ -517,6 +517,7 @@ class Fichinter extends CommonObject
|
|||||||
function delete($user)
|
function delete($user)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||||
|
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
|
|||||||
@@ -255,6 +255,7 @@ class CommandeFournisseur extends Commande
|
|||||||
function valid($user)
|
function valid($user)
|
||||||
{
|
{
|
||||||
global $langs,$conf;
|
global $langs,$conf;
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||||
|
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
@@ -1148,10 +1149,10 @@ class CommandeFournisseur extends Commande
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \bref Set a delivery in database for this supplier order
|
* Set a delivery in database for this supplier order
|
||||||
* \param user User that input data
|
* @param user User that input data
|
||||||
* \param date Date of reception
|
* @param date Date of reception
|
||||||
* \param type Type of receipt
|
* @param type Type of receipt
|
||||||
*/
|
*/
|
||||||
function Livraison($user, $date, $type, $comment)
|
function Livraison($user, $date, $type, $comment)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -523,6 +523,7 @@ if ($action == 'builddoc') // En get ou en post
|
|||||||
// Delete file in doc form
|
// Delete file in doc form
|
||||||
if ($action=='remove_file')
|
if ($action=='remove_file')
|
||||||
{
|
{
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||||
$commande = new CommandeFournisseur($db);
|
$commande = new CommandeFournisseur($db);
|
||||||
|
|
||||||
if ($commande->fetch($id))
|
if ($commande->fetch($id))
|
||||||
|
|||||||
@@ -851,6 +851,7 @@ if ($_REQUEST['action'] == 'builddoc')
|
|||||||
// Delete file in doc form
|
// Delete file in doc form
|
||||||
if ($action=='remove_file')
|
if ($action=='remove_file')
|
||||||
{
|
{
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||||
$facture = new FactureFournisseur($db);
|
$facture = new FactureFournisseur($db);
|
||||||
|
|
||||||
if ($facture->fetch($id))
|
if ($facture->fetch($id))
|
||||||
|
|||||||
@@ -221,6 +221,7 @@ function commande_pdf_create($db, $object, $modele, $outputlangs)
|
|||||||
function commande_delete_preview($db, $commandeid, $commanderef='')
|
function commande_delete_preview($db, $commandeid, $commanderef='')
|
||||||
{
|
{
|
||||||
global $langs,$conf;
|
global $langs,$conf;
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||||
|
|
||||||
if (!$commanderef)
|
if (!$commanderef)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -293,6 +293,7 @@ function facture_meta_create($db, $facid, $message="")
|
|||||||
function facture_delete_preview($db, $facid)
|
function facture_delete_preview($db, $facid)
|
||||||
{
|
{
|
||||||
global $langs,$conf;
|
global $langs,$conf;
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||||
|
|
||||||
$fac = new Facture($db,"",$facid);
|
$fac = new Facture($db,"",$facid);
|
||||||
$fac->fetch($facid);
|
$fac->fetch($facid);
|
||||||
|
|||||||
@@ -210,6 +210,7 @@ function fichinter_create($db, $object, $modele='', $outputlangs='')
|
|||||||
function fichinter_delete_preview($db, $fichinterid, $fichinterref='')
|
function fichinter_delete_preview($db, $fichinterid, $fichinterref='')
|
||||||
{
|
{
|
||||||
global $langs,$conf;
|
global $langs,$conf;
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||||
|
|
||||||
if (!$fichinterref)
|
if (!$fichinterref)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -198,6 +198,7 @@ function delivery_order_pdf_create($db, $object, $model='', $outputlangs='')
|
|||||||
function delivery_order_delete_preview($db, $deliveryid)
|
function delivery_order_delete_preview($db, $deliveryid)
|
||||||
{
|
{
|
||||||
global $langs,$conf;
|
global $langs,$conf;
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||||
|
|
||||||
$delivery = new Livraison($db,"",$deliveryid);
|
$delivery = new Livraison($db,"",$deliveryid);
|
||||||
$delivery->fetch($deliveryid);
|
$delivery->fetch($deliveryid);
|
||||||
|
|||||||
@@ -208,6 +208,7 @@ function project_pdf_create($db, $object, $model,$outputlangs)
|
|||||||
function project_delete_preview($db, $objectid)
|
function project_delete_preview($db, $objectid)
|
||||||
{
|
{
|
||||||
global $langs,$conf;
|
global $langs,$conf;
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||||
|
|
||||||
$project = new Project($db);
|
$project = new Project($db);
|
||||||
$project->fetch($objectid);
|
$project->fetch($objectid);
|
||||||
|
|||||||
@@ -226,6 +226,7 @@ function propale_pdf_create($db, $object, $modele, $outputlangs)
|
|||||||
function propale_delete_preview($db, $propalid, $propalref='')
|
function propale_delete_preview($db, $propalid, $propalref='')
|
||||||
{
|
{
|
||||||
global $langs,$conf;
|
global $langs,$conf;
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||||
|
|
||||||
if (!$propalref)
|
if (!$propalref)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -129,6 +129,7 @@ function supplier_invoice_pdf_create($db, $object, $model, $outputlangs)
|
|||||||
function supplier_invoice_delete_preview($db, $objectid)
|
function supplier_invoice_delete_preview($db, $objectid)
|
||||||
{
|
{
|
||||||
global $langs,$conf;
|
global $langs,$conf;
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||||
|
|
||||||
$comfourn = new FactureFournisseur($db,"",$objectid);
|
$comfourn = new FactureFournisseur($db,"",$objectid);
|
||||||
$comfourn->fetch($objectid);
|
$comfourn->fetch($objectid);
|
||||||
|
|||||||
@@ -204,6 +204,7 @@ function supplier_order_pdf_create($db, $object, $model, $outputlangs)
|
|||||||
function supplier_order_delete_preview($db, $objectid)
|
function supplier_order_delete_preview($db, $objectid)
|
||||||
{
|
{
|
||||||
global $langs,$conf;
|
global $langs,$conf;
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||||
|
|
||||||
$comfourn = new CommandeFournisseur($db,"",$objectid);
|
$comfourn = new CommandeFournisseur($db,"",$objectid);
|
||||||
$comfourn->fetch($objectid);
|
$comfourn->fetch($objectid);
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ require_once($dolibarr_main_document_root . '/commande/class/commande.class.php'
|
|||||||
require_once($dolibarr_main_document_root . '/fourn/class/fournisseur.commande.class.php');
|
require_once($dolibarr_main_document_root . '/fourn/class/fournisseur.commande.class.php');
|
||||||
require_once($dolibarr_main_document_root . '/lib/price.lib.php');
|
require_once($dolibarr_main_document_root . '/lib/price.lib.php');
|
||||||
require_once($dolibarr_main_document_root . '/core/class/menubase.class.php');
|
require_once($dolibarr_main_document_root . '/core/class/menubase.class.php');
|
||||||
|
require_once($dolibarr_main_document_root . '/lib/files.lib.php');
|
||||||
|
|
||||||
$grant_query='';
|
$grant_query='';
|
||||||
$etape = 2;
|
$etape = 2;
|
||||||
|
|||||||
@@ -316,6 +316,7 @@ class Livraison extends CommonObject
|
|||||||
function valid($user)
|
function valid($user)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||||
|
|
||||||
dol_syslog("livraison.class.php::valid begin");
|
dol_syslog("livraison.class.php::valid begin");
|
||||||
|
|
||||||
@@ -559,10 +560,10 @@ class Livraison extends CommonObject
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Supprime la fiche
|
* Supprime la fiche
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
function delete()
|
function delete()
|
||||||
{
|
{
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."livraisondet";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."livraisondet";
|
||||||
|
|||||||
@@ -2682,6 +2682,8 @@ class Product extends CommonObject
|
|||||||
*/
|
*/
|
||||||
function delete_photo($file)
|
function delete_photo($file)
|
||||||
{
|
{
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||||
|
|
||||||
$dir = dirname($file).'/'; // Chemin du dossier contenant l'image d'origine
|
$dir = dirname($file).'/'; // Chemin du dossier contenant l'image d'origine
|
||||||
$dirthumb = $dir.'/thumbs/'; // Chemin du dossier contenant la vignette
|
$dirthumb = $dir.'/thumbs/'; // Chemin du dossier contenant la vignette
|
||||||
$filename = preg_replace('/'.preg_quote($dir,'/').'/i','',$file); // Nom du fichier
|
$filename = preg_replace('/'.preg_quote($dir,'/').'/i','',$file); // Nom du fichier
|
||||||
|
|||||||
@@ -376,10 +376,12 @@ class Project extends CommonObject
|
|||||||
* Delete a project from database
|
* Delete a project from database
|
||||||
* @param user User
|
* @param user User
|
||||||
* @param notrigger Disable triggers
|
* @param notrigger Disable triggers
|
||||||
|
* @return int <0 if KO, 0 if not possible, >0 if OK
|
||||||
*/
|
*/
|
||||||
function delete($user, $notrigger=0)
|
function delete($user, $notrigger=0)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $langs,$conf;
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||||
|
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user