Update and standardize code

This commit is contained in:
Philippe GRAND 2018-08-22 18:34:50 +02:00
parent 449ef9c464
commit 504b0e3d16
27 changed files with 174 additions and 35 deletions

View File

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

View File

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

View File

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

View File

@ -30,6 +30,9 @@ include_once DOL_DOCUMENT_ROOT . '/compta/deplacement/class/deplacement.class.ph
*/ */
class DeplacementStats extends Stats class DeplacementStats extends Stats
{ {
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element; public $table_element;
var $socid; var $socid;

View File

@ -40,7 +40,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
class FactureRec extends CommonInvoice class FactureRec extends CommonInvoice
{ {
public $element='facturerec'; public $element='facturerec';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element='facture_rec'; public $table_element='facture_rec';
public $table_element_line='facturedet_rec'; public $table_element_line='facturedet_rec';
public $fk_element='fk_facture'; public $fk_element='fk_facture';
public $picto='bill'; public $picto='bill';
@ -1640,6 +1645,10 @@ class FactureRec extends CommonInvoice
class FactureLigneRec extends CommonInvoiceLine class FactureLigneRec extends CommonInvoiceLine
{ {
public $element='facturedetrec'; public $element='facturedetrec';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element='facturedet_rec'; public $table_element='facturedet_rec';
var $date_start_fill; var $date_start_fill;

View File

@ -54,7 +54,12 @@ if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/accoun
class Facture extends CommonInvoice class Facture extends CommonInvoice
{ {
public $element='facture'; public $element='facture';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element='facture'; public $table_element='facture';
public $table_element_line = 'facturedet'; public $table_element_line = 'facturedet';
public $fk_element = 'fk_facture'; public $fk_element = 'fk_facture';
public $picto='bill'; public $picto='bill';
@ -4232,6 +4237,10 @@ class Facture extends CommonInvoice
class FactureLigne extends CommonInvoiceLine class FactureLigne extends CommonInvoiceLine
{ {
public $element='facturedet'; public $element='facturedet';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element='facturedet'; public $table_element='facturedet';
var $oldline; var $oldline;

View File

@ -35,7 +35,11 @@ class FactureStats extends Stats
var $socid; var $socid;
var $userid; var $userid;
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element; public $table_element;
var $from; var $from;
var $field; var $field;
var $where; var $where;

View File

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

View File

@ -34,7 +34,12 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
class RemiseCheque extends CommonObject class RemiseCheque extends CommonObject
{ {
public $element='chequereceipt'; public $element='chequereceipt';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element='bordereau_cheque'; public $table_element='bordereau_cheque';
public $picto = 'payment'; public $picto = 'payment';
var $num; var $num;

View File

@ -34,15 +34,12 @@ class Cpaiement
* @var string Id to identify managed objects * @var string Id to identify managed objects
*/ */
public $element = 'cpaiement'; public $element = 'cpaiement';
/** /**
* @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 = 'c_paiement'; public $table_element = 'c_paiement';
/**
*/
public $code; public $code;
public $libelle; public $libelle;
public $type; public $type;
@ -50,9 +47,6 @@ class Cpaiement
public $accountancy_code; public $accountancy_code;
public $module; public $module;
/**
*/
/** /**
* Constructor * Constructor

View File

@ -37,7 +37,12 @@ require_once DOL_DOCUMENT_ROOT .'/multicurrency/class/multicurrency.class.php';
class Paiement extends CommonObject class Paiement extends CommonObject
{ {
public $element='payment'; public $element='payment';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element='paiement'; public $table_element='paiement';
public $picto = 'payment'; public $picto = 'payment';
var $facid; var $facid;

View File

@ -40,7 +40,12 @@ require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
class BonPrelevement extends CommonObject class BonPrelevement extends CommonObject
{ {
public $element='widthdraw'; public $element='widthdraw';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element='prelevement_bons'; public $table_element='prelevement_bons';
public $picto = 'payment'; public $picto = 'payment';
var $date_echeance; var $date_echeance;

View File

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

View File

@ -29,6 +29,9 @@ include_once DOL_DOCUMENT_ROOT . '/compta/salaries/class/paymentsalary.class.php
*/ */
class SalariesStats extends Stats class SalariesStats extends Stats
{ {
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element; public $table_element;
var $socid; var $socid;

View File

@ -38,14 +38,12 @@ class Cchargesociales
* @var string Id to identify managed objects * @var string Id to identify managed objects
*/ */
public $element = 'cchargesociales'; public $element = 'cchargesociales';
/** /**
* @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 = 'c_chargesociales'; public $table_element = 'c_chargesociales';
/**
*/
public $libelle; public $libelle;
public $deductible; public $deductible;
public $active; public $active;
@ -54,9 +52,6 @@ class Cchargesociales
public $module; public $module;
public $accountancy_code; public $accountancy_code;
/**
*/
/** /**
* Constructor * Constructor

View File

@ -34,7 +34,12 @@ class ChargeSociales extends CommonObject
{ {
public $element='chargesociales'; public $element='chargesociales';
public $table='chargesociales'; public $table='chargesociales';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element='chargesociales'; public $table_element='chargesociales';
public $picto = 'bill'; public $picto = 'bill';
/** /**

View File

@ -32,7 +32,12 @@ require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'
class PaymentSocialContribution extends CommonObject class PaymentSocialContribution extends CommonObject
{ {
public $element='paiementcharge'; //!< Id that identify managed objects public $element='paiementcharge'; //!< Id that identify managed objects
public $table_element='paiementcharge'; //!< Name of table without prefix where object is stored
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element='paiementcharge';
public $picto = 'payment'; public $picto = 'payment';
var $fk_charge; var $fk_charge;

View File

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

View File

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

View File

@ -42,15 +42,22 @@ require_once DOL_DOCUMENT_ROOT . '/margin/lib/margins.lib.php';
class Contrat extends CommonObject class Contrat extends CommonObject
{ {
public $element='contrat'; public $element='contrat';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element='contrat'; public $table_element='contrat';
public $table_element_line='contratdet'; public $table_element_line='contratdet';
public $fk_element='fk_contrat'; public $fk_element='fk_contrat';
public $picto='contract'; public $picto='contract';
/** /**
* 0=No test on entity, 1=Test with field entity, 2=Test with link by societe * 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
* @var int * @var int
*/ */
public $ismultientitymanaged = 1; public $ismultientitymanaged = 1;
/** /**
* 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user * 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user
* @var integer * @var integer
@ -2452,6 +2459,10 @@ class Contrat extends CommonObject
class ContratLigne extends CommonObjectLine class ContratLigne extends CommonObjectLine
{ {
public $element='contratdet'; public $element='contratdet';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element='contratdet'; public $table_element='contratdet';
/** /**

View File

@ -5,7 +5,11 @@
class Comment extends CommonObject class Comment extends CommonObject
{ {
public $element='comment'; //!< Id that identify managed objects public $element='comment'; //!< Id that identify managed objects
public $table_element='comment'; //!< Name of table without prefix where object is stored
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element='comment';
public $fk_element; public $fk_element;
public $element_type; public $element_type;

View File

@ -46,47 +46,58 @@ abstract class CommonObject
* @var DoliDb Database handler (result of a new DoliDB) * @var DoliDb Database handler (result of a new DoliDB)
*/ */
public $db; public $db;
/** /**
* @var int The object identifier * @var int The object identifier
*/ */
public $id; public $id;
/** /**
* @var string Error string * @var string Error string
* @see errors * @see errors
*/ */
public $error; public $error;
/** /**
* @var string[] Array of error strings * @var string[] Array of error strings
*/ */
public $errors=array(); public $errors=array();
/** /**
* @var string * @var string
*/ */
public $element; public $element;
/** /**
* @var string * @var string Name of table without prefix where object is stored
*/ */
public $table_element; public $table_element
/** /**
* @var * @var
*/ */
public $table_element_line; public $table_element_line;
/** /**
* @var string Key value used to track if data is coming from import wizard * @var string Key value used to track if data is coming from import wizard
*/ */
public $import_key; public $import_key;
/** /**
* @var mixed Contains data to manage extrafields * @var mixed Contains data to manage extrafields
*/ */
public $array_options=array(); public $array_options=array();
/** /**
* @var int[][] Array of linked objects ids. Loaded by ->fetchObjectLinked * @var int[][] Array of linked objects ids. Loaded by ->fetchObjectLinked
*/ */
public $linkedObjectsIds; public $linkedObjectsIds;
/** /**
* @var mixed Array of linked objects. Loaded by ->fetchObjectLinked * @var mixed Array of linked objects. Loaded by ->fetchObjectLinked
*/ */
public $linkedObjects; public $linkedObjects;
/** /**
* @var Object To store a cloned copy of object before to edit it and keep track of old properties * @var Object To store a cloned copy of object before to edit it and keep track of old properties
*/ */
@ -116,11 +127,13 @@ abstract class CommonObject
* @see fetch_projet() * @see fetch_projet()
*/ */
public $project; public $project;
/** /**
* @var int The related project ID * @var int The related project ID
* @see setProject(), project * @see setProject(), project
*/ */
public $fk_project; public $fk_project;
/** /**
* @deprecated * @deprecated
* @see project * @see project
@ -132,6 +145,7 @@ abstract class CommonObject
* @see fetch_contact() * @see fetch_contact()
*/ */
public $contact; public $contact;
/** /**
* @var int The related contact ID * @var int The related contact ID
* @see fetch_contact() * @see fetch_contact()
@ -165,14 +179,17 @@ abstract class CommonObject
* @var string The object's reference * @var string The object's reference
*/ */
public $ref; public $ref;
/** /**
* @var string The object's previous reference * @var string The object's previous reference
*/ */
public $ref_previous; public $ref_previous;
/** /**
* @var string The object's next reference * @var string The object's next reference
*/ */
public $ref_next; public $ref_next;
/** /**
* @var string An external reference for the object * @var string An external reference for the object
*/ */
@ -189,36 +206,43 @@ abstract class CommonObject
* @see getFullAddress() * @see getFullAddress()
*/ */
public $country; public $country;
/** /**
* @var int * @var int
* @see getFullAddress(), country * @see getFullAddress(), country
*/ */
public $country_id; public $country_id;
/** /**
* @var string * @var string
* @see getFullAddress(), isInEEC(), country * @see getFullAddress(), isInEEC(), country
*/ */
public $country_code; public $country_code;
/** /**
* @var string * @var string
* @see getFullAddress() * @see getFullAddress()
*/ */
public $state; public $state;
/** /**
* @var int * @var int
* @see getFullAddress(), state * @see getFullAddress(), state
*/ */
public $state_id; public $state_id;
/** /**
* @var string * @var string
* @see getFullAddress(), state * @see getFullAddress(), state
*/ */
public $state_code; public $state_code;
/** /**
* @var string * @var string
* @see getFullAddress(), region * @see getFullAddress(), region
*/ */
public $region; public $region;
/** /**
* @var string * @var string
* @see getFullAddress(), region * @see getFullAddress(), region
@ -230,16 +254,19 @@ abstract class CommonObject
* @see fetch_barcode() * @see fetch_barcode()
*/ */
public $barcode_type; public $barcode_type;
/** /**
* @var string * @var string
* @see fetch_barcode(), barcode_type * @see fetch_barcode(), barcode_type
*/ */
public $barcode_type_code; public $barcode_type_code;
/** /**
* @var string * @var string
* @see fetch_barcode(), barcode_type * @see fetch_barcode(), barcode_type
*/ */
public $barcode_type_label; public $barcode_type_label;
/** /**
* @var string * @var string
* @see fetch_barcode(), barcode_type * @see fetch_barcode(), barcode_type
@ -257,6 +284,7 @@ abstract class CommonObject
* @see setPaymentTerms() * @see setPaymentTerms()
*/ */
public $cond_reglement_id; public $cond_reglement_id;
/** /**
* @var int Payment terms ID * @var int Payment terms ID
* @deprecated Kept for compatibility * @deprecated Kept for compatibility
@ -294,11 +322,13 @@ abstract class CommonObject
* @see update_note() * @see update_note()
*/ */
public $note_public; public $note_public;
/** /**
* @var string Private note * @var string Private note
* @see update_note() * @see update_note()
*/ */
public $note_private; public $note_private;
/** /**
* @deprecated * @deprecated
* @see note_public * @see note_public
@ -310,21 +340,25 @@ abstract class CommonObject
* @see update_price() * @see update_price()
*/ */
public $total_ht; public $total_ht;
/** /**
* @var float Total VAT amount * @var float Total VAT amount
* @see update_price() * @see update_price()
*/ */
public $total_tva; public $total_tva;
/** /**
* @var float Total local tax 1 amount * @var float Total local tax 1 amount
* @see update_price() * @see update_price()
*/ */
public $total_localtax1; public $total_localtax1;
/** /**
* @var float Total local tax 2 amount * @var float Total local tax 2 amount
* @see update_price() * @see update_price()
*/ */
public $total_localtax2; public $total_localtax2;
/** /**
* @var float Total amount with taxes * @var float Total amount with taxes
* @see update_price() * @see update_price()
@ -347,11 +381,13 @@ abstract class CommonObject
* @see setIncoterms() * @see setIncoterms()
*/ */
public $fk_incoterms; public $fk_incoterms;
/** /**
* @var string * @var string
* @see SetIncoterms() * @see SetIncoterms()
*/ */
public $libelle_incoterms; public $libelle_incoterms;
/** /**
* @var string * @var string
* @see display_incoterms() * @see display_incoterms()

View File

@ -36,6 +36,7 @@ class Ctyperesource
* @var string Id to identify managed objects * @var string Id to identify managed objects
*/ */
public $element = 'ctyperesource'; public $element = 'ctyperesource';
/** /**
* @var string Name of table without prefix where object is stored * @var string Name of table without prefix where object is stored
*/ */
@ -46,16 +47,10 @@ class Ctyperesource
*/ */
public $lines = array(); public $lines = array();
/**
*/
public $code; public $code;
public $label; public $label;
public $active; public $active;
/**
*/
/** /**
* Constructor * Constructor

View File

@ -39,14 +39,17 @@ class EmailSenderProfile extends CommonObject
* @var string ID to identify managed object * @var string ID to identify managed object
*/ */
public $element = 'emailsenderprofile'; public $element = 'emailsenderprofile';
/** /**
* @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 = 'c_email_senderprofile'; 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 * @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; public $ismultientitymanaged = 1;
/** /**
* @var string String with name of icon for emailsenderprofile * @var string String with name of icon for emailsenderprofile
*/ */

View File

@ -35,7 +35,11 @@
class Events // extends CommonObject class Events // extends CommonObject
{ {
public $element='events'; //!< Id that identify managed objects public $element='events'; //!< Id that identify managed objects
public $table_element='events'; //!< Name of table without prefix where object is stored
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element='events';
/** /**
* @var int ID * @var int ID

View File

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

@ -29,6 +29,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
class Link extends CommonObject class Link extends CommonObject
{ {
public $element = 'link'; public $element = 'link';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element = 'links'; public $table_element = 'links';
public $entity; public $entity;