move phpcs:ignore
This commit is contained in:
parent
e98b8e5e25
commit
47879d44bc
@ -260,6 +260,7 @@ class AccountingJournal extends CommonObject
|
||||
return $this->LibType($this->nature,$mode);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return type of an accounting journal
|
||||
*
|
||||
@ -267,9 +268,9 @@ class AccountingJournal extends CommonObject
|
||||
* @param int $mode 0=libelle long, 1=libelle court
|
||||
* @return string Label of type
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function LibType($nature,$mode=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
$langs->loadLangs(array("accountancy"));
|
||||
|
||||
@ -271,15 +271,16 @@ class DolibarrApi
|
||||
return true;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Function to forge a SQL criteria
|
||||
*
|
||||
* @param array $matches Array of found string by regex search
|
||||
* @return string Forged criteria. Example: "t.field like 'abc%'"
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
static function _forge_criteria_callback($matches)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $db;
|
||||
|
||||
//dol_syslog("Convert matches ".$matches[1]);
|
||||
|
||||
@ -254,15 +254,16 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Load object in memory from the database
|
||||
*
|
||||
* @param int $id Id object
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_by_mailing($id=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
$sql = "SELECT";
|
||||
$sql.= " t.rowid,";
|
||||
@ -320,6 +321,7 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Load object in memory from the database
|
||||
*
|
||||
@ -327,9 +329,9 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
* @param string $type_element Type target
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_by_element($id=0, $type_element='mailing')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
$sql = "SELECT";
|
||||
$sql.= " t.rowid,";
|
||||
@ -546,15 +548,16 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Load object in memory from database
|
||||
*
|
||||
* @param array $arrayquery All element to Query
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function query_thirdparty($arrayquery)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs,$conf;
|
||||
|
||||
$sql = "SELECT";
|
||||
@ -700,6 +703,7 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Load object in memory from database
|
||||
*
|
||||
@ -707,9 +711,9 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
* @param int $withThirdpartyFilter add contact with tridparty filter
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function query_contact($arrayquery, $withThirdpartyFilter = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs,$conf;
|
||||
|
||||
$sql = "SELECT";
|
||||
|
||||
@ -34,7 +34,7 @@ class RejetPrelevement
|
||||
* @var int ID
|
||||
*/
|
||||
public $id;
|
||||
|
||||
|
||||
/**
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
@ -199,15 +199,16 @@ class RejetPrelevement
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Send email to all users that has asked the withdraw request
|
||||
*
|
||||
* @param Facture $fac Invoice object
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function _send_email($fac)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
$userid = 0;
|
||||
|
||||
@ -65,6 +65,7 @@ class Import
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Load description int this->array_import_module, this->array_import_fields, ... of an importable dataset
|
||||
*
|
||||
@ -72,9 +73,9 @@ class Import
|
||||
* @param string $filter Load a particular dataset only. Index will start to 0.
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function load_arrays($user,$filter='')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs,$conf;
|
||||
|
||||
dol_syslog(get_class($this)."::load_arrays user=".$user->id." filter=".$filter);
|
||||
@ -184,6 +185,7 @@ class Import
|
||||
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Build an import example file.
|
||||
* Arrays this->array_export_xxx are already loaded for required datatoexport
|
||||
@ -194,9 +196,9 @@ class Import
|
||||
* @param string $datatoimport Dataset to import
|
||||
* @return string <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function build_example_file($model, $headerlinefields, $contentlinevalues,$datatoimport)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs;
|
||||
|
||||
$indice=0;
|
||||
|
||||
@ -467,14 +467,15 @@ class Opensurveysondage extends CommonObject
|
||||
return $result;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return array of lines
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_lines()
|
||||
{
|
||||
// phpcs:enable
|
||||
$ret=array();
|
||||
|
||||
$sql = "SELECT id_users, nom as name, reponses FROM ".MAIN_DB_PREFIX."opensurvey_user_studs";
|
||||
@ -623,6 +624,7 @@ class Opensurveysondage extends CommonObject
|
||||
return $this->LibStatut($this->status,$mode);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return label of status
|
||||
*
|
||||
@ -630,9 +632,9 @@ class Opensurveysondage extends CommonObject
|
||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @return string Label of status
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function LibStatut($status,$mode)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs, $conf;
|
||||
|
||||
//print 'x'.$status.'-'.$billed;
|
||||
|
||||
@ -304,6 +304,7 @@ class Productcustomerprice extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Load all customer prices in memory from database
|
||||
*
|
||||
@ -314,9 +315,9 @@ class Productcustomerprice extends CommonObject
|
||||
* @param array $filter Filter for select
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_all($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = array())
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
if ( empty($sortfield)) $sortfield = "t.rowid";
|
||||
@ -418,6 +419,7 @@ class Productcustomerprice extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Load all objects in memory from database
|
||||
*
|
||||
@ -428,9 +430,9 @@ class Productcustomerprice extends CommonObject
|
||||
* @param array $filter Filter for sql request
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_all_log($sortorder, $sortfield, $limit, $offset, $filter = array())
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
if (! empty($sortfield)) $sortfield = "t.rowid";
|
||||
|
||||
@ -37,12 +37,12 @@ class Entrepot extends CommonObject
|
||||
* @var string ID to identify managed object
|
||||
*/
|
||||
public $element='stock';
|
||||
|
||||
|
||||
/**
|
||||
* @var string Name of table without prefix where object is stored
|
||||
*/
|
||||
public $table_element='entrepot';
|
||||
|
||||
|
||||
public $picto='stock';
|
||||
|
||||
/**
|
||||
@ -415,15 +415,16 @@ class Entrepot extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of all warehouses
|
||||
*
|
||||
* @param int $status Status
|
||||
* @return array Array list of warehouses
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function list_array($status=1)
|
||||
{
|
||||
// phpcs:enable
|
||||
$liste = array();
|
||||
|
||||
$sql = "SELECT rowid, ref as label";
|
||||
@ -447,14 +448,15 @@ class Entrepot extends CommonObject
|
||||
return $liste;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return number of unique different product into a warehouse
|
||||
*
|
||||
* @return Array Array('nb'=>Nb, 'value'=>Value)
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function nb_different_products()
|
||||
{
|
||||
// phpcs:enable
|
||||
$ret=array();
|
||||
|
||||
$sql = "SELECT count(distinct p.rowid) as nb";
|
||||
@ -480,14 +482,15 @@ class Entrepot extends CommonObject
|
||||
return $ret;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return stock and value of warehosue
|
||||
*
|
||||
* @return Array Array('nb'=>Nb, 'value'=>Value)
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function nb_products()
|
||||
{
|
||||
// phpcs:enable
|
||||
$ret=array();
|
||||
|
||||
$sql = "SELECT sum(ps.reel) as nb, sum(ps.reel * p.pmp) as value";
|
||||
@ -525,6 +528,7 @@ class Entrepot extends CommonObject
|
||||
return $this->LibStatut($this->statut,$mode);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return label of a given status
|
||||
*
|
||||
@ -532,9 +536,9 @@ class Entrepot extends CommonObject
|
||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
|
||||
* @return string Label of status
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function LibStatut($statut,$mode=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
$langs->load('stocks');
|
||||
@ -652,14 +656,15 @@ class Entrepot extends CommonObject
|
||||
$this->country_code='FR';
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return full path to current warehouse
|
||||
*
|
||||
* @return string String full path to current warehouse separated by " >> "
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_full_arbo()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user,$langs,$conf;
|
||||
|
||||
$TArbo = array(empty($this->label)?$this->libelle:$this->label);
|
||||
@ -693,6 +698,7 @@ class Entrepot extends CommonObject
|
||||
return implode(' >> ', array_reverse($TArbo));
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return array of children warehouses ids from $id warehouse (recursive function)
|
||||
*
|
||||
@ -700,9 +706,9 @@ class Entrepot extends CommonObject
|
||||
* @param array $TChildWarehouses array which will contain all children (param by reference)
|
||||
* @return array $TChildWarehouses array which will contain all children
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_children_warehouses($id, &$TChildWarehouses)
|
||||
{
|
||||
// phpcs:enable
|
||||
|
||||
$sql = 'SELECT rowid
|
||||
FROM '.MAIN_DB_PREFIX.'entrepot
|
||||
|
||||
@ -1176,6 +1176,7 @@ class User extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Create a user from a contact object. User will be internal but if contact is linked to a third party, user will be external
|
||||
*
|
||||
@ -1184,9 +1185,9 @@ class User extends CommonObject
|
||||
* @param string $password Password to force
|
||||
* @return int <0 if error, if OK returns id of created user
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function create_from_contact($contact,$login='',$password='')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$user,$langs;
|
||||
|
||||
$error=0;
|
||||
@ -1254,6 +1255,7 @@ class User extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Create a user into database from a member object
|
||||
*
|
||||
@ -1261,9 +1263,9 @@ class User extends CommonObject
|
||||
* @param string $login Login to force
|
||||
* @return int <0 if KO, if OK, return id of created account
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function create_from_member($member,$login='')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$user,$langs;
|
||||
|
||||
// Positionne parametres
|
||||
@ -1328,14 +1330,15 @@ class User extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Assign rights by default
|
||||
*
|
||||
* @return integer erreur <0, si ok renvoi le nbre de droits par defaut positionnes
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function set_default_rights()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$sql = "SELECT id FROM ".MAIN_DB_PREFIX."rights_def";
|
||||
@ -1663,15 +1666,16 @@ class User extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Mise a jour en base de la date de derniere connexion d'un utilisateur
|
||||
* Fonction appelee lors d'une nouvelle connexion
|
||||
*
|
||||
* @return <0 si echec, >=0 si ok
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function update_last_login_date()
|
||||
{
|
||||
// phpcs:enable
|
||||
$now=dol_now();
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."user SET";
|
||||
@ -1829,6 +1833,7 @@ class User extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Send new password by email
|
||||
*
|
||||
@ -1837,9 +1842,9 @@ class User extends CommonObject
|
||||
* @param int $changelater 0=Send clear passwod into email, 1=Change password only after clicking on confirm email. @TODO Add method 2 = Send link to reset password
|
||||
* @return int < 0 si erreur, > 0 si ok
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function send_password($user, $password='', $changelater=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs;
|
||||
global $dolibarr_main_url_root;
|
||||
|
||||
@ -1944,14 +1949,15 @@ class User extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Read clicktodial information for user
|
||||
*
|
||||
* @return <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_clicktodial()
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = "SELECT url, login, pass, poste ";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."user_clicktodial as u";
|
||||
$sql.= " WHERE u.fk_user = ".$this->id;
|
||||
@ -1981,14 +1987,15 @@ class User extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Update clicktodial info
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function update_clicktodial()
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."user_clicktodial";
|
||||
@ -2021,6 +2028,7 @@ class User extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Add user into a group
|
||||
*
|
||||
@ -2029,9 +2037,9 @@ class User extends CommonObject
|
||||
* @param int $notrigger Disable triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function SetInGroup($group, $entity, $notrigger=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $langs, $user;
|
||||
|
||||
$error=0;
|
||||
@ -2082,6 +2090,7 @@ class User extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Remove a user from a group
|
||||
*
|
||||
@ -2090,9 +2099,9 @@ class User extends CommonObject
|
||||
* @param int $notrigger Disable triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function RemoveFromGroup($group, $entity, $notrigger=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs,$user;
|
||||
|
||||
$error=0;
|
||||
@ -2355,6 +2364,7 @@ class User extends CommonObject
|
||||
return $this->LibStatut($this->statut,$mode);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Renvoi le libelle d'un statut donne
|
||||
*
|
||||
@ -2362,9 +2372,9 @@ class User extends CommonObject
|
||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @return string Label of status
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function LibStatut($statut,$mode=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
$langs->load('users');
|
||||
|
||||
@ -2402,6 +2412,7 @@ class User extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Retourne chaine DN complete dans l'annuaire LDAP pour l'objet
|
||||
*
|
||||
@ -2411,9 +2422,9 @@ class User extends CommonObject
|
||||
* 2=Return key only (RDN) (uid=qqq)
|
||||
* @return string DN
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function _load_ldap_dn($info,$mode=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
$dn='';
|
||||
if ($mode==0) $dn=$conf->global->LDAP_KEY_USERS."=".$info[$conf->global->LDAP_KEY_USERS].",".$conf->global->LDAP_USER_DN;
|
||||
@ -2422,14 +2433,15 @@ class User extends CommonObject
|
||||
return $dn;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Initialize the info array (array of LDAP values) that will be used to call LDAP functions
|
||||
*
|
||||
* @return array Tableau info des attributs
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function _load_ldap_info()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs;
|
||||
|
||||
$info=array();
|
||||
@ -2692,6 +2704,7 @@ class User extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Update user using data from the LDAP
|
||||
*
|
||||
@ -2699,9 +2712,9 @@ class User extends CommonObject
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function update_ldap2dolibarr(&$ldapuser)
|
||||
{
|
||||
// phpcs:enable
|
||||
// TODO: Voir pourquoi le update met à jour avec toutes les valeurs vide (global $user écrase ?)
|
||||
global $user, $conf;
|
||||
|
||||
@ -2729,15 +2742,16 @@ class User extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return and array with all instanciated first level children users of current user
|
||||
*
|
||||
* @return void
|
||||
* @see getAllChildIds
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_children()
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."user";
|
||||
$sql.= " WHERE fk_user = ".$this->id;
|
||||
|
||||
@ -2767,8 +2781,7 @@ class User extends CommonObject
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
private function load_parentof()
|
||||
private function loadParentOf()
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@ -2780,7 +2793,7 @@ class User extends CommonObject
|
||||
$sql.= " WHERE fk_user <> 0";
|
||||
$sql.= " AND entity IN (".getEntity('user').")";
|
||||
|
||||
dol_syslog(get_class($this)."::load_parentof", LOG_DEBUG);
|
||||
dol_syslog(get_class($this)."::loadParentOf", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@ -2797,6 +2810,7 @@ class User extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Reconstruit l'arborescence hierarchique des users sous la forme d'un tableau
|
||||
* Set and return this->users that is an array sorted according to tree with arrays of:
|
||||
@ -2810,9 +2824,9 @@ class User extends CommonObject
|
||||
* @param string $filter SQL filter on users
|
||||
* @return array Array of users $this->users. Note: $this->parentof is also set.
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_full_tree($deleteafterid=0, $filter='')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $user;
|
||||
global $hookmanager;
|
||||
|
||||
@ -2822,7 +2836,7 @@ class User extends CommonObject
|
||||
$this->users = array();
|
||||
|
||||
// Init this->parentof that is array(id_son=>id_parent, ...)
|
||||
$this->load_parentof();
|
||||
$this->loadParentOf();
|
||||
|
||||
// Init $this->users array
|
||||
$sql = "SELECT DISTINCT u.rowid, u.firstname, u.lastname, u.fk_user, u.fk_soc, u.login, u.email, u.gender, u.admin, u.statut, u.photo, u.entity"; // Distinct reduce pb with old tables with duplicates
|
||||
@ -2941,6 +2955,7 @@ class User extends CommonObject
|
||||
return $childids;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* For user id_user and its childs available in this->users, define property fullpath and fullname.
|
||||
* Function called by get_full_tree().
|
||||
@ -2949,9 +2964,9 @@ class User extends CommonObject
|
||||
* @param int $protection Deep counter to avoid infinite loop (no more required, a protection is added with array useridfound)
|
||||
* @return int < 0 if KO (infinit loop), >= 0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function build_path_from_id_user($id_user,$protection=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
dol_syslog(get_class($this)."::build_path_from_id_user id_user=".$id_user." protection=".$protection, LOG_DEBUG);
|
||||
|
||||
if (! empty($this->users[$id_user]['fullpath']))
|
||||
@ -3004,14 +3019,15 @@ class User extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Charge indicateurs this->nb pour le tableau de bord
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function load_state_board()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$this->nb=array();
|
||||
@ -3075,6 +3091,7 @@ class User extends CommonObject
|
||||
return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return property of user from its id
|
||||
*
|
||||
@ -3082,9 +3099,9 @@ class User extends CommonObject
|
||||
* @param string $mode 'email' or 'mobile'
|
||||
* @return string Email of user with format: "Full name <email>"
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function user_get_property($rowid,$mode)
|
||||
{
|
||||
// phpcs:enable
|
||||
$user_property='';
|
||||
|
||||
if (empty($rowid)) return '';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user