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";
|
||||||
|
|
||||||
|
|||||||
@@ -273,9 +273,9 @@ class Categorie
|
|||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
dol_syslog("Categorie::remove");
|
dol_syslog("Categorie::remove");
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
@@ -322,7 +322,7 @@ class Categorie
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Link childs to parent
|
// Link childs to parent
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
@@ -358,7 +358,7 @@ class Categorie
|
|||||||
// Fin appel triggers
|
// Fin appel triggers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
@@ -1197,7 +1197,9 @@ class Categorie
|
|||||||
*/
|
*/
|
||||||
function delete_photo($file)
|
function delete_photo($file)
|
||||||
{
|
{
|
||||||
$dir = dirname($file).'/'; // Chemin du dossier contenant l'image d'origine
|
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||||
|
|
||||||
|
$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,7 +108,8 @@ if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
|||||||
// Delete
|
// Delete
|
||||||
if ($action=='delete')
|
if ($action=='delete')
|
||||||
{
|
{
|
||||||
$facture = new Facture($db);
|
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||||
|
$facture = new Facture($db);
|
||||||
|
|
||||||
$facid=$_GET["id"];
|
$facid=$_GET["id"];
|
||||||
if ($facture->fetch($facid))
|
if ($facture->fetch($facid))
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|
||||||
@@ -828,7 +829,7 @@ class CommandeFournisseur extends Commande
|
|||||||
if (empty($txtva)) $txtva=0;
|
if (empty($txtva)) $txtva=0;
|
||||||
if (empty($txlocaltax1)) $txlocaltax1=0;
|
if (empty($txlocaltax1)) $txlocaltax1=0;
|
||||||
if (empty($txlocaltax2)) $txlocaltax2=0;
|
if (empty($txlocaltax2)) $txlocaltax2=0;
|
||||||
|
|
||||||
$remise_percent=price2num($remise_percent);
|
$remise_percent=price2num($remise_percent);
|
||||||
$qty=price2num($qty);
|
$qty=price2num($qty);
|
||||||
$pu_ht=price2num($pu_ht);
|
$pu_ht=price2num($pu_ht);
|
||||||
@@ -845,7 +846,7 @@ class CommandeFournisseur extends Commande
|
|||||||
$pu=$pu_ttc;
|
$pu=$pu_ttc;
|
||||||
}
|
}
|
||||||
$desc=trim($desc);
|
$desc=trim($desc);
|
||||||
|
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
if ($qty < 1 && ! $fk_product)
|
if ($qty < 1 && ! $fk_product)
|
||||||
@@ -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)
|
||||||
{
|
{
|
||||||
@@ -1390,7 +1391,7 @@ class CommandeFournisseur extends Commande
|
|||||||
if (empty($txlocaltax2)) $txlocaltax2=0;
|
if (empty($txlocaltax2)) $txlocaltax2=0;
|
||||||
if (empty($remise)) $remise=0;
|
if (empty($remise)) $remise=0;
|
||||||
if (empty($remise_percent)) $remise_percent=0;
|
if (empty($remise_percent)) $remise_percent=0;
|
||||||
|
|
||||||
$remise_percent=price2num($remise_percent);
|
$remise_percent=price2num($remise_percent);
|
||||||
$qty=price2num($qty);
|
$qty=price2num($qty);
|
||||||
if (! $qty) $qty=1;
|
if (! $qty) $qty=1;
|
||||||
|
|||||||
@@ -523,7 +523,8 @@ 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')
|
||||||
{
|
{
|
||||||
$commande = new CommandeFournisseur($db);
|
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||||
|
$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);
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
/**
|
/**
|
||||||
* \file htdocs/includes/modules/propale/modules_propale.php
|
* \file htdocs/includes/modules/propale/modules_propale.php
|
||||||
* \ingroup propale
|
* \ingroup propale
|
||||||
* \brief Fichier contenant la classe mere de generation des propales en PDF
|
* \brief Fichier contenant la classe mere de generation des propales en PDF
|
||||||
* et la classe mere de numerotation des propales
|
* et la classe mere de numerotation des propales
|
||||||
* \version $Id$
|
* \version $Id$
|
||||||
*/
|
*/
|
||||||
@@ -148,10 +148,10 @@ function propale_pdf_create($db, $object, $modele, $outputlangs)
|
|||||||
|
|
||||||
// Positionne modele sur le nom du modele de propale a utiliser
|
// Positionne modele sur le nom du modele de propale a utiliser
|
||||||
$file = "pdf_propale_".$modele.".modules.php";
|
$file = "pdf_propale_".$modele.".modules.php";
|
||||||
|
|
||||||
// On verifie l'emplacement du modele
|
// On verifie l'emplacement du modele
|
||||||
$file = dol_buildpath($dir.$file);
|
$file = dol_buildpath($dir.$file);
|
||||||
|
|
||||||
if ($modele && file_exists($file)) $modelisok=1;
|
if ($modele && file_exists($file)) $modelisok=1;
|
||||||
|
|
||||||
// Si model pas encore bon
|
// Si model pas encore bon
|
||||||
@@ -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");
|
||||||
|
|
||||||
@@ -501,7 +502,7 @@ class Livraison extends CommonObject
|
|||||||
$line->qty = $expedition->lines[$i]->qty_shipped;
|
$line->qty = $expedition->lines[$i]->qty_shipped;
|
||||||
$line->fk_product = $expedition->lines[$i]->fk_product;
|
$line->fk_product = $expedition->lines[$i]->fk_product;
|
||||||
$line->ref = $expedition->lines[$i]->ref;
|
$line->ref = $expedition->lines[$i]->ref;
|
||||||
|
|
||||||
$this->lines[$i] = $line;
|
$this->lines[$i] = $line;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -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";
|
||||||
@@ -790,7 +791,7 @@ class Livraison extends CommonObject
|
|||||||
$line->description = 'Description';
|
$line->description = 'Description';
|
||||||
$line->price = 100;
|
$line->price = 100;
|
||||||
$line->total_ht = 100;
|
$line->total_ht = 100;
|
||||||
|
|
||||||
$this->lines[$i] = $line;
|
$this->lines[$i] = $line;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2682,7 +2682,9 @@ class Product extends CommonObject
|
|||||||
*/
|
*/
|
||||||
function delete_photo($file)
|
function delete_photo($file)
|
||||||
{
|
{
|
||||||
$dir = dirname($file).'/'; // Chemin du dossier contenant l'image d'origine
|
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
|
||||||
|
|
||||||
|
$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