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 $errors=array(); //!< To return several error codes (or messages)
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 $lines=array();

View File

@ -36,18 +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
*/
@ -117,18 +121,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,10 +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
*/
@ -60,26 +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
*/
public $entity;
/**
* @var mixed Sample property 2
*/
public $date_create;
/**
* @var mixed Sample property 2
*/
public $fk_user;
/**
* @var mixed Sample property 2
*/
@ -687,26 +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

@ -35,7 +35,12 @@ require_once DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php";
class Opensurveysondage extends CommonObject
{
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 $id_sondage;

View File

@ -44,7 +44,12 @@ require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
class Product extends CommonObject
{
public $element='product';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element='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
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 $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

View File

@ -52,7 +52,11 @@ class PriceGlobalVariable
var $code;
var $description;
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

View File

@ -59,7 +59,11 @@ class PriceGlobalVariableUpdater
var $update_interval; //!< Interval in mins
var $next_update; //!< Next update timestamp
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

View File

@ -38,6 +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
*/
@ -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
*/
public $ismultientitymanaged = 1;
/**
* @var string String with name of icon for inventory
*/
@ -121,18 +123,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

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

View File

@ -34,6 +34,7 @@ class MouvementStock extends CommonObject
* @var string Id to identify managed objects
*/
public $element = 'stockmouvement';
/**
* @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
*/
public $element = 'productlot';
/**
* @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
*/
public $element = 'ProductStockEntrepot';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element = 'product_warehouse_properties';
/**
*/
public $tms = '';
public $fk_product;
public $fk_entrepot;
@ -59,9 +57,6 @@ class ProductStockEntrepot extends CommonObject
public $desiredstock;
public $import_key;
/**
*/
/**
* Constructor

View File

@ -34,7 +34,12 @@ class Project extends CommonObject
{
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 $fk_element = 'fk_projet';
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
{
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 $picto = 'task';
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
{
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 $resource_id;

View File

@ -36,18 +36,22 @@ class CompanyPaymentMode extends CommonObject
* @var string ID to identify managed object
*/
public $element = 'companypaymentmode';
/**
* @var string Name of table without prefix where object is stored
*/
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
*/
public $ismultientitymanaged = 2;
/**
* @var int Does companypaymentmode support extrafields ? 0=No, 1=Yes
*/
public $isextrafieldmanaged = 0;
/**
* @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
{
public $element='societe';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element = 'societe';
public $fk_element='fk_soc';
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

View File

@ -39,14 +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
*/

View File

@ -46,7 +46,12 @@ require_once DOL_DOCUMENT_ROOT .'/multicurrency/class/multicurrency.class.php';
class SupplierProposal extends CommonObject
{
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 $fk_element='fk_supplier_proposal';
public $picto='propal';
@ -2647,7 +2652,11 @@ class SupplierProposalLine extends CommonObjectLine
public $error='';
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;

View File

@ -38,22 +38,27 @@ class Ticket extends CommonObject
* @var string ID to identify managed object
*/
public $element = 'ticket';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element = 'ticket';
/**
* @var string Name of field for link to tickets
*/
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
*/
public $ismultientitymanaged = 0;
/**
* @var int Does ticketcore support extrafields ? 0=No, 1=Yes
*/
public $isextrafieldmanaged = 1;
/**
* @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 $error; //!< To return error code (or message)
public $errors = array(); //!< To return several error codes (or messages)
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;

View File

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

View File

@ -41,7 +41,12 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php';
class User extends CommonObject
{
public $element='user';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element='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

View File

@ -36,7 +36,12 @@ if (! empty($conf->ldap->enabled)) require_once DOL_DOCUMENT_ROOT."/core/class/l
class UserGroup extends CommonObject
{
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

View File

@ -39,14 +39,17 @@ 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
*/
@ -56,30 +59,37 @@ class Website extends CommonObject
* @var int
*/
public $entity;
/**
* @var string
*/
public $ref;
/**
* @var string
*/
public $description;
/**
* @var int
*/
public $status;
/**
* @var mixed
*/
public $date_creation;
/**
* @var mixed
*/
public $tms = '';
/**
* @var integer
*/
public $fk_default_home;
/**
* @var string
*/

View File

@ -39,18 +39,17 @@ class WebsitePage extends CommonObject
* @var string Id to identify managed objects
*/
public $element = 'websitepage';
/**
* @var string Name of table without prefix where object is stored
*/
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
*/
public $picto = 'label';
/**
*/
public $fk_website;
public $pageurl;
public $aliasalt;