diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 2bbbb39519f..40d316d9ebc 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -11,9 +11,9 @@ * Copyright (C) 2013-2015 Alexandre Spangaro * Copyright (C) 2015 Marcos García * Copyright (C) 2018 charlene Benke - * Copyright (C) 2018-2021 Nicolas ZABOURI - * Copyright (C) 2019-2024 Frédéric France - * Copyright (C) 2019 Abbes Bahfir + * Copyright (C) 2018-2021 Nicolas ZABOURI + * Copyright (C) 2019-2024 Frédéric France + * Copyright (C) 2019 Abbes Bahfir * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -112,7 +112,7 @@ class User extends CommonObject public $fullname; /** - * @var string gender + * @var string|int<-1,-1> gender (man|woman|other) */ public $gender; @@ -337,7 +337,7 @@ class User extends CommonObject public $lastsearch_values; // To store last saved search criteria for user /** - * @var array|array Array of User (filled from fetchAll) or Array with hierarchy of user information (filled with get_full_tree() + * @var array|array,admin:int<0,1>,photo:string,fullpath:string,fullname:string,level:int}> Array of User (filled from fetchAll) or Array with hierarchy of user information (filled with get_full_tree() */ public $users = array(); public $parentof; // To store an array of all parents for all ids. @@ -1745,7 +1745,7 @@ class User extends CommonObject $this->civility_code = $contact->civility_code; $this->lastname = $contact->lastname; $this->firstname = $contact->firstname; - //$this->gender = $contact->gender; // contact ha sno gender + //$this->gender = $contact->gender; // contact has no gender $this->email = $contact->email; $this->socialnetworks = $contact->socialnetworks; $this->office_phone = $contact->phone_pro; @@ -2067,7 +2067,7 @@ class User extends CommonObject $sql .= ", employee = ".(int) $this->employee; $sql .= ", login = '".$this->db->escape($this->login)."'"; $sql .= ", api_key = ".($this->api_key ? "'".$this->db->escape(dolEncrypt($this->api_key, '', '', 'dolibarr'))."'" : "null"); - $sql .= ", gender = ".($this->gender != -1 ? "'".$this->db->escape($this->gender)."'" : "null"); // 'man' or 'woman' + $sql .= ", gender = ".($this->gender != -1 ? "'".$this->db->escape($this->gender)."'" : "null"); // 'man' or 'woman' or 'other' $sql .= ", birth=".(strval($this->birth) != '' ? "'".$this->db->idate($this->birth, 'tzserver')."'" : 'null'); if (!empty($user->admin)) { $sql .= ", admin = ".(int) $this->admin; // admin flag can be set/unset only by an admin user @@ -3706,7 +3706,7 @@ class User extends CommonObject * * @param int $deleteafterid Removed all users including the leaf $deleteafterid (and all its child) in user tree. * @param string $filter SQL filter on users. This parameter must not come from user input. - * @return int<-1,-1>|array Array of user information (also: $this->users). Note: $this->parentof is also set. + * @return int<-1,-1>|array,admin:int<0,1>,photo:string,fullpath:string,fullname:string,level:int}> Array of user information (also: $this->users). Note: $this->parentof is also set. */ public function get_full_tree($deleteafterid = 0, $filter = '') {