From 70ae8c6081ac20c622823330431b01353b3ed21b Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 31 Aug 2018 18:27:16 +0200 Subject: [PATCH] Standardize and update code --- .../accountancy/class/bookkeeping.class.php | 9 ++++-- htdocs/adherents/class/adherent.class.php | 3 ++ htdocs/core/class/comment.class.php | 3 ++ .../core/class/emailsenderprofile.class.php | 11 +++++-- htdocs/core/class/link.class.php | 12 +++++--- htdocs/cron/class/cronjob.class.php | 6 +++- htdocs/ecm/class/ecmfiles.class.php | 18 ++++++++--- htdocs/hrm/class/establishment.class.php | 8 +++-- .../template/class/myobject.class.php | 21 ++++++++----- .../class/multicurrency.class.php | 30 +++++++++---------- .../inventory/class/inventory.class.php | 17 +++++++---- .../product/stock/class/productlot.class.php | 8 ++--- htdocs/societe/class/societe.class.php | 3 ++ htdocs/societe/class/societeaccount.class.php | 11 +++++-- htdocs/stripe/class/stripe.class.php | 5 ++++ htdocs/user/class/user.class.php | 4 +++ htdocs/user/class/usergroup.class.php | 9 ++++-- htdocs/website/class/website.class.php | 28 ++++++++--------- 18 files changed, 135 insertions(+), 71 deletions(-) diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index a3a91cdc8e5..aae6374cb50 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -35,22 +35,25 @@ class BookKeeping extends CommonObject * @var string Error code (or message) */ public $error; - + /** * @var string[] Error codes (or messages) */ public $errors = array(); - + /** * @var string Id to identify managed objects */ public $element = 'accountingbookkeeping'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'accounting_bookkeeping'; + /** + * @var int Entity + */ public $entity; /** diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index bf4fe0d73c2..67aa88c6e03 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -114,6 +114,9 @@ class Adherent extends CommonObject var $oldcopy; // To contains a clone of this when we need to save old properties of object + /** + * @var int Entity + */ public $entity; /** diff --git a/htdocs/core/class/comment.class.php b/htdocs/core/class/comment.class.php index 9cc4b8be192..40402eb9717 100644 --- a/htdocs/core/class/comment.class.php +++ b/htdocs/core/class/comment.class.php @@ -42,6 +42,9 @@ class Comment extends CommonObject public $fk_user_author; + /** + * @var int Entity + */ public $entity; public $import_key; diff --git a/htdocs/core/class/emailsenderprofile.class.php b/htdocs/core/class/emailsenderprofile.class.php index e0ff56d6736..33f5032c6e3 100644 --- a/htdocs/core/class/emailsenderprofile.class.php +++ b/htdocs/core/class/emailsenderprofile.class.php @@ -39,17 +39,17 @@ class EmailSenderProfile extends CommonObject * @var string ID to identify managed object */ public $element = 'emailsenderprofile'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'c_email_senderprofile'; - + /** * @var array Does emailsenderprofile support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ public $ismultientitymanaged = 1; - + /** * @var string String with name of icon for emailsenderprofile */ @@ -89,7 +89,12 @@ class EmailSenderProfile extends CommonObject 'active' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>1000, 'notnull'=>-1, 'index'=>1), ); public $rowid; + + /** + * @var int Entity + */ public $entity; + public $label; public $email; public $date_creation; diff --git a/htdocs/core/class/link.class.php b/htdocs/core/class/link.class.php index 951c6e75b02..e9f8c7d9a15 100644 --- a/htdocs/core/class/link.class.php +++ b/htdocs/core/class/link.class.php @@ -32,21 +32,25 @@ class Link extends CommonObject * @var string ID to identify managed object */ public $element = 'link'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'links'; - public $entity; + /** + * @var int Entity + */ + public $entity; + public $datea; public $url; - + /** * @var string proper name for given parameter */ public $label; - + public $objecttype; public $objectid; diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index 53acd0976b4..f2b23abad65 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -42,7 +42,11 @@ class Cronjob extends CommonObject public $picto = 'cron'; - public $entity; + /** + * @var int Entity + */ + public $entity; + public $jobtype; public $tms=''; public $datec=''; diff --git a/htdocs/ecm/class/ecmfiles.class.php b/htdocs/ecm/class/ecmfiles.class.php index d6eff8e697b..056bcd94337 100644 --- a/htdocs/ecm/class/ecmfiles.class.php +++ b/htdocs/ecm/class/ecmfiles.class.php @@ -40,18 +40,23 @@ class EcmFiles extends CommonObject * @var string Id to identify managed objects */ public $element = 'ecmfiles'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'ecm_files'; - + public $picto = 'generic'; public $ref; // hash of file path public $label; // hash of file content (md5_file(dol_osencode($destfull)) public $share; // hash for file sharing, empty by default (example: getRandomPassword(true)) + + /** + * @var int Entity + */ public $entity; + public $filename; public $filepath; public $fullpath_orig; @@ -68,7 +73,7 @@ class EcmFiles extends CommonObject public $acl; public $src_object_type; public $src_object_id; - + /** * Constructor @@ -339,7 +344,7 @@ class EcmFiles extends CommonObject else { $sql .= ' AND t.rowid = '.$this->db->escape($id); // rowid already unique } - + $this->db->plimit(1); // When we search on src or on hash of content (hashforfile) to solve hash conflict when several files has same content, we take first one only $this->db->order('t.rowid', 'ASC'); @@ -830,7 +835,12 @@ class EcmFiles extends CommonObject class EcmfilesLine { public $label; + + /** + * @var int Entity + */ public $entity; + public $filename; public $filepath; public $fullpath_orig; diff --git a/htdocs/hrm/class/establishment.class.php b/htdocs/hrm/class/establishment.class.php index 195e48bb222..8fb13046ee4 100644 --- a/htdocs/hrm/class/establishment.class.php +++ b/htdocs/hrm/class/establishment.class.php @@ -32,12 +32,12 @@ class Establishment extends CommonObject * @var string ID to identify managed object */ public $element='establishment'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='establishment'; - + public $table_element_line = ''; public $fk_element = 'fk_establishment'; public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe @@ -52,6 +52,10 @@ class Establishment extends CommonObject public $zip; public $town; public $status; // 0=open, 1=closed + + /** + * @var int Entity + */ public $entity; public $country_id; diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 15e7a7f84dd..3228305ac70 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -36,22 +36,22 @@ class MyObject extends CommonObject * @var string ID to identify managed object */ public $element = 'myobject'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'mymodule_myobject'; - + /** * @var int Does myobject support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ public $ismultientitymanaged = 0; - + /** * @var int Does myobject support extrafields ? 0=No, 1=Yes */ public $isextrafieldmanaged = 1; - + /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png */ @@ -103,7 +103,12 @@ class MyObject extends CommonObject public $rowid; public $ref; + + /** + * @var int Entity + */ public $entity; + public $label; public $amount; public $status; @@ -122,22 +127,22 @@ class MyObject extends CommonObject * @var int Name of subtable line */ //public $table_element_line = 'myobjectdet'; - + /** * @var int Field with ID of parent key if this field has a parent */ //public $fk_element = 'fk_myobject'; - + /** * @var int Name of subtable class that manage subtable lines */ //public $class_element_line = 'MyObjectline'; - + /** * @var array Array of child tables (child tables to delete before deleting a record) */ //protected $childtables=array('myobjectdet'); - + /** * @var MyObjectLine[] Array of subtable lines */ diff --git a/htdocs/multicurrency/class/multicurrency.class.php b/htdocs/multicurrency/class/multicurrency.class.php index c7822961570..3206c7c566f 100644 --- a/htdocs/multicurrency/class/multicurrency.class.php +++ b/htdocs/multicurrency/class/multicurrency.class.php @@ -42,12 +42,12 @@ class MultiCurrency extends CommonObject * @var string Id to identify managed objects */ public $element = 'multicurrency'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'multicurrency'; - + /** * @var string Name of table without prefix where object is stored */ @@ -62,32 +62,32 @@ class MultiCurrency extends CommonObject * @var mixed Sample property 1 */ public $id; - + /** * @var mixed Sample property 1 */ public $code; - + /** * @var mixed Sample property 2 */ public $name; - + /** - * @var mixed Sample property 2 + * @var int Entity */ public $entity; - + /** * @var mixed Sample property 2 */ public $date_create; - + /** * @var mixed Sample property 2 */ public $fk_user; - + /** * @var mixed Sample property 2 */ @@ -695,32 +695,32 @@ class CurrencyRate extends CommonObjectLine * @var string Id to identify managed objects */ public $element = 'multicurrency_rate'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'multicurrency_rate'; - + /** * @var int ID */ public $id; - + /** * @var double Rate */ public $rate; - + /** * @var date Date synchronisation */ public $date_sync; - + /** * @var int Id of currency */ public $fk_multicurrency; - + /** * @var int Id of entity */ diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index 7ba2d5cf5f1..fe57698619e 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -38,7 +38,7 @@ class Inventory extends CommonObject * @var string ID to identify managed object */ public $element = 'inventory'; - + /** * @var string Name of table without prefix where object is stored */ @@ -48,7 +48,7 @@ class Inventory extends CommonObject * @var array Does inventory support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ public $ismultientitymanaged = 1; - + /** * @var string String with name of icon for inventory */ @@ -101,7 +101,12 @@ class Inventory extends CommonObject public $rowid; public $ref; + + /** + * @var int Entity + */ public $entity; + public $fk_warehouse; public $date_inventory; public $title; @@ -123,22 +128,22 @@ class Inventory extends CommonObject * @var int Name of subtable line */ //public $table_element_line = 'inventorydet'; - + /** * @var int Field with ID of parent key if this field has a parent */ //public $fk_element = 'fk_inventory'; - + /** * @var int Name of subtable class that manage subtable lines */ //public $class_element_line = 'Inventoryline'; - + /** * @var array Array of child tables (child tables to delete before deleting a record) */ //protected $childtables=array('inventorydet'); - + /** * @var InventoryLine[] Array of subtable lines */ diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php index 1ed59eb058f..c0718924f5f 100644 --- a/htdocs/product/stock/class/productlot.class.php +++ b/htdocs/product/stock/class/productlot.class.php @@ -39,7 +39,7 @@ class Productlot extends CommonObject * @var string Id to identify managed objects */ public $element = 'productlot'; - + /** * @var string Name of table without prefix where object is stored */ @@ -55,9 +55,10 @@ class Productlot extends CommonObject public $lines = array(); /** + * @var int Entity */ - public $entity; + public $fk_product; public $batch; public $eatby = ''; @@ -68,9 +69,6 @@ class Productlot extends CommonObject public $fk_user_modif; public $import_key; - /** - */ - /** * Constructor diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 845a19cba58..5d75ab688cf 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -90,6 +90,9 @@ class Societe extends CommonObject ); + /** + * @var int Entity + */ public $entity; /** diff --git a/htdocs/societe/class/societeaccount.class.php b/htdocs/societe/class/societeaccount.class.php index e4c38893e58..76ecf52bc30 100644 --- a/htdocs/societe/class/societeaccount.class.php +++ b/htdocs/societe/class/societeaccount.class.php @@ -39,17 +39,17 @@ class SocieteAccount extends CommonObject * @var string ID to identify managed object */ public $element = 'societeaccount'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'societe_account'; - + /** * @var array Does societeaccount support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ public $ismultientitymanaged = 0; - + /** * @var string String with name of icon for societeaccount. Must be the part after the 'object_' into object_myobject.png */ @@ -100,7 +100,12 @@ class SocieteAccount extends CommonObject 'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>1000, 'notnull'=>1, 'index'=>1, 'default'=>1, 'arrayofkeyval'=>array('1'=>'Active','0'=>'Disabled')), ); public $rowid; + + /** + * @var int Entity + */ public $entity; + public $key_account; public $login; public $pass_encoding; diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index b8472d0b821..969a0e1ab9c 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -33,7 +33,12 @@ class Stripe extends CommonObject public $fk_key; public $id; public $mode; + + /** + * @var int Entity + */ public $entity; + public $statut; public $type; public $code; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 268f4a6c95b..a9f1419378f 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -76,6 +76,10 @@ class User extends CommonObject public $admin; public $login; public $api_key; + + /** + * @var int Entity + */ public $entity; //! Clear password in memory diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index 8f89b4a2e35..6b08b7b732e 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -39,16 +39,19 @@ class UserGroup extends CommonObject * @var string ID to identify managed object */ public $element='usergroup'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='usergroup'; - + public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe public $picto='group'; - public $entity; // Entity of group + /** + * @var int Entity of group + */ + public $entity; public $name; // Name of group /** diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index be6770743bc..442ad133b97 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -39,57 +39,57 @@ class Website extends CommonObject * @var string Id to identify managed objects */ public $element = 'website'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'website'; - + /** * @var array Does website support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ public $ismultientitymanaged = 1; - + /** * @var string String with name of icon for website. Must be the part after the 'object_' into object_myobject.png */ public $picto = 'globe'; /** - * @var int + * @var int Entity */ public $entity; - + /** - * @var string + * @var string Ref */ public $ref; - + /** - * @var string + * @var string description */ public $description; - + /** - * @var int + * @var int Status */ public $status; - + /** * @var mixed */ public $date_creation; - + /** * @var mixed */ public $tms = ''; - + /** * @var integer */ public $fk_default_home; - + /** * @var string */