Standardize and update code

This commit is contained in:
Philippe GRAND 2018-08-31 18:27:16 +02:00
parent 2f307aae21
commit 70ae8c6081
18 changed files with 135 additions and 71 deletions

View File

@ -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;
/**

View File

@ -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;
/**

View File

@ -42,6 +42,9 @@ class Comment extends CommonObject
public $fk_user_author;
/**
* @var int Entity
*/
public $entity;
public $import_key;

View File

@ -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;

View File

@ -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;

View File

@ -42,7 +42,11 @@ class Cronjob extends CommonObject
public $picto = 'cron';
public $entity;
/**
* @var int Entity
*/
public $entity;
public $jobtype;
public $tms='';
public $datec='';

View File

@ -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;

View File

@ -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;

View File

@ -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
*/

View File

@ -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
*/

View File

@ -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
*/

View File

@ -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

View File

@ -90,6 +90,9 @@ class Societe extends CommonObject
);
/**
* @var int Entity
*/
public $entity;
/**

View File

@ -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;

View File

@ -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;

View File

@ -76,6 +76,10 @@ class User extends CommonObject
public $admin;
public $login;
public $api_key;
/**
* @var int Entity
*/
public $entity;
//! Clear password in memory

View File

@ -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
/**

View File

@ -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
*/