2
0
forked from Wavyzz/dolibarr

Fix deprecated code

This commit is contained in:
Laurent Destailleur
2017-11-03 17:29:25 +01:00
parent 048766bd24
commit a72703d316
3 changed files with 6 additions and 8 deletions

View File

@@ -766,12 +766,10 @@ class Categorie extends CommonObject
// For backward compatibility // For backward compatibility
if ($type == 'societe') { if ($type == 'societe') {
$type = 'customer'; $type = 'customer';
dol_syslog( get_class( $this ) . "::del_type(): type 'societe' is deprecated, please use 'customer' instead", dol_syslog( get_class( $this ) . "::del_type(): type 'societe' is deprecated, please use 'customer' instead", LOG_WARNING);
LOG_WARNING );
} elseif ($type == 'fournisseur') { } elseif ($type == 'fournisseur') {
$type = 'supplier'; $type = 'supplier';
dol_syslog( get_class( $this ) . "::del_type(): type 'fournisseur' is deprecated, please use 'supplier' instead", dol_syslog( get_class( $this ) . "::del_type(): type 'fournisseur' is deprecated, please use 'supplier' instead", LOG_WARNING);
LOG_WARNING );
} }
$this->db->begin(); $this->db->begin();

View File

@@ -88,13 +88,13 @@ if ($id > 0 && $removeelem > 0)
{ {
$tmpobject = new Societe($db); $tmpobject = new Societe($db);
$result = $tmpobject->fetch($removeelem); $result = $tmpobject->fetch($removeelem);
$elementtype = 'fournisseur'; $elementtype = 'supplier';
} }
else if ($type == Categorie::TYPE_CUSTOMER && $user->rights->societe->creer) else if ($type == Categorie::TYPE_CUSTOMER && $user->rights->societe->creer)
{ {
$tmpobject = new Societe($db); $tmpobject = new Societe($db);
$result = $tmpobject->fetch($removeelem); $result = $tmpobject->fetch($removeelem);
$elementtype = 'societe'; $elementtype = 'customer';
} }
else if ($type == Categorie::TYPE_MEMBER && $user->rights->adherent->creer) else if ($type == Categorie::TYPE_MEMBER && $user->rights->adherent->creer)
{ {

View File

@@ -1463,11 +1463,11 @@ class Societe extends CommonObject
// Fill $toute_categs array with an array of (type => array of ("Categorie" instance)) // Fill $toute_categs array with an array of (type => array of ("Categorie" instance))
if ($this->client || $this->prospect) if ($this->client || $this->prospect)
{ {
$toute_categs['societe'] = $static_cat->containing($this->id,Categorie::TYPE_CUSTOMER); $toute_categs['customer'] = $static_cat->containing($this->id,Categorie::TYPE_CUSTOMER);
} }
if ($this->fournisseur) if ($this->fournisseur)
{ {
$toute_categs['fournisseur'] = $static_cat->containing($this->id,Categorie::TYPE_SUPPLIER); $toute_categs['supplier'] = $static_cat->containing($this->id,Categorie::TYPE_SUPPLIER);
} }
// Remove each "Categorie" // Remove each "Categorie"