Update and standardize code

This commit is contained in:
Philippe GRAND 2018-08-22 19:56:24 +02:00
parent 06da7f54a2
commit 0c75c41e7b
27 changed files with 143 additions and 20 deletions

View File

@ -38,6 +38,10 @@ class CommandeFournisseurDispatch extends CommonObject
public $error; //!< To return error code (or message) public $error; //!< To return error code (or message)
public $errors=array(); //!< To return several error codes (or messages) public $errors=array(); //!< To return several error codes (or messages)
public $element='commandefournisseurdispatch'; //!< Id that identify managed objects public $element='commandefournisseurdispatch'; //!< Id that identify managed objects
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element='commande_fournisseur_dispatch'; //!< Name of table without prefix where object is stored public $table_element='commande_fournisseur_dispatch'; //!< Name of table without prefix where object is stored
public $lines=array(); public $lines=array();

View File

@ -36,18 +36,22 @@ class MyObject extends CommonObject
* @var string ID to identify managed object * @var string ID to identify managed object
*/ */
public $element = 'myobject'; public $element = 'myobject';
/** /**
* @var string Name of table without prefix where object is stored * @var string Name of table without prefix where object is stored
*/ */
public $table_element = 'mymodule_myobject'; 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 * @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; public $ismultientitymanaged = 0;
/** /**
* @var int Does myobject support extrafields ? 0=No, 1=Yes * @var int Does myobject support extrafields ? 0=No, 1=Yes
*/ */
public $isextrafieldmanaged = 1; public $isextrafieldmanaged = 1;
/** /**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/ */
@ -117,18 +121,22 @@ class MyObject extends CommonObject
* @var int Name of subtable line * @var int Name of subtable line
*/ */
//public $table_element_line = 'myobjectdet'; //public $table_element_line = 'myobjectdet';
/** /**
* @var int Field with ID of parent key if this field has a parent * @var int Field with ID of parent key if this field has a parent
*/ */
//public $fk_element = 'fk_myobject'; //public $fk_element = 'fk_myobject';
/** /**
* @var int Name of subtable class that manage subtable lines * @var int Name of subtable class that manage subtable lines
*/ */
//public $class_element_line = 'MyObjectline'; //public $class_element_line = 'MyObjectline';
/** /**
* @var array Array of child tables (child tables to delete before deleting a record) * @var array Array of child tables (child tables to delete before deleting a record)
*/ */
//protected $childtables=array('myobjectdet'); //protected $childtables=array('myobjectdet');
/** /**
* @var MyObjectLine[] Array of subtable lines * @var MyObjectLine[] Array of subtable lines
*/ */

View File

@ -42,10 +42,12 @@ class MultiCurrency extends CommonObject
* @var string Id to identify managed objects * @var string Id to identify managed objects
*/ */
public $element = 'multicurrency'; public $element = 'multicurrency';
/** /**
* @var string Name of table without prefix where object is stored * @var string Name of table without prefix where object is stored
*/ */
public $table_element = 'multicurrency'; public $table_element = 'multicurrency';
/** /**
* @var string Name of table without prefix where object is stored * @var string Name of table without prefix where object is stored
*/ */
@ -60,26 +62,32 @@ class MultiCurrency extends CommonObject
* @var mixed Sample property 1 * @var mixed Sample property 1
*/ */
public $id; public $id;
/** /**
* @var mixed Sample property 1 * @var mixed Sample property 1
*/ */
public $code; public $code;
/** /**
* @var mixed Sample property 2 * @var mixed Sample property 2
*/ */
public $name; public $name;
/** /**
* @var mixed Sample property 2 * @var mixed Sample property 2
*/ */
public $entity; public $entity;
/** /**
* @var mixed Sample property 2 * @var mixed Sample property 2
*/ */
public $date_create; public $date_create;
/** /**
* @var mixed Sample property 2 * @var mixed Sample property 2
*/ */
public $fk_user; public $fk_user;
/** /**
* @var mixed Sample property 2 * @var mixed Sample property 2
*/ */
@ -687,26 +695,32 @@ class CurrencyRate extends CommonObjectLine
* @var string Id to identify managed objects * @var string Id to identify managed objects
*/ */
public $element = 'multicurrency_rate'; public $element = 'multicurrency_rate';
/** /**
* @var string Name of table without prefix where object is stored * @var string Name of table without prefix where object is stored
*/ */
public $table_element = 'multicurrency_rate'; public $table_element = 'multicurrency_rate';
/** /**
* @var int ID * @var int ID
*/ */
public $id; public $id;
/** /**
* @var double Rate * @var double Rate
*/ */
public $rate; public $rate;
/** /**
* @var date Date synchronisation * @var date Date synchronisation
*/ */
public $date_sync; public $date_sync;
/** /**
* @var int Id of currency * @var int Id of currency
*/ */
public $fk_multicurrency; public $fk_multicurrency;
/** /**
* @var int Id of entity * @var int Id of entity
*/ */

View File

@ -35,7 +35,12 @@ require_once DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php";
class Opensurveysondage extends CommonObject class Opensurveysondage extends CommonObject
{ {
public $element='opensurvey_sondage'; //!< Id that identify managed objects public $element='opensurvey_sondage'; //!< Id that identify managed objects
public $table_element='opensurvey_sondage'; //!< Name of table without prefix where object is stored
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element='opensurvey_sondage';
public $picto = 'opensurvey'; public $picto = 'opensurvey';
public $id_sondage; public $id_sondage;

View File

@ -44,7 +44,12 @@ require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
class Product extends CommonObject class Product extends CommonObject
{ {
public $element='product'; public $element='product';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element='product'; public $table_element='product';
public $fk_element='fk_product'; public $fk_element='fk_product';
protected $childtables=array('supplier_proposaldet', 'propaldet','commandedet','facturedet','contratdet','facture_fourn_det','commande_fournisseurdet'); // To test if we can delete object protected $childtables=array('supplier_proposaldet', 'propaldet','commandedet','facturedet','contratdet','facture_fourn_det','commande_fournisseurdet'); // To test if we can delete object
public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe

View File

@ -51,7 +51,11 @@ class PriceExpression
var $title; var $title;
var $expression; var $expression;
public $table_element = "c_price_expression";
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element = "c_price_expression";
/** /**
* Constructor * Constructor

View File

@ -52,7 +52,11 @@ class PriceGlobalVariable
var $code; var $code;
var $description; var $description;
var $value; var $value;
public $table_element = "c_price_global_variable";
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element = "c_price_global_variable";
/** /**
* Constructor * Constructor

View File

@ -59,7 +59,11 @@ class PriceGlobalVariableUpdater
var $update_interval; //!< Interval in mins var $update_interval; //!< Interval in mins
var $next_update; //!< Next update timestamp var $next_update; //!< Next update timestamp
var $last_status; var $last_status;
public $table_element = "c_price_global_variable_updater";
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element = "c_price_global_variable_updater";
/** /**
* Constructor * Constructor

View File

@ -38,6 +38,7 @@ class Inventory extends CommonObject
* @var string ID to identify managed object * @var string ID to identify managed object
*/ */
public $element = 'inventory'; public $element = 'inventory';
/** /**
* @var string Name of table without prefix where object is stored * @var string Name of table without prefix where object is stored
*/ */
@ -47,6 +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 * @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; public $ismultientitymanaged = 1;
/** /**
* @var string String with name of icon for inventory * @var string String with name of icon for inventory
*/ */
@ -121,18 +123,22 @@ class Inventory extends CommonObject
* @var int Name of subtable line * @var int Name of subtable line
*/ */
//public $table_element_line = 'inventorydet'; //public $table_element_line = 'inventorydet';
/** /**
* @var int Field with ID of parent key if this field has a parent * @var int Field with ID of parent key if this field has a parent
*/ */
//public $fk_element = 'fk_inventory'; //public $fk_element = 'fk_inventory';
/** /**
* @var int Name of subtable class that manage subtable lines * @var int Name of subtable class that manage subtable lines
*/ */
//public $class_element_line = 'Inventoryline'; //public $class_element_line = 'Inventoryline';
/** /**
* @var array Array of child tables (child tables to delete before deleting a record) * @var array Array of child tables (child tables to delete before deleting a record)
*/ */
//protected $childtables=array('inventorydet'); //protected $childtables=array('inventorydet');
/** /**
* @var InventoryLine[] Array of subtable lines * @var InventoryLine[] Array of subtable lines
*/ */

View File

@ -34,7 +34,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
class Entrepot extends CommonObject class Entrepot extends CommonObject
{ {
public $element='stock'; public $element='stock';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element='entrepot'; public $table_element='entrepot';
public $picto='stock'; public $picto='stock';
/** /**

View File

@ -34,6 +34,7 @@ class MouvementStock extends CommonObject
* @var string Id to identify managed objects * @var string Id to identify managed objects
*/ */
public $element = 'stockmouvement'; public $element = 'stockmouvement';
/** /**
* @var string Name of table without prefix where object is stored * @var string Name of table without prefix where object is stored
*/ */

View File

@ -39,6 +39,7 @@ class Productlot extends CommonObject
* @var string Id to identify managed objects * @var string Id to identify managed objects
*/ */
public $element = 'productlot'; public $element = 'productlot';
/** /**
* @var string Name of table without prefix where object is stored * @var string Name of table without prefix where object is stored
*/ */

View File

@ -44,14 +44,12 @@ class ProductStockEntrepot extends CommonObject
* @var string Id to identify managed objects * @var string Id to identify managed objects
*/ */
public $element = 'ProductStockEntrepot'; public $element = 'ProductStockEntrepot';
/** /**
* @var string Name of table without prefix where object is stored * @var string Name of table without prefix where object is stored
*/ */
public $table_element = 'product_warehouse_properties'; public $table_element = 'product_warehouse_properties';
/**
*/
public $tms = ''; public $tms = '';
public $fk_product; public $fk_product;
public $fk_entrepot; public $fk_entrepot;
@ -59,9 +57,6 @@ class ProductStockEntrepot extends CommonObject
public $desiredstock; public $desiredstock;
public $import_key; public $import_key;
/**
*/
/** /**
* Constructor * Constructor

View File

@ -34,7 +34,12 @@ class Project extends CommonObject
{ {
public $element = 'project'; //!< Id that identify managed objects public $element = 'project'; //!< Id that identify managed objects
public $table_element = 'projet'; //!< Name of table without prefix where object is stored
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element = 'projet';
public $table_element_line = 'projet_task'; public $table_element_line = 'projet_task';
public $fk_element = 'fk_projet'; public $fk_element = 'fk_projet';
public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe

View File

@ -32,7 +32,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
class Task extends CommonObject class Task extends CommonObject
{ {
public $element='project_task'; //!< Id that identify managed objects public $element='project_task'; //!< Id that identify managed objects
public $table_element='projet_task'; //!< Name of table without prefix where object is stored
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element='projet_task';
public $fk_element='fk_task'; public $fk_element='fk_task';
public $picto = 'task'; public $picto = 'task';
protected $childtables=array('projet_task_time'); // To test if we can delete object protected $childtables=array('projet_task_time'); // To test if we can delete object

View File

@ -31,7 +31,12 @@ require_once DOL_DOCUMENT_ROOT."/core/lib/functions2.lib.php";
class Dolresource extends CommonObject class Dolresource extends CommonObject
{ {
public $element='dolresource'; //!< Id that identify managed objects public $element='dolresource'; //!< Id that identify managed objects
public $table_element='resource'; //!< Name of table without prefix where object is stored
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element='resource';
public $picto = 'resource'; public $picto = 'resource';
public $resource_id; public $resource_id;

View File

@ -36,18 +36,22 @@ class CompanyPaymentMode extends CommonObject
* @var string ID to identify managed object * @var string ID to identify managed object
*/ */
public $element = 'companypaymentmode'; public $element = 'companypaymentmode';
/** /**
* @var string Name of table without prefix where object is stored * @var string Name of table without prefix where object is stored
*/ */
public $table_element = 'societe_rib'; public $table_element = 'societe_rib';
/** /**
* @var int Does companypaymentmode support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe * @var int Does companypaymentmode support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
*/ */
public $ismultientitymanaged = 2; public $ismultientitymanaged = 2;
/** /**
* @var int Does companypaymentmode support extrafields ? 0=No, 1=Yes * @var int Does companypaymentmode support extrafields ? 0=No, 1=Yes
*/ */
public $isextrafieldmanaged = 0; public $isextrafieldmanaged = 0;
/** /**
* @var string String with name of icon for companypaymentmode. Must be the part after the 'object_' into object_companypaymentmode.png * @var string String with name of icon for companypaymentmode. Must be the part after the 'object_' into object_companypaymentmode.png
*/ */

View File

@ -42,7 +42,12 @@ require_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php';
class Societe extends CommonObject class Societe extends CommonObject
{ {
public $element='societe'; public $element='societe';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element = 'societe'; public $table_element = 'societe';
public $fk_element='fk_soc'; public $fk_element='fk_soc';
public $fieldsforcombobox='nom,name_alias'; public $fieldsforcombobox='nom,name_alias';
protected $childtables=array("supplier_proposal"=>'SupplierProposal',"propal"=>'Proposal',"commande"=>'Order',"facture"=>'Invoice',"facture_rec"=>'RecurringInvoiceTemplate',"contrat"=>'Contract',"fichinter"=>'Fichinter',"facture_fourn"=>'SupplierInvoice',"commande_fournisseur"=>'SupplierOrder',"projet"=>'Project',"expedition"=>'Shipment',"prelevement_lignes"=>'DirectDebitRecord'); // To test if we can delete object protected $childtables=array("supplier_proposal"=>'SupplierProposal',"propal"=>'Proposal',"commande"=>'Order',"facture"=>'Invoice',"facture_rec"=>'RecurringInvoiceTemplate',"contrat"=>'Contract',"fichinter"=>'Fichinter',"facture_fourn"=>'SupplierInvoice',"commande_fournisseur"=>'SupplierOrder',"projet"=>'Project',"expedition"=>'Shipment',"prelevement_lignes"=>'DirectDebitRecord'); // To test if we can delete object

View File

@ -39,14 +39,17 @@ class SocieteAccount extends CommonObject
* @var string ID to identify managed object * @var string ID to identify managed object
*/ */
public $element = 'societeaccount'; public $element = 'societeaccount';
/** /**
* @var string Name of table without prefix where object is stored * @var string Name of table without prefix where object is stored
*/ */
public $table_element = 'societe_account'; 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 * @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; public $ismultientitymanaged = 0;
/** /**
* @var string String with name of icon for societeaccount. Must be the part after the 'object_' into object_myobject.png * @var string String with name of icon for societeaccount. Must be the part after the 'object_' into object_myobject.png
*/ */

View File

@ -46,7 +46,12 @@ require_once DOL_DOCUMENT_ROOT .'/multicurrency/class/multicurrency.class.php';
class SupplierProposal extends CommonObject class SupplierProposal extends CommonObject
{ {
public $element='supplier_proposal'; public $element='supplier_proposal';
public $table_element='supplier_proposal';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element='supplier_proposal';
public $table_element_line='supplier_proposaldet'; public $table_element_line='supplier_proposaldet';
public $fk_element='fk_supplier_proposal'; public $fk_element='fk_supplier_proposal';
public $picto='propal'; public $picto='propal';
@ -2647,7 +2652,11 @@ class SupplierProposalLine extends CommonObjectLine
public $error=''; public $error='';
public $element='supplier_proposaldet'; public $element='supplier_proposaldet';
public $table_element='supplier_proposaldet';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element='supplier_proposaldet';
var $oldline; var $oldline;

View File

@ -38,22 +38,27 @@ class Ticket extends CommonObject
* @var string ID to identify managed object * @var string ID to identify managed object
*/ */
public $element = 'ticket'; public $element = 'ticket';
/** /**
* @var string Name of table without prefix where object is stored * @var string Name of table without prefix where object is stored
*/ */
public $table_element = 'ticket'; public $table_element = 'ticket';
/** /**
* @var string Name of field for link to tickets * @var string Name of field for link to tickets
*/ */
public $fk_element='fk_ticket'; public $fk_element='fk_ticket';
/** /**
* @var int Does ticketcore support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe * @var int Does ticketcore support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
*/ */
public $ismultientitymanaged = 0; public $ismultientitymanaged = 0;
/** /**
* @var int Does ticketcore support extrafields ? 0=No, 1=Yes * @var int Does ticketcore support extrafields ? 0=No, 1=Yes
*/ */
public $isextrafieldmanaged = 1; public $isextrafieldmanaged = 1;
/** /**
* @var string String with name of icon for ticketcore. Must be the part after the 'object_' into object_ticketcore.png * @var string String with name of icon for ticketcore. Must be the part after the 'object_' into object_ticketcore.png
*/ */

View File

@ -35,8 +35,12 @@ class Ticketlogs// extends CommonObject
public $db; //!< To store db handler public $db; //!< To store db handler
public $error; //!< To return error code (or message) public $error; //!< To return error code (or message)
public $errors = array(); //!< To return several error codes (or messages) public $errors = array(); //!< To return several error codes (or messages)
public $element = 'ticketlogs'; //!< Id that identify managed objects public $element = 'ticketlogs'; //!< Id that identify managed objects
public $table_element = 'ticketlogs'; //!< Name of table without prefix where object is stored /**
* @var string Name of table without prefix where object is stored
*/
public $table_element = 'ticketlogs'; //!< Name of table without prefix where object is stored
public $id; public $id;

View File

@ -29,7 +29,10 @@ require_once 'ticket.class.php';
*/ */
class TicketStats extends Stats class TicketStats extends Stats
{ {
public $table_element; /**
* @var string Name of table without prefix where object is stored
*/
public $table_element;
public $socid; public $socid;
public $userid; public $userid;

View File

@ -41,7 +41,12 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php';
class User extends CommonObject class User extends CommonObject
{ {
public $element='user'; public $element='user';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element='user'; public $table_element='user';
public $fk_element='fk_user'; public $fk_element='fk_user';
public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe

View File

@ -36,7 +36,12 @@ if (! empty($conf->ldap->enabled)) require_once DOL_DOCUMENT_ROOT."/core/class/l
class UserGroup extends CommonObject class UserGroup extends CommonObject
{ {
public $element='usergroup'; public $element='usergroup';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element='usergroup'; public $table_element='usergroup';
public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
public $picto='group'; public $picto='group';
public $entity; // Entity of group public $entity; // Entity of group

View File

@ -39,14 +39,17 @@ class Website extends CommonObject
* @var string Id to identify managed objects * @var string Id to identify managed objects
*/ */
public $element = 'website'; public $element = 'website';
/** /**
* @var string Name of table without prefix where object is stored * @var string Name of table without prefix where object is stored
*/ */
public $table_element = 'website'; 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 * @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; public $ismultientitymanaged = 1;
/** /**
* @var string String with name of icon for website. Must be the part after the 'object_' into object_myobject.png * @var string String with name of icon for website. Must be the part after the 'object_' into object_myobject.png
*/ */
@ -56,30 +59,37 @@ class Website extends CommonObject
* @var int * @var int
*/ */
public $entity; public $entity;
/** /**
* @var string * @var string
*/ */
public $ref; public $ref;
/** /**
* @var string * @var string
*/ */
public $description; public $description;
/** /**
* @var int * @var int
*/ */
public $status; public $status;
/** /**
* @var mixed * @var mixed
*/ */
public $date_creation; public $date_creation;
/** /**
* @var mixed * @var mixed
*/ */
public $tms = ''; public $tms = '';
/** /**
* @var integer * @var integer
*/ */
public $fk_default_home; public $fk_default_home;
/** /**
* @var string * @var string
*/ */

View File

@ -39,18 +39,17 @@ class WebsitePage extends CommonObject
* @var string Id to identify managed objects * @var string Id to identify managed objects
*/ */
public $element = 'websitepage'; public $element = 'websitepage';
/** /**
* @var string Name of table without prefix where object is stored * @var string Name of table without prefix where object is stored
*/ */
public $table_element = 'website_page'; public $table_element = 'website_page';
/** /**
* @var string String with name of icon for websitepage. Must be the part after the 'object_' into object_myobject.png * @var string String with name of icon for websitepage. Must be the part after the 'object_' into object_myobject.png
*/ */
public $picto = 'label'; public $picto = 'label';
/**
*/
public $fk_website; public $fk_website;
public $pageurl; public $pageurl;
public $aliasalt; public $aliasalt;