From 79c3670c208782d80c9512ddb8ae708882c82065 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 11 Feb 2021 21:12:32 +0100 Subject: [PATCH 1/2] doxygen --- test/phpunit/SupplierProposalTest.php | 2 +- test/phpunit/UserGroupTest.php | 8 ++++---- test/phpunit/UserTest.php | 12 ++++++------ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/test/phpunit/SupplierProposalTest.php b/test/phpunit/SupplierProposalTest.php index 65df065529f..bc9263f410c 100644 --- a/test/phpunit/SupplierProposalTest.php +++ b/test/phpunit/SupplierProposalTest.php @@ -187,7 +187,7 @@ class SupplierProposalTest extends PHPUnit\Framework\TestCase /** * testSupplierProposalAddLine * - * @param int $localobject Proposal + * @param SupplierProposal $localobject Proposal * @return void * * @depends testSupplierProposalFetch diff --git a/test/phpunit/UserGroupTest.php b/test/phpunit/UserGroupTest.php index b529496fcfa..46eb3917001 100644 --- a/test/phpunit/UserGroupTest.php +++ b/test/phpunit/UserGroupTest.php @@ -174,7 +174,7 @@ class UserGroupTest extends PHPUnit\Framework\TestCase /** * testUserGroupUpdate * - * @param Object $localobject Group + * @param UserGroup $localobject Group * @return void * @depends testUserGroupFetch * The depends says test is run only if previous is ok @@ -198,7 +198,7 @@ class UserGroupTest extends PHPUnit\Framework\TestCase /** * testUserGroupAddRight * - * @param Object $localobject Object to show + * @param UserGroup $localobject Object to show * @return void * @depends testUserGroupUpdate * The depends says test is run only if previous is ok @@ -221,7 +221,7 @@ class UserGroupTest extends PHPUnit\Framework\TestCase /** * testUserGroupDelRight * - * @param Object $localobject Object + * @param UserGroup $localobject Object * @return void * @depends testUserGroupAddRight * The depends says test is run only if previous is ok @@ -244,7 +244,7 @@ class UserGroupTest extends PHPUnit\Framework\TestCase /** * testUserGroupOther * - * @param Object $localobject Object + * @param UserGroup $localobject Object * @return void * @depends testUserGroupDelRight * The depends says test is run only if previous is ok diff --git a/test/phpunit/UserTest.php b/test/phpunit/UserTest.php index 124ff17c135..ca889fdbc96 100644 --- a/test/phpunit/UserTest.php +++ b/test/phpunit/UserTest.php @@ -179,7 +179,7 @@ class UserTest extends PHPUnit\Framework\TestCase /** * testUserUpdate * - * @param Object $localobject User + * @param User $localobject User * @return void * @depends testUserFetch * The depends says test is run only if previous is ok @@ -210,7 +210,7 @@ class UserTest extends PHPUnit\Framework\TestCase /** * testUserDisable * - * @param Object $localobject User + * @param User $localobject User * @return void * @depends testUserUpdate * The depends says test is run only if previous is ok @@ -234,7 +234,7 @@ class UserTest extends PHPUnit\Framework\TestCase /** * testUserOther * - * @param Object $localobject User + * @param User $localobject User * @return void * @depends testUserDisable * The depends says test is run only if previous is ok @@ -262,7 +262,7 @@ class UserTest extends PHPUnit\Framework\TestCase /** * testUserDelete * - * @param Object $id User + * @param int $id User id * @return void * @depends testUserOther * The depends says test is run only if previous is ok @@ -287,7 +287,7 @@ class UserTest extends PHPUnit\Framework\TestCase /** * testUserAddPermission * - * @param Object $id User + * @param int $id User id * @return void * @depends testUserDelete * The depends says test is run only if previous is ok @@ -314,7 +314,7 @@ class UserTest extends PHPUnit\Framework\TestCase /** * Edit an object to test updates * - * @param mixed $localobject Object User + * @param Object $localobject Object User * @return void */ public function changeProperties(&$localobject) From bcac4386d69b0626dba4a65bca3546a4d4289272 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 11 Feb 2021 21:26:21 +0100 Subject: [PATCH 2/2] doxygen --- htdocs/contact/class/contact.class.php | 93 ++++++++++++++------------ 1 file changed, 51 insertions(+), 42 deletions(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 94eb700ab92..1d2cb3355a5 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -260,10 +260,25 @@ class Contact extends CommonObject public $birthday; public $default_lang; - public $ref_facturation; // Reference number of invoice for which it is contact - public $ref_contrat; // Nb de reference contrat pour lequel il est contact - public $ref_commande; // Nb de reference commande pour lequel il est contact - public $ref_propal; // Nb de reference propal pour lequel il est contact + /** + * @var int Number of invoices for which he is contact + */ + public $ref_facturation; + + /** + * @var int Number of contracts for which he is contact + */ + public $ref_contrat; + + /** + * @var int Number of orders for which he is contact + */ + public $ref_commande; + + /** + * @var int Number of proposals for which he is contact + */ + public $ref_propal; /** * @var int user ID @@ -412,9 +427,15 @@ class Contact extends CommonObject $this->lastname = $this->lastname ?trim($this->lastname) : trim($this->name); $this->firstname = trim($this->firstname); $this->setUpperOrLowerCase(); - if (empty($this->socid)) $this->socid = 0; - if (empty($this->priv)) $this->priv = 0; - if (empty($this->statut)) $this->statut = 0; // This is to convert '' into '0' to avoid bad sql request + if (empty($this->socid)) { + $this->socid = 0; + } + if (empty($this->priv)) { + $this->priv = 0; + } + if (empty($this->statut)) { + $this->statut = 0; // This is to convert '' into '0' to avoid bad sql request + } $this->entity = ((isset($this->entity) && is_numeric($this->entity)) ? $this->entity : $conf->entity); @@ -610,88 +631,72 @@ class Contact extends CommonObject $tmpobj = new User($this->db); $tmpobj->fetch($this->user_id); $usermustbemodified = 0; - if ($tmpobj->office_phone != $this->phone_pro) - { + if ($tmpobj->office_phone != $this->phone_pro) { $tmpobj->office_phone = $this->phone_pro; $usermustbemodified++; } - if ($tmpobj->office_fax != $this->fax) - { + if ($tmpobj->office_fax != $this->fax) { $tmpobj->office_fax = $this->fax; $usermustbemodified++; } - if ($tmpobj->address != $this->address) - { + if ($tmpobj->address != $this->address) { $tmpobj->address = $this->address; $usermustbemodified++; } - if ($tmpobj->town != $this->town) - { + if ($tmpobj->town != $this->town) { $tmpobj->town = $this->town; $usermustbemodified++; } - if ($tmpobj->zip != $this->zip) - { + if ($tmpobj->zip != $this->zip) { $tmpobj->zip = $this->zip; $usermustbemodified++; } - if ($tmpobj->zip != $this->zip) - { + if ($tmpobj->zip != $this->zip) { $tmpobj->state_id = $this->state_id; $usermustbemodified++; } - if ($tmpobj->country_id != $this->country_id) - { + if ($tmpobj->country_id != $this->country_id) { $tmpobj->country_id = $this->country_id; $usermustbemodified++; } - if ($tmpobj->email != $this->email) - { + if ($tmpobj->email != $this->email) { $tmpobj->email = $this->email; $usermustbemodified++; } - if (!empty(array_diff($tmpobj->socialnetworks, $this->socialnetworks))) - { + if (!empty(array_diff($tmpobj->socialnetworks, $this->socialnetworks))) { $tmpobj->socialnetworks = $this->socialnetworks; $usermustbemodified++; } - // if ($tmpobj->skype != $this->skype) - // { + // if ($tmpobj->skype != $this->skype) { // $tmpobj->skype = $this->skype; // $usermustbemodified++; // } - // if ($tmpobj->twitter != $this->twitter) - // { + // if ($tmpobj->twitter != $this->twitter) { // $tmpobj->twitter = $this->twitter; // $usermustbemodified++; // } - // if ($tmpobj->facebook != $this->facebook) - // { + // if ($tmpobj->facebook != $this->facebook) { // $tmpobj->facebook = $this->facebook; // $usermustbemodified++; // } - // if ($tmpobj->linkedin != $this->linkedin) - // { + // if ($tmpobj->linkedin != $this->linkedin) { // $tmpobj->linkedin = $this->linkedin; // $usermustbemodified++; // } - if ($usermustbemodified) - { + if ($usermustbemodified) { $result = $tmpobj->update($user, 0, 1, 1, 1); if ($result < 0) { $error++; } } } - if (!$error && !$notrigger) - { + if (!$error && !$notrigger) { // Call trigger $result = $this->call_trigger('CONTACT_MODIFY', $user); if ($result < 0) { $error++; } // End call triggers } - if (!$error) - { + if (!$error) { $this->db->commit(); return 1; } else { @@ -723,9 +728,13 @@ class Contact extends CommonObject // phpcs:enable global $conf; $dn = ''; - if ($mode == 0) $dn = $conf->global->LDAP_KEY_CONTACTS."=".$info[$conf->global->LDAP_KEY_CONTACTS].",".$conf->global->LDAP_CONTACT_DN; - elseif ($mode == 1) $dn = $conf->global->LDAP_CONTACT_DN; - elseif ($mode == 2) $dn = $conf->global->LDAP_KEY_CONTACTS."=".$info[$conf->global->LDAP_KEY_CONTACTS]; + if ($mode == 0) { + $dn = $conf->global->LDAP_KEY_CONTACTS."=".$info[$conf->global->LDAP_KEY_CONTACTS].",".$conf->global->LDAP_CONTACT_DN; + } elseif ($mode == 1) { + $dn = $conf->global->LDAP_CONTACT_DN; + } elseif ($mode == 2) { + $dn = $conf->global->LDAP_KEY_CONTACTS."=".$info[$conf->global->LDAP_KEY_CONTACTS]; + } return $dn; }