reduce complexity of contact class
This commit is contained in:
parent
ab0f842db6
commit
a4fd8c4b75
@ -100,7 +100,7 @@ class Contact extends CommonObject
|
|||||||
public $state_code; // Code of department
|
public $state_code; // Code of department
|
||||||
public $state; // Label of department
|
public $state; // Label of department
|
||||||
|
|
||||||
public $poste; // Position
|
public $poste; // Position
|
||||||
|
|
||||||
public $socid; // fk_soc
|
public $socid; // fk_soc
|
||||||
public $statut; // 0=inactif, 1=actif
|
public $statut; // 0=inactif, 1=actif
|
||||||
@ -493,8 +493,8 @@ class Contact extends CommonObject
|
|||||||
global $conf;
|
global $conf;
|
||||||
$dn='';
|
$dn='';
|
||||||
if ($mode==0) $dn=$conf->global->LDAP_KEY_CONTACTS."=".$info[$conf->global->LDAP_KEY_CONTACTS].",".$conf->global->LDAP_CONTACT_DN;
|
if ($mode==0) $dn=$conf->global->LDAP_KEY_CONTACTS."=".$info[$conf->global->LDAP_KEY_CONTACTS].",".$conf->global->LDAP_CONTACT_DN;
|
||||||
if ($mode==1) $dn=$conf->global->LDAP_CONTACT_DN;
|
elseif ($mode==1) $dn=$conf->global->LDAP_CONTACT_DN;
|
||||||
if ($mode==2) $dn=$conf->global->LDAP_KEY_CONTACTS."=".$info[$conf->global->LDAP_KEY_CONTACTS];
|
elseif ($mode==2) $dn=$conf->global->LDAP_KEY_CONTACTS."=".$info[$conf->global->LDAP_KEY_CONTACTS];
|
||||||
return $dn;
|
return $dn;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -508,12 +508,12 @@ class Contact extends CommonObject
|
|||||||
function _load_ldap_info()
|
function _load_ldap_info()
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf,$langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
$info = array();
|
$info = array();
|
||||||
|
|
||||||
// Object classes
|
// Object classes
|
||||||
$info["objectclass"]=explode(',',$conf->global->LDAP_CONTACT_OBJECT_CLASS);
|
$info["objectclass"]=explode(',', $conf->global->LDAP_CONTACT_OBJECT_CLASS);
|
||||||
|
|
||||||
$this->fullname=$this->getFullName($langs);
|
$this->fullname=$this->getFullName($langs);
|
||||||
|
|
||||||
@ -887,9 +887,9 @@ class Contact extends CommonObject
|
|||||||
if ($obj->nb)
|
if ($obj->nb)
|
||||||
{
|
{
|
||||||
if ($obj->element=='facture') $this->ref_facturation = $obj->nb;
|
if ($obj->element=='facture') $this->ref_facturation = $obj->nb;
|
||||||
if ($obj->element=='contrat') $this->ref_contrat = $obj->nb;
|
elseif ($obj->element=='contrat') $this->ref_contrat = $obj->nb;
|
||||||
if ($obj->element=='commande') $this->ref_commande = $obj->nb;
|
elseif ($obj->element=='commande') $this->ref_commande = $obj->nb;
|
||||||
if ($obj->element=='propal') $this->ref_propal = $obj->nb;
|
elseif ($obj->element=='propal') $this->ref_propal = $obj->nb;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->db->free($resql);
|
$this->db->free($resql);
|
||||||
@ -914,8 +914,8 @@ class Contact extends CommonObject
|
|||||||
|
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
$this->old_lastname = $obj->lastname;
|
$this->old_lastname = $obj->lastname;
|
||||||
$this->old_firstname = $obj->firstname;
|
$this->old_firstname = $obj->firstname;
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
@ -1035,7 +1035,7 @@ class Contact extends CommonObject
|
|||||||
{
|
{
|
||||||
$obj = $this->db->fetch_object($resql);
|
$obj = $this->db->fetch_object($resql);
|
||||||
|
|
||||||
$this->id = $obj->rowid;
|
$this->id = $obj->rowid;
|
||||||
|
|
||||||
if ($obj->fk_user_creat) {
|
if ($obj->fk_user_creat) {
|
||||||
$cuser = new User($this->db);
|
$cuser = new User($this->db);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user