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
{
public $element = 'bank_account';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element = 'bank_account';
public $picto = 'account';
/**

View File

@ -31,7 +31,12 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php';
class PaymentVarious extends CommonObject
{
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';
/**

View File

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

View File

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

View File

@ -40,7 +40,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
class FactureRec extends CommonInvoice
{
public $element='facturerec';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element='facture_rec';
public $table_element_line='facturedet_rec';
public $fk_element='fk_facture';
public $picto='bill';
@ -1640,6 +1645,10 @@ class FactureRec extends CommonInvoice
class FactureLigneRec extends CommonInvoiceLine
{
public $element='facturedetrec';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element='facturedet_rec';
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
{
public $element='facture';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element='facture';
public $table_element_line = 'facturedet';
public $fk_element = 'fk_facture';
public $picto='bill';
@ -4232,7 +4237,11 @@ class Facture extends CommonInvoice
class FactureLigne extends CommonInvoiceLine
{
public $element='facturedet';
public $table_element='facturedet';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element='facturedet';
var $oldline;

View File

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

View File

@ -30,7 +30,12 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php';
class Localtax extends CommonObject
{
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';
var $ltt;

View File

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

View File

@ -34,15 +34,12 @@ class Cpaiement
* @var string Id to identify managed objects
*/
public $element = 'cpaiement';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element = 'c_paiement';
/**
*/
public $code;
public $libelle;
public $type;
@ -50,9 +47,6 @@ class Cpaiement
public $accountancy_code;
public $module;
/**
*/
/**
* Constructor

View File

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

View File

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

View File

@ -32,7 +32,12 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php';
class PaymentSalary extends CommonObject
{
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 $tms;

View File

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

View File

@ -38,14 +38,12 @@ class Cchargesociales
* @var string Id to identify managed objects
*/
public $element = 'cchargesociales';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element = 'c_chargesociales';
/**
*/
public $libelle;
public $deductible;
public $active;
@ -53,9 +51,6 @@ class Cchargesociales
public $fk_pays;
public $module;
public $accountancy_code;
/**
*/
/**

View File

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

View File

@ -32,7 +32,12 @@ require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'
class PaymentSocialContribution extends CommonObject
{
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';
var $fk_charge;

View File

@ -34,7 +34,12 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php';
class Tva extends CommonObject
{
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';
var $tms;

View File

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

View File

@ -42,15 +42,22 @@ require_once DOL_DOCUMENT_ROOT . '/margin/lib/margins.lib.php';
class Contrat extends CommonObject
{
public $element='contrat';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element='contrat';
public $table_element_line='contratdet';
public $fk_element='fk_contrat';
public $picto='contract';
/**
* 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
* @var int
*/
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
* @var integer
@ -2452,7 +2459,11 @@ class Contrat extends CommonObject
class ContratLigne extends CommonObjectLine
{
public $element='contratdet';
public $table_element='contratdet';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element='contratdet';
/**
* @var int ID

View File

@ -5,7 +5,11 @@
class Comment extends CommonObject
{
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 $element_type;

View File

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

View File

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

View File

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

View File

@ -35,7 +35,11 @@
class Events // extends CommonObject
{
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

View File

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

View File

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