mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-07 16:41:48 +01:00
Ajoute la fonction set_as_client
This commit is contained in:
@@ -250,27 +250,29 @@ class Societe {
|
||||
|
||||
// Cette fonction permet de supprimer le r<>pertoire de la societe
|
||||
// Meme s'il contient des documents.
|
||||
function deldir($dir){
|
||||
$current_dir = opendir($dir);
|
||||
while($entryname = readdir($current_dir)){
|
||||
if(is_dir("$dir/$entryname") and ($entryname != "." and $entryname!="..")){
|
||||
deldir("${dir}/${entryname}");
|
||||
}elseif($entryname != "." and $entryname!=".."){
|
||||
unlink("${dir}/${entryname}");
|
||||
}
|
||||
}
|
||||
closedir($current_dir);
|
||||
rmdir(${dir});
|
||||
}
|
||||
|
||||
function deldir($dir)
|
||||
{
|
||||
$current_dir = opendir($dir);
|
||||
while($entryname = readdir($current_dir))
|
||||
{
|
||||
if(is_dir("$dir/$entryname") and ($entryname != "." and $entryname!=".."))
|
||||
{
|
||||
deldir("${dir}/${entryname}");
|
||||
}
|
||||
elseif($entryname != "." and $entryname!="..")
|
||||
{
|
||||
unlink("${dir}/${entryname}");
|
||||
}
|
||||
}
|
||||
closedir($current_dir);
|
||||
rmdir(${dir});
|
||||
}
|
||||
|
||||
if (file_exists ($docdir))
|
||||
{
|
||||
deldir($docdir);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
@@ -356,6 +358,22 @@ class Societe {
|
||||
}
|
||||
return $prefix;
|
||||
}
|
||||
/**
|
||||
* D<>finit la soci<63>t<EFBFBD> comme un client
|
||||
*
|
||||
*
|
||||
*/
|
||||
Function set_as_client()
|
||||
{
|
||||
if ($this->id)
|
||||
{
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."societe ";
|
||||
$sql .= " SET client = 1";
|
||||
$sql .= " WHERE idp = " . $this->id .";";
|
||||
|
||||
return $this->db->query($sql);
|
||||
}
|
||||
}
|
||||
/*
|
||||
*
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user