Qual: More POO.

Qual: Doxygen
This commit is contained in:
Laurent Destailleur 2011-09-20 17:19:46 +00:00
parent 9b69ef27ba
commit be6286c4b8
45 changed files with 274 additions and 283 deletions

View File

@ -38,12 +38,9 @@ require_once(DOL_DOCUMENT_ROOT."/lib/date.lib.php");
*/ */
class Adherent extends CommonObject class Adherent extends CommonObject
{ {
var $db; public $element='member';
var $error; public $table_element='adherent';
var $errors=array(); protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
var $element='member';
var $table_element='adherent';
var $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
var $id; var $id;
var $ref; var $ref;
@ -1938,7 +1935,11 @@ class Adherent extends CommonObject
/** /**
* Initialise le membre avec valeurs fictives aleatoire * Initialise an instance with random values.
* Used to build previews or test instances.
* id must be 0 if object instance is a specimen.
*
* @return void
*/ */
function initAsSpecimen() function initAsSpecimen()
{ {

View File

@ -33,10 +33,7 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php");
*/ */
class AdherentType extends CommonObject class AdherentType extends CommonObject
{ {
var $error; public $table_element = 'adherent_type';
var $errors=array();
var $db;
var $table_element = 'adherent_type';
var $id; var $id;
var $libelle; var $libelle;

View File

@ -33,12 +33,11 @@ include_once DOL_DOCUMENT_ROOT . "/adherents/class/cotisation.class.php";
*/ */
class AdherentStats extends Stats class AdherentStats extends Stats
{ {
var $db; public $table_element;
var $socid; var $socid;
var $userid; var $userid;
var $table_element;
var $from; var $from;
var $field; var $field;
var $where; var $where;

View File

@ -31,13 +31,10 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php");
*/ */
class Cotisation extends CommonObject class Cotisation extends CommonObject
{ {
var $id; public $element='subscription';
var $db; public $table_element='cotisation';
var $error;
var $errors;
var $element='subscription';
var $table_element='cotisation';
var $id;
var $datec; var $datec;
var $datem; var $datem;
var $dateh; // Subscription start date var $dateh; // Subscription start date

View File

@ -36,11 +36,8 @@ require_once(DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.class.php");
*/ */
class Categorie class Categorie
{ {
var $error; public $element='category';
var $db; public $table_element='category';
var $element='category';
var $table_element='category';
var $id; var $id;
var $id_mere; var $id_mere;
@ -550,7 +547,7 @@ class Categorie
/** /**
* Retourne les filles de la categorie * Retourne les filles de la categorie
* *
* @return void * @return void
*/ */
function get_filles() function get_filles()
@ -936,7 +933,7 @@ class Categorie
/** /**
* Retourne les chemin de la categorie, avec les noms des categories * Retourne les chemin de la categorie, avec les noms des categories
* separes par $sep (" >> " par defaut) * separes par $sep (" >> " par defaut)
* *
* @param string $sep Separator * @param string $sep Separator
* @param string $url Url * @param string $url Url
* @return void * @return void
@ -1053,7 +1050,7 @@ class Categorie
/** /**
* Retourne dans un tableau tous les chemins possibles pour arriver a la categorie * Retourne dans un tableau tous les chemins possibles pour arriver a la categorie
* en partant des categories principales, representes par des tableaux de categories * en partant des categories principales, representes par des tableaux de categories
* *
* @return void * @return void
*/ */
function get_all_ways () function get_all_ways ()
@ -1344,9 +1341,10 @@ class Categorie
/** /**
* Initialise an example of instance with random values * Initialise an instance with random values.
* Used to build previews or test instances * Used to build previews or test instances.
* * id must be 0 if object instance is a specimen.
*
* @return void * @return void
*/ */
function initAsSpecimen() function initAsSpecimen()

View File

@ -32,12 +32,9 @@ require_once(DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php');
*/ */
class ActionComm extends CommonObject class ActionComm extends CommonObject
{ {
var $db; public $element='action';
var $error; public $table_element = 'actioncomm';
var $errors=array(); protected $ismultientitymanaged = 2; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
var $element='action';
var $table_element = 'actioncomm';
var $ismultientitymanaged = 2; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
var $type_id; var $type_id;
var $type_code; var $type_code;

View File

@ -32,10 +32,8 @@ require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php");
*/ */
class Mailing extends CommonObject class Mailing extends CommonObject
{ {
var $db; public $element='mailing';
var $error; public $table_element='mailing';
var $element='mailing';
var $table_element='mailing';
var $id; var $id;
var $statut; var $statut;

View File

@ -42,13 +42,11 @@ require_once(DOL_DOCUMENT_ROOT ."/contact/class/contact.class.php");
*/ */
class Propal extends CommonObject class Propal extends CommonObject
{ {
var $db; public $element='propal';
var $error; public $table_element='propal';
var $element='propal'; public $table_element_line='propaldet';
var $table_element='propal'; public $fk_element='fk_propal';
var $table_element_line='propaldet'; protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
var $fk_element='fk_propal';
var $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
var $id; var $id;
@ -2128,8 +2126,11 @@ class Propal extends CommonObject
/** /**
* Initialise an example of instance with random values * Initialise an instance with random values.
* Used to build previews or test instances * Used to build previews or test instances.
* id must be 0 if object instance is a specimen.
*
* @return void
*/ */
function initAsSpecimen() function initAsSpecimen()
{ {

View File

@ -33,12 +33,11 @@ include_once DOL_DOCUMENT_ROOT . "/comm/propal/class/propal.class.php";
*/ */
class PropaleStats extends Stats class PropaleStats extends Stats
{ {
var $db; public $table_element;
var $socid; var $socid;
var $userid; var $userid;
var $table_element;
var $from; var $from;
var $field; var $field;
var $where; var $where;

View File

@ -35,16 +35,14 @@ require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php");
*/ */
class Commande extends CommonObject class Commande extends CommonObject
{ {
var $db; public $element='commande';
var $error; public $table_element='commande';
var $element='commande'; public $table_element_line = 'commandedet';
var $table_element='commande'; public $class_element_line = 'OrderLine';
var $table_element_line = 'commandedet'; public $fk_element = 'fk_commande';
var $class_element_line = 'OrderLine'; protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
var $fk_element = 'fk_commande';
var $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
var $id ; var $id;
var $socid; // Id client var $socid; // Id client
var $client; // Objet societe client (a charger par fetch_client) var $client; // Objet societe client (a charger par fetch_client)
@ -2325,7 +2323,7 @@ class Commande extends CommonObject
dol_syslog("CustomerOrder::delete error", LOG_ERR); dol_syslog("CustomerOrder::delete error", LOG_ERR);
$err++; $err++;
} }
// On efface le repertoire de pdf provisoire // On efface le repertoire de pdf provisoire
$comref = dol_sanitizeFileName($this->ref); $comref = dol_sanitizeFileName($this->ref);
if ($conf->commande->dir_output) if ($conf->commande->dir_output)
@ -2598,8 +2596,11 @@ class Commande extends CommonObject
/** /**
* Initialise an example of instance with random values * Initialise an instance with random values.
* Used to build previews or test instances * Used to build previews or test instances.
* id must be 0 if object instance is a specimen.
*
* @return void
*/ */
function initAsSpecimen() function initAsSpecimen()
{ {

View File

@ -33,12 +33,11 @@ include_once DOL_DOCUMENT_ROOT . "/fourn/class/fournisseur.commande.class.php";
*/ */
class CommandeStats extends Stats class CommandeStats extends Stats
{ {
var $db ; public $table_element;
var $socid; var $socid;
var $userid; var $userid;
var $table_element;
var $from; var $from;
var $field; var $field;
var $where; var $where;

View File

@ -34,10 +34,8 @@ require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php");
*/ */
class Account extends CommonObject class Account extends CommonObject
{ {
var $db; public $element='bank_account';
var $error; public $table_element='bank_account';
var $element='bank_account';
var $table_element='bank_account';
var $rowid; var $rowid;
var $ref; var $ref;
@ -987,7 +985,11 @@ class Account extends CommonObject
} }
/** /**
* Initialize properties with test values * Initialise an instance with random values.
* Used to build previews or test instances.
* id must be 0 if object instance is a specimen.
*
* @return void
*/ */
function initAsSpecimen() function initAsSpecimen()
{ {

View File

@ -36,14 +36,10 @@
*/ */
class BankCateg // extends CommonObject class BankCateg // extends CommonObject
{ {
var $db; //!< To store db handler //public $element='bank_categ'; //!< Id that identify managed objects
var $error; //!< To return error code (or message) //public $table_element='bank_categ'; //!< Name of table without prefix where object is stored
var $errors=array(); //!< To return several error codes (or messages)
//var $element='bank_categ'; //!< Id that identify managed objects
//var $table_element='bank_categ'; //!< Name of table without prefix where object is stored
var $id; var $id;
var $label; var $label;
@ -345,16 +341,17 @@ class BankCateg // extends CommonObject
/** /**
* \brief Initialise object with example values * Initialise an instance with random values.
* \remarks id must be 0 if object instance is a specimen. * Used to build previews or test instances.
* id must be 0 if object instance is a specimen.
*
* @return void
*/ */
function initAsSpecimen() function initAsSpecimen()
{ {
$this->id=0; $this->id=0;
$this->label=''; $this->label='';
} }
} }

View File

@ -31,13 +31,11 @@ require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php");
*/ */
class Deplacement extends CommonObject class Deplacement extends CommonObject
{ {
var $db; public $element='deplacement';
var $error; public $table_element='deplacement';
var $element='deplacement'; public $table_element_line = '';
var $table_element='deplacement'; public $fk_element = '';
var $table_element_line = ''; protected $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
var $fk_element = '';
var $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
var $id; var $id;

View File

@ -31,12 +31,11 @@ include_once DOL_DOCUMENT_ROOT . "/compta/deplacement/class/deplacement.class.ph
*/ */
class DeplacementStats extends Stats class DeplacementStats extends Stats
{ {
var $db; public $table_element;
var $socid; var $socid;
var $userid; var $userid;
var $table_element;
var $from; var $from;
var $field; var $field;
var $where; var $where;

View File

@ -32,10 +32,8 @@ require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php");
*/ */
class Don extends CommonObject class Don extends CommonObject
{ {
var $db; public $element='don';
var $error; public $table_element='don';
var $element='don';
var $table_element='don';
var $id; var $id;
var $date; var $date;
@ -142,8 +140,11 @@ class Don extends CommonObject
/** /**
* \brief Initialise le don avec valeurs fictives alaatoire * Initialise an instance with random values.
* Sert a generer un recu de don pour l'aperu des modeles ou demo * Used to build previews or test instances.
* id must be 0 if object instance is a specimen.
*
* @return void
*/ */
function initAsSpecimen() function initAsSpecimen()
{ {

View File

@ -35,13 +35,12 @@ require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
*/ */
class FactureRec extends Facture class FactureRec extends Facture
{ {
var $db ; public $element='facturerec';
var $element='facturerec'; public $table_element='facture_rec';
var $table_element='facture_rec'; public $table_element_line='facturedet_rec';
var $table_element_line='facturedet_rec'; public $fk_element='fk_facture';
var $fk_element='fk_facture';
var $id ; var $id;
//! Id customer //! Id customer
var $socid; var $socid;

View File

@ -40,14 +40,11 @@ require_once(DOL_DOCUMENT_ROOT ."/societe/class/client.class.php");
*/ */
class Facture extends CommonObject class Facture extends CommonObject
{ {
var $db; public $element='facture';
var $error; public $table_element='facture';
var $errors=array(); public $table_element_line = 'facturedet';
var $element='facture'; public $fk_element = 'fk_facture';
var $table_element='facture'; protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
var $table_element_line = 'facturedet';
var $fk_element = 'fk_facture';
var $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
var $id; var $id;
//! Id client //! Id client
@ -3062,8 +3059,11 @@ class Facture extends CommonObject
/** /**
* Initialise an example of invoice with random values * Initialise an instance with random values.
* Used to build previews or test instances * Used to build previews or test instances.
* id must be 0 if object instance is a specimen.
*
* @return void
*/ */
function initAsSpecimen() function initAsSpecimen()
{ {

View File

@ -33,12 +33,10 @@ include_once DOL_DOCUMENT_ROOT . "/lib/date.lib.php";
*/ */
class FactureStats extends Stats class FactureStats extends Stats
{ {
var $db;
var $socid; var $socid;
var $userid; var $userid;
var $table_element; public $table_element;
var $from; var $from;
var $field; var $field;
var $where; var $where;

View File

@ -33,8 +33,8 @@ class PaymentTerm // extends CommonObject
var $db; //!< To store db handler var $db; //!< To store db handler
var $error; //!< To return error code (or message) var $error; //!< To return error code (or message)
var $errors=array(); //!< To return several error codes (or messages) var $errors=array(); //!< To return several error codes (or messages)
//var $element='c_payment_term'; //!< Id that identify managed objects //public $element='c_payment_term'; //!< Id that identify managed objects
//var $table_element='c_payment_term'; //!< Name of table without prefix where object is stored //public $table_element='c_payment_term'; //!< Name of table without prefix where object is stored
var $id; var $id;
@ -455,10 +455,11 @@ class PaymentTerm // extends CommonObject
/** /**
* Initialise object with example values * Initialise an instance with random values.
* id must be 0 if object instance is a specimen * Used to build previews or test instances.
* * id must be 0 if object instance is a specimen.
* @return void *
* @return void
*/ */
function initAsSpecimen() function initAsSpecimen()
{ {

View File

@ -32,10 +32,8 @@ require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php");
*/ */
class RemiseCheque extends CommonObject class RemiseCheque extends CommonObject
{ {
var $db; public $element='chequereceipt';
var $error; public $table_element='bordereau_cheque';
var $element='chequereceipt';
var $table_element='bordereau_cheque';
var $id; var $id;
var $num; var $num;

View File

@ -30,10 +30,8 @@ require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php");
*/ */
class Paiement extends CommonObject class Paiement extends CommonObject
{ {
var $db; public $element='payment';
var $error; public $table_element='paiement';
var $element='payment';
var $table_element='paiement';
var $id; var $id;
var $ref; var $ref;

View File

@ -31,11 +31,9 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php");
*/ */
class ChargeSociales extends CommonObject class ChargeSociales extends CommonObject
{ {
var $db; public $element='rowid';
var $error; public $table='chargesociales';
var $element='rowid'; public $table_element='chargesociales';
var $table='chargesociales';
var $table_element='chargesociales';
var $id; var $id;
var $date_ech; var $date_ech;
@ -397,8 +395,11 @@ class ChargeSociales extends CommonObject
} }
/** /**
* Initialise an example of social contribution with random values * Initialise an instance with random values.
* Used to build previews or test instances * Used to build previews or test instances.
* id must be 0 if object instance is a specimen.
*
* @return void
*/ */
function initAsSpecimen() function initAsSpecimen()
{ {

View File

@ -30,11 +30,8 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php");
*/ */
class PaymentSocialContribution extends CommonObject class PaymentSocialContribution extends CommonObject
{ {
var $db; //!< To store db handler public $element='paiementcharge'; //!< Id that identify managed objects
var $error; //!< To return error code (or message) public $table_element='paiementcharge'; //!< Name of table without prefix where object is stored
var $errors=array(); //!< To return several error codes (or messages)
var $element='paiementcharge'; //!< Id that identify managed objects
var $table_element='paiementcharge'; //!< Name of table without prefix where object is stored
var $id; var $id;
var $ref; var $ref;
@ -428,8 +425,11 @@ class PaymentSocialContribution extends CommonObject
/** /**
* \brief Initialise object with example values * Initialise an instance with random values.
* \remarks id must be 0 if object instance is a specimen. * Used to build previews or test instances.
* id must be 0 if object instance is a specimen.
*
* @return void
*/ */
function initAsSpecimen() function initAsSpecimen()
{ {

View File

@ -33,11 +33,8 @@ require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php");
*/ */
class Tva extends CommonObject class Tva extends CommonObject
{ {
var $db; //!< To store db handler //public $element='tva'; //!< Id that identify managed objects
var $error; //!< To return error code (or message) //public $table_element='tva'; //!< Name of table without prefix where object is stored
var $errors=array(); //!< To return several error codes (or messages)
//var $element='tva'; //!< Id that identify managed objects
//var $table_element='tva'; //!< Name of table without prefix where object is stored
var $id; var $id;
var $ref; var $ref;
@ -302,8 +299,11 @@ class Tva extends CommonObject
/** /**
* \brief Initialise object with example values * Initialise an instance with random values.
* \remarks id must be 0 if object instance is a specimen. * Used to build previews or test instances.
* id must be 0 if object instance is a specimen.
*
* @return void
*/ */
function initAsSpecimen() function initAsSpecimen()
{ {
@ -318,8 +318,6 @@ class Tva extends CommonObject
$this->fk_bank=''; $this->fk_bank='';
$this->fk_user_creat=''; $this->fk_user_creat='';
$this->fk_user_modif=''; $this->fk_user_modif='';
} }

View File

@ -34,10 +34,8 @@ require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php");
*/ */
class Contact extends CommonObject class Contact extends CommonObject
{ {
var $db; public $element='contact';
var $error; public $table_element='socpeople';
var $element='contact';
var $table_element='socpeople';
var $id; var $id;
var $civilite_id; // In fact we stor civility_code var $civilite_id; // In fact we stor civility_code
@ -999,9 +997,11 @@ class Contact extends CommonObject
/** /**
* Initialise le contact avec valeurs fictives aleatoire * Initialise an instance with random values.
* * Used to build previews or test instances.
* @return void * id must be 0 if object instance is a specimen.
*
* @return void
*/ */
function initAsSpecimen() function initAsSpecimen()
{ {

View File

@ -37,12 +37,10 @@ require_once(DOL_DOCUMENT_ROOT."/lib/price.lib.php");
*/ */
class Contrat extends CommonObject class Contrat extends CommonObject
{ {
var $db; public $element='contrat';
var $error; public $table_element='contrat';
var $element='contrat'; public $table_element_line='contratdet';
var $table_element='contrat'; public $fk_element='fk_contrat';
var $table_element_line='contratdet';
var $fk_element='fk_contrat';
var $id; var $id;
var $ref; var $ref;
@ -1424,7 +1422,11 @@ class Contrat extends CommonObject
/** /**
* \brief Initialise le membre avec valeurs fictives aleatoire * Initialise an instance with random values.
* Used to build previews or test instances.
* id must be 0 if object instance is a specimen.
*
* @return void
*/ */
function initAsSpecimen() function initAsSpecimen()
{ {

View File

@ -462,10 +462,11 @@ class DiscountAbsolute
/** /**
* Initializes the intervention with random values * Initialise an instance with random values.
* Used to generate a intervention for the preview or demo models * Used to build previews or test instances.
* * id must be 0 if object instance is a specimen.
* @return void *
* @return void
*/ */
function initAsSpecimen() function initAsSpecimen()
{ {

View File

@ -36,11 +36,8 @@
*/ */
class Events // extends CommonObject class Events // extends CommonObject
{ {
var $db; //!< To store db handler public $element='events'; //!< Id that identify managed objects
var $error; //!< To return error code (or message) public $table_element='events'; //!< Name of table without prefix where object is stored
var $errors=array(); //!< To return several error codes (or messages)
var $element='events'; //!< Id that identify managed objects
var $table_element='events'; //!< Name of table without prefix where object is stored
var $id; var $id;
@ -265,8 +262,11 @@ class Events // extends CommonObject
/** /**
* \brief Initialise object with example values * Initialise an instance with random values.
* \remarks id must be 0 if object instance is a specimen. * Used to build previews or test instances.
* id must be 0 if object instance is a specimen.
*
* @return void
*/ */
function initAsSpecimen() function initAsSpecimen()
{ {

View File

@ -328,8 +328,11 @@ class Menubase
/** /**
* Initialise object with example values * Initialise an instance with random values.
* Id must be 0 if object instance is a specimen. * Used to build previews or test instances.
* id must be 0 if object instance is a specimen.
*
* @return void
*/ */
function initAsSpecimen() function initAsSpecimen()
{ {

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (c) 2008-2010 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (c) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -28,8 +28,15 @@
*/ */
abstract class Stats abstract class Stats
{ {
var $db ; protected $db;
/**
* Constructor
*
* @param DoliDB $DB Database handler
* @return Stats
*/
function Stats($DB) function Stats($DB)
{ {
$this->db = $DB; $this->db = $DB;
@ -37,6 +44,7 @@ abstract class Stats
/** /**
* Return nb of entity by month for several years * Return nb of entity by month for several years
*
* @param endyear Start year * @param endyear Start year
* @param startyear End year * @param startyear End year
* @return array Array of values * @return array Array of values
@ -110,6 +118,7 @@ abstract class Stats
/** /**
* Return nb of elements by year * Return nb of elements by year
*
* @param sql SQL request * @param sql SQL request
* @return array * @return array
*/ */
@ -139,6 +148,7 @@ abstract class Stats
/** /**
* Return nb of elements, total amount and avg amount by year * Return nb of elements, total amount and avg amount by year
*
* @param sql SQL request * @param sql SQL request
* @return array * @return array
*/ */
@ -171,6 +181,7 @@ abstract class Stats
/** /**
* Renvoie le nombre de proposition par mois pour une annee donnee * Renvoie le nombre de proposition par mois pour une annee donnee
*
* @param year Year * @param year Year
* @param sql SQL * @param sql SQL
*/ */
@ -218,6 +229,7 @@ abstract class Stats
/** /**
* Renvoie le nombre d'element par mois pour une annee donnee * Renvoie le nombre d'element par mois pour une annee donnee
*
* @param year Year * @param year Year
* @param sql SQL * @param sql SQL
*/ */
@ -262,6 +274,7 @@ abstract class Stats
/** /**
* Renvoie le montant moyen par mois pour une annee donnee * Renvoie le montant moyen par mois pour une annee donnee
*
* @param year Year * @param year Year
* @param sql SQL * @param sql SQL
*/ */

View File

@ -30,11 +30,8 @@
*/ */
class EcmDirectory // extends CommonObject class EcmDirectory // extends CommonObject
{ {
var $db; //!< To store db handler //public $element='ecm_directories'; //!< Id that identify managed objects
var $error; //!< To return error code (or message) //public $table_element='ecm_directories'; //!< Name of table without prefix where object is stored
var $errors=array(); //!< To return several error codes (or messages)
//var $element='ecm_directories'; //!< Id that identify managed objects
//var $table_element='ecm_directories'; //!< Name of table without prefix where object is stored
var $id; var $id;
@ -377,8 +374,11 @@ class EcmDirectory // extends CommonObject
/** /**
* \brief Initialise object with example values * Initialise an instance with random values.
* \remarks id must be 0 if object instance is a specimen. * Used to build previews or test instances.
* id must be 0 if object instance is a specimen.
*
* @return void
*/ */
function initAsSpecimen() function initAsSpecimen()
{ {

View File

@ -36,11 +36,9 @@ if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT."/commande/class/co
*/ */
class Expedition extends CommonObject class Expedition extends CommonObject
{ {
var $db; public $element="shipping";
var $error; public $fk_element="fk_expedition";
var $element="shipping"; public $table_element="expedition";
var $fk_element="fk_expedition";
var $table_element="expedition";
var $id; var $id;
var $socid; var $socid;
@ -973,8 +971,11 @@ class Expedition extends CommonObject
} }
/** /**
* \brief Initialise la facture avec valeurs fictives aleatoire * Initialise an instance with random values.
* Sert a generer une facture pour l'aperu des modeles ou dem * Used to build previews or test instances.
* id must be 0 if object instance is a specimen.
*
* @return void
*/ */
function initAsSpecimen() function initAsSpecimen()
{ {

View File

@ -32,11 +32,10 @@ require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php");
*/ */
class Fichinter extends CommonObject class Fichinter extends CommonObject
{ {
var $db; public $element='fichinter';
var $element='fichinter'; public $table_element='fichinter';
var $table_element='fichinter'; public $fk_element='fk_fichinter';
var $fk_element='fk_fichinter'; public $table_element_line='fichinterdet';
var $table_element_line='fichinterdet';
var $id; var $id;
@ -751,8 +750,11 @@ class Fichinter extends CommonObject
/** /**
* Initializes the intervention with random values * Initialise an instance with random values.
* Used to generate a intervention for the preview or demo models * Used to build previews or test instances.
* id must be 0 if object instance is a specimen.
*
* @return void
*/ */
function initAsSpecimen() function initAsSpecimen()
{ {

View File

@ -36,15 +36,11 @@ require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php");
*/ */
class CommandeFournisseur extends Commande class CommandeFournisseur extends Commande
{ {
var $id ; public $element='order_supplier';
var $db ; public $table_element='commande_fournisseur';
var $error; public $table_element_line = 'commande_fournisseurdet';
public $fk_element = 'fk_commande';
var $element='order_supplier'; protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
var $table_element='commande_fournisseur';
var $table_element_line = 'commande_fournisseurdet';
var $fk_element = 'fk_commande';
var $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
var $ref; // TODO deprecated var $ref; // TODO deprecated
var $product_ref; var $product_ref;
@ -1666,8 +1662,11 @@ class CommandeFournisseur extends Commande
/** /**
* Initialise an example of instance with random values * Initialise an instance with random values.
* Used to build previews or test instances * Used to build previews or test instances.
* id must be 0 if object instance is a specimen.
*
* @return void
*/ */
function initAsSpecimen() function initAsSpecimen()
{ {

View File

@ -35,15 +35,11 @@ include_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
*/ */
class FactureFournisseur extends Facture class FactureFournisseur extends Facture
{ {
var $id; public $element='invoice_supplier';
var $db; public $table_element='facture_fourn';
var $error; public $table_element_line='facture_fourn_det';
public $fk_element='fk_facture_fourn';
var $element='invoice_supplier'; protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
var $table_element='facture_fourn';
var $table_element_line='facture_fourn_det';
var $fk_element='fk_facture_fourn';
var $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
var $ref; // TODO deprecated var $ref; // TODO deprecated
var $product_ref; var $product_ref;
@ -1201,8 +1197,11 @@ class FactureFournisseur extends Facture
/** /**
* Initialise an example of instance with random values * Initialise an instance with random values.
* Used to build previews or test instances * Used to build previews or test instances.
* id must be 0 if object instance is a specimen.
*
* @return void
*/ */
function initAsSpecimen() function initAsSpecimen()
{ {

View File

@ -32,10 +32,8 @@ require_once(DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php');
*/ */
class PaiementFourn extends Paiement class PaiementFourn extends Paiement
{ {
var $db; public $element='payment_supplier';
var $error; public $table_element='paiementfourn';
var $element='payment_supplier';
var $table_element='paiementfourn';
var $id; var $id;
var $ref; var $ref;
@ -188,7 +186,7 @@ class PaiementFourn extends Paiement
dol_syslog('Paiement::Create Erreur INSERT dans paiement_facture '.$facid); dol_syslog('Paiement::Create Erreur INSERT dans paiement_facture '.$facid);
$error++; $error++;
} }
} }
else else
{ {

View File

@ -37,11 +37,9 @@ if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT."/commande/class/co
*/ */
class Livraison extends CommonObject class Livraison extends CommonObject
{ {
var $db; public $element="delivery";
var $error; public $fk_element="fk_livraison";
var $element="delivery"; public $table_element="livraison";
var $fk_element="fk_livraison";
var $table_element="livraison";
var $id; var $id;
var $brouillon; var $brouillon;
@ -713,7 +711,11 @@ class Livraison extends CommonObject
/** /**
* \brief Initialise object with default value to be used as example * Initialise an instance with random values.
* Used to build previews or test instances.
* id must be 0 if object instance is a specimen.
*
* @return void
*/ */
function initAsSpecimen() function initAsSpecimen()
{ {

View File

@ -34,16 +34,12 @@ require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php");
*/ */
class Product extends CommonObject class Product extends CommonObject
{ {
var $db; public $element='product';
var $error; public $table_element='product';
var $errno = 0; public $fk_element='fk_product';
public $childtables=array('propaldet','commandedet','facturedet','contratdet','product_fournisseur');
var $element='product'; protected $isnolinkedbythird = 1; // No field fk_soc
var $table_element='product'; protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
var $fk_element='fk_product';
var $childtables=array('propaldet','commandedet','facturedet','contratdet','product_fournisseur');
var $isnolinkedbythird = 1; // No field fk_soc
var $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
//! Identifiant unique //! Identifiant unique
var $id ; var $id ;

View File

@ -33,10 +33,8 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php");
class Entrepot extends CommonObject class Entrepot extends CommonObject
{ {
var $db; public $element='label';
var $error; public $table_element='entrepot';
var $element='label';
var $table_element='entrepot';
var $id; var $id;
var $libelle; var $libelle;

View File

@ -30,11 +30,8 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php");
*/ */
class Project extends CommonObject class Project extends CommonObject
{ {
var $db; //!< To store db handler public $element='project'; //!< Id that identify managed objects
var $error; //!< To return error code (or message) public $table_element='projet'; //!< Name of table without prefix where object is stored
var $errors=array(); //!< To return several error codes (or messages)
var $element='project'; //!< Id that identify managed objects
var $table_element='projet'; //!< Name of table without prefix where object is stored
var $id; var $id;
var $ref; var $ref;
@ -666,9 +663,11 @@ class Project extends CommonObject
} }
/** /**
* Initialise object with default value to be used as example * Initialise an instance with random values.
* * Used to build previews or test instances.
* @return void * id must be 0 if object instance is a specimen.
*
* @return void
*/ */
function initAsSpecimen() function initAsSpecimen()
{ {

View File

@ -32,11 +32,8 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php");
*/ */
class Task extends CommonObject class Task extends CommonObject
{ {
var $db; //!< To store db handler public $element='project_task'; //!< Id that identify managed objects
var $error; //!< To return error code (or message) public $table_element='projet_task'; //!< Name of table without prefix where object is stored
var $errors=array(); //!< To return several error codes (or messages)
var $element='project_task'; //!< Id that identify managed objects
var $table_element='projet_task'; //!< Name of table without prefix where object is stored
var $id; var $id;
@ -437,10 +434,11 @@ class Task extends CommonObject
} }
/** /**
* Initialise object with example values * Initialise an instance with random values.
* Used to build previews or test instances.
* id must be 0 if object instance is a specimen. * id must be 0 if object instance is a specimen.
* *
* @return void * @return void
*/ */
function initAsSpecimen() function initAsSpecimen()
{ {

View File

@ -1341,7 +1341,7 @@ class Societe extends CommonObject
if ($this->id) if ($this->id)
{ {
$now=dol_now(); $now=dol_now();
$sql = "UPDATE ".MAIN_DB_PREFIX."societe "; $sql = "UPDATE ".MAIN_DB_PREFIX."societe ";
$sql .= " SET price_level = '".$price_level."'"; $sql .= " SET price_level = '".$price_level."'";
$sql .= " WHERE rowid = " . $this->id; $sql .= " WHERE rowid = " . $this->id;
@ -2481,8 +2481,11 @@ class Societe extends CommonObject
/** /**
* Initialise an example of company with random values * Initialise an instance with random values.
* Used to build previews or test instances * Used to build previews or test instances.
* id must be 0 if object instance is a specimen.
*
* @return void
*/ */
function initAsSpecimen() function initAsSpecimen()
{ {

View File

@ -36,12 +36,9 @@ require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php");
*/ */
class User extends CommonObject class User extends CommonObject
{ {
var $db; public $element='user';
var $error; public $table_element='user';
var $errors=array(); protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
var $element='user';
var $table_element='user';
var $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
var $id=0; var $id=0;
var $ldap_sid; var $ldap_sid;
@ -1231,7 +1228,7 @@ class User extends CommonObject
{ {
global $conf, $langs; global $conf, $langs;
require_once(DOL_DOCUMENT_ROOT ."/lib/security.lib.php"); require_once(DOL_DOCUMENT_ROOT ."/lib/security.lib.php");
$error=0; $error=0;
dol_syslog("User::setPassword user=".$user->id." password=".preg_replace('/./i','*',$password)." changelater=".$changelater." notrigger=".$notrigger." nosyncmember=".$nosyncmember, LOG_DEBUG); dol_syslog("User::setPassword user=".$user->id." password=".preg_replace('/./i','*',$password)." changelater=".$changelater." notrigger=".$notrigger." nosyncmember=".$nosyncmember, LOG_DEBUG);
@ -1871,7 +1868,11 @@ class User extends CommonObject
/** /**
* Initialize user with default values * Initialise an instance with random values.
* Used to build previews or test instances.
* id must be 0 if object instance is a specimen.
*
* @return void
*/ */
function initAsSpecimen() function initAsSpecimen()
{ {

View File

@ -33,12 +33,9 @@ if ($conf->ldap->enabled) require_once (DOL_DOCUMENT_ROOT."/lib/ldap.class.php")
*/ */
class UserGroup extends CommonObject class UserGroup extends CommonObject
{ {
var $db; // Database handler public $element='usergroup';
var $error; public $table_element='usergroup';
var $errors=array(); protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
var $element='usergroup';
var $table_element='usergroup';
var $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
var $id; // Group id var $id; // Group id
var $entity; // Entity of group var $entity; // Entity of group
@ -679,9 +676,11 @@ class UserGroup extends CommonObject
/** /**
* Initialise le groupe avec valeurs fictives aleatoire * Initialise an instance with random values.
* * Used to build previews or test instances.
* @return void * id must be 0 if object instance is a specimen.
*
* @return void
*/ */
function initAsSpecimen() function initAsSpecimen()
{ {