diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 44a4e37922a..2ac33a71796 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -38,12 +38,9 @@ require_once(DOL_DOCUMENT_ROOT."/lib/date.lib.php"); */ class Adherent extends CommonObject { - var $db; - var $error; - var $errors=array(); - 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 + public $element='member'; + public $table_element='adherent'; + protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe var $id; 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() { diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index de78dcb5b3c..aa08f2cbbe3 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -33,10 +33,7 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"); */ class AdherentType extends CommonObject { - var $error; - var $errors=array(); - var $db; - var $table_element = 'adherent_type'; + public $table_element = 'adherent_type'; var $id; var $libelle; diff --git a/htdocs/adherents/class/adherentstats.class.php b/htdocs/adherents/class/adherentstats.class.php index 5ea122c80d3..24f2450dd19 100755 --- a/htdocs/adherents/class/adherentstats.class.php +++ b/htdocs/adherents/class/adherentstats.class.php @@ -33,12 +33,11 @@ include_once DOL_DOCUMENT_ROOT . "/adherents/class/cotisation.class.php"; */ class AdherentStats extends Stats { - var $db; + public $table_element; var $socid; var $userid; - var $table_element; var $from; var $field; var $where; diff --git a/htdocs/adherents/class/cotisation.class.php b/htdocs/adherents/class/cotisation.class.php index 75c7749e465..0ac1523f6d5 100644 --- a/htdocs/adherents/class/cotisation.class.php +++ b/htdocs/adherents/class/cotisation.class.php @@ -31,13 +31,10 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"); */ class Cotisation extends CommonObject { - var $id; - var $db; - var $error; - var $errors; - var $element='subscription'; - var $table_element='cotisation'; + public $element='subscription'; + public $table_element='cotisation'; + var $id; var $datec; var $datem; var $dateh; // Subscription start date diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 6613ada6ae8..e1e68db7a58 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -36,11 +36,8 @@ require_once(DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.class.php"); */ class Categorie { - var $error; - var $db; - - var $element='category'; - var $table_element='category'; + public $element='category'; + public $table_element='category'; var $id; var $id_mere; @@ -550,7 +547,7 @@ class Categorie /** * Retourne les filles de la categorie - * + * * @return void */ function get_filles() @@ -936,7 +933,7 @@ class Categorie /** * Retourne les chemin de la categorie, avec les noms des categories * separes par $sep (" >> " par defaut) - * + * * @param string $sep Separator * @param string $url Url * @return void @@ -1053,7 +1050,7 @@ class 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 - * + * * @return void */ function get_all_ways () @@ -1344,9 +1341,10 @@ class Categorie /** - * Initialise an example of instance with random values - * Used to build previews or test instances - * + * 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() diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 93f40c13a77..8b5658fcf93 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -32,12 +32,9 @@ require_once(DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'); */ class ActionComm extends CommonObject { - var $db; - var $error; - var $errors=array(); - 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 + public $element='action'; + public $table_element = 'actioncomm'; + protected $ismultientitymanaged = 2; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe var $type_id; var $type_code; diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index 5b27032918e..60fe869aa97 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -32,10 +32,8 @@ require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php"); */ class Mailing extends CommonObject { - var $db; - var $error; - var $element='mailing'; - var $table_element='mailing'; + public $element='mailing'; + public $table_element='mailing'; var $id; var $statut; diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 84b0d47377a..6adbc8f94d1 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -42,13 +42,11 @@ require_once(DOL_DOCUMENT_ROOT ."/contact/class/contact.class.php"); */ class Propal extends CommonObject { - var $db; - var $error; - var $element='propal'; - var $table_element='propal'; - var $table_element_line='propaldet'; - var $fk_element='fk_propal'; - var $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + public $element='propal'; + public $table_element='propal'; + public $table_element_line='propaldet'; + public $fk_element='fk_propal'; + protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe var $id; @@ -2128,8 +2126,11 @@ class Propal extends CommonObject /** - * Initialise an example of instance with random values - * Used to build previews or test instances + * 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() { diff --git a/htdocs/comm/propal/class/propalestats.class.php b/htdocs/comm/propal/class/propalestats.class.php index 018dff2c73c..b817c000646 100644 --- a/htdocs/comm/propal/class/propalestats.class.php +++ b/htdocs/comm/propal/class/propalestats.class.php @@ -33,12 +33,11 @@ include_once DOL_DOCUMENT_ROOT . "/comm/propal/class/propal.class.php"; */ class PropaleStats extends Stats { - var $db; + public $table_element; var $socid; var $userid; - var $table_element; var $from; var $field; var $where; diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 09ae19b4991..409df18639f 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -35,16 +35,14 @@ require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php"); */ class Commande extends CommonObject { - var $db; - var $error; - var $element='commande'; - var $table_element='commande'; - var $table_element_line = 'commandedet'; - var $class_element_line = 'OrderLine'; - var $fk_element = 'fk_commande'; - var $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + public $element='commande'; + public $table_element='commande'; + public $table_element_line = 'commandedet'; + public $class_element_line = 'OrderLine'; + public $fk_element = 'fk_commande'; + protected $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 $client; // Objet societe client (a charger par fetch_client) @@ -2325,7 +2323,7 @@ class Commande extends CommonObject dol_syslog("CustomerOrder::delete error", LOG_ERR); $err++; } - + // On efface le repertoire de pdf provisoire $comref = dol_sanitizeFileName($this->ref); if ($conf->commande->dir_output) @@ -2598,8 +2596,11 @@ class Commande extends CommonObject /** - * Initialise an example of instance with random values - * Used to build previews or test instances + * 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() { diff --git a/htdocs/commande/class/commandestats.class.php b/htdocs/commande/class/commandestats.class.php index e30a2c645a8..294e3d52260 100644 --- a/htdocs/commande/class/commandestats.class.php +++ b/htdocs/commande/class/commandestats.class.php @@ -33,12 +33,11 @@ include_once DOL_DOCUMENT_ROOT . "/fourn/class/fournisseur.commande.class.php"; */ class CommandeStats extends Stats { - var $db ; + public $table_element; var $socid; var $userid; - var $table_element; var $from; var $field; var $where; diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index d5d14e9e816..40362bb5f70 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -34,10 +34,8 @@ require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php"); */ class Account extends CommonObject { - var $db; - var $error; - var $element='bank_account'; - var $table_element='bank_account'; + public $element='bank_account'; + public $table_element='bank_account'; var $rowid; 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() { diff --git a/htdocs/compta/bank/class/bankcateg.class.php b/htdocs/compta/bank/class/bankcateg.class.php index 32b341c3276..061d7055637 100644 --- a/htdocs/compta/bank/class/bankcateg.class.php +++ b/htdocs/compta/bank/class/bankcateg.class.php @@ -36,14 +36,10 @@ */ class BankCateg // extends CommonObject { - var $db; //!< To store db handler - var $error; //!< To return error code (or message) - 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 + //public $element='bank_categ'; //!< Id that identify managed objects + //public $table_element='bank_categ'; //!< Name of table without prefix where object is stored var $id; - var $label; @@ -345,16 +341,17 @@ class BankCateg // extends CommonObject /** - * \brief Initialise object with example values - * \remarks id must be 0 if object instance is a specimen. + * 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() { $this->id=0; $this->label=''; - - } } diff --git a/htdocs/compta/deplacement/class/deplacement.class.php b/htdocs/compta/deplacement/class/deplacement.class.php index e2cbc28f14e..f7182869870 100644 --- a/htdocs/compta/deplacement/class/deplacement.class.php +++ b/htdocs/compta/deplacement/class/deplacement.class.php @@ -31,13 +31,11 @@ require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php"); */ class Deplacement extends CommonObject { - var $db; - var $error; - var $element='deplacement'; - var $table_element='deplacement'; - var $table_element_line = ''; - var $fk_element = ''; - var $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + public $element='deplacement'; + public $table_element='deplacement'; + public $table_element_line = ''; + public $fk_element = ''; + protected $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe var $id; diff --git a/htdocs/compta/deplacement/class/deplacementstats.class.php b/htdocs/compta/deplacement/class/deplacementstats.class.php index 3e212918849..f6569ca10ae 100644 --- a/htdocs/compta/deplacement/class/deplacementstats.class.php +++ b/htdocs/compta/deplacement/class/deplacementstats.class.php @@ -31,12 +31,11 @@ include_once DOL_DOCUMENT_ROOT . "/compta/deplacement/class/deplacement.class.ph */ class DeplacementStats extends Stats { - var $db; + public $table_element; var $socid; var $userid; - var $table_element; var $from; var $field; var $where; diff --git a/htdocs/compta/dons/class/don.class.php b/htdocs/compta/dons/class/don.class.php index a714a650585..71ead3c64d1 100644 --- a/htdocs/compta/dons/class/don.class.php +++ b/htdocs/compta/dons/class/don.class.php @@ -32,10 +32,8 @@ require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php"); */ class Don extends CommonObject { - var $db; - var $error; - var $element='don'; - var $table_element='don'; + public $element='don'; + public $table_element='don'; var $id; var $date; @@ -142,8 +140,11 @@ class Don extends CommonObject /** - * \brief Initialise le don avec valeurs fictives alaatoire - * Sert a generer un recu de don pour l'aperu des modeles ou demo + * 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() { diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 3535470dd90..f9baebbe540 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -35,13 +35,12 @@ require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"); */ class FactureRec extends Facture { - var $db ; - var $element='facturerec'; - var $table_element='facture_rec'; - var $table_element_line='facturedet_rec'; - var $fk_element='fk_facture'; + public $element='facturerec'; + public $table_element='facture_rec'; + public $table_element_line='facturedet_rec'; + public $fk_element='fk_facture'; - var $id ; + var $id; //! Id customer var $socid; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 02874e46bdf..c65623d2cfe 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -40,14 +40,11 @@ require_once(DOL_DOCUMENT_ROOT ."/societe/class/client.class.php"); */ class Facture extends CommonObject { - var $db; - var $error; - var $errors=array(); - var $element='facture'; - var $table_element='facture'; - 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 + public $element='facture'; + public $table_element='facture'; + public $table_element_line = 'facturedet'; + public $fk_element = 'fk_facture'; + protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe var $id; //! Id client @@ -3062,8 +3059,11 @@ class Facture extends CommonObject /** - * Initialise an example of invoice with random values - * Used to build previews or test instances + * 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() { diff --git a/htdocs/compta/facture/class/facturestats.class.php b/htdocs/compta/facture/class/facturestats.class.php index 136121faabd..c4fc13c00a5 100644 --- a/htdocs/compta/facture/class/facturestats.class.php +++ b/htdocs/compta/facture/class/facturestats.class.php @@ -33,12 +33,10 @@ include_once DOL_DOCUMENT_ROOT . "/lib/date.lib.php"; */ class FactureStats extends Stats { - var $db; - var $socid; var $userid; - var $table_element; + public $table_element; var $from; var $field; var $where; diff --git a/htdocs/compta/facture/class/paymentterm.class.php b/htdocs/compta/facture/class/paymentterm.class.php index e8425698343..a2e74b9d1f1 100644 --- a/htdocs/compta/facture/class/paymentterm.class.php +++ b/htdocs/compta/facture/class/paymentterm.class.php @@ -33,8 +33,8 @@ class PaymentTerm // extends CommonObject var $db; //!< To store db handler var $error; //!< To return error code (or message) var $errors=array(); //!< To return several error codes (or messages) - //var $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 $element='c_payment_term'; //!< Id that identify managed objects + //public $table_element='c_payment_term'; //!< Name of table without prefix where object is stored var $id; @@ -455,10 +455,11 @@ class PaymentTerm // extends CommonObject /** - * Initialise object with example values - * id must be 0 if object instance is a specimen - * - * @return void + * 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() { diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php index 37151fa5302..e7890ec980a 100644 --- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php @@ -32,10 +32,8 @@ require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php"); */ class RemiseCheque extends CommonObject { - var $db; - var $error; - var $element='chequereceipt'; - var $table_element='bordereau_cheque'; + public $element='chequereceipt'; + public $table_element='bordereau_cheque'; var $id; var $num; diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 5f300710892..3c673da95d0 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -30,10 +30,8 @@ require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php"); */ class Paiement extends CommonObject { - var $db; - var $error; - var $element='payment'; - var $table_element='paiement'; + public $element='payment'; + public $table_element='paiement'; var $id; var $ref; diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index d6590108419..fc6f468637a 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -31,11 +31,9 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"); */ class ChargeSociales extends CommonObject { - var $db; - var $error; - var $element='rowid'; - var $table='chargesociales'; - var $table_element='chargesociales'; + public $element='rowid'; + public $table='chargesociales'; + public $table_element='chargesociales'; var $id; var $date_ech; @@ -397,8 +395,11 @@ class ChargeSociales extends CommonObject } /** - * Initialise an example of social contribution with random values - * Used to build previews or test instances + * 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() { diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index a344f8fb774..9e8c08c8e03 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -30,11 +30,8 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"); */ class PaymentSocialContribution extends CommonObject { - var $db; //!< To store db handler - var $error; //!< To return error code (or message) - 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 + public $element='paiementcharge'; //!< Id that identify managed objects + public $table_element='paiementcharge'; //!< Name of table without prefix where object is stored var $id; var $ref; @@ -428,8 +425,11 @@ class PaymentSocialContribution extends CommonObject /** - * \brief Initialise object with example values - * \remarks id must be 0 if object instance is a specimen. + * 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() { diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index a7915ae9d8a..13bd7a5d0f4 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -33,11 +33,8 @@ require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php"); */ class Tva extends CommonObject { - var $db; //!< To store db handler - var $error; //!< To return error code (or message) - 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 + //public $element='tva'; //!< Id that identify managed objects + //public $table_element='tva'; //!< Name of table without prefix where object is stored var $id; var $ref; @@ -302,8 +299,11 @@ class Tva extends CommonObject /** - * \brief Initialise object with example values - * \remarks id must be 0 if object instance is a specimen. + * 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() { @@ -318,8 +318,6 @@ class Tva extends CommonObject $this->fk_bank=''; $this->fk_user_creat=''; $this->fk_user_modif=''; - - } diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 112fdf22833..18e021b15be 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -34,10 +34,8 @@ require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php"); */ class Contact extends CommonObject { - var $db; - var $error; - var $element='contact'; - var $table_element='socpeople'; + public $element='contact'; + public $table_element='socpeople'; var $id; var $civilite_id; // In fact we stor civility_code @@ -999,9 +997,11 @@ class Contact extends CommonObject /** - * Initialise le contact avec valeurs fictives aleatoire - * - * @return void + * 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() { diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 4680d47cd51..cefaf94c63e 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -37,12 +37,10 @@ require_once(DOL_DOCUMENT_ROOT."/lib/price.lib.php"); */ class Contrat extends CommonObject { - var $db; - var $error; - var $element='contrat'; - var $table_element='contrat'; - var $table_element_line='contratdet'; - var $fk_element='fk_contrat'; + public $element='contrat'; + public $table_element='contrat'; + public $table_element_line='contratdet'; + public $fk_element='fk_contrat'; var $id; 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() { diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index aa01c56bce8..093a227ced0 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -462,10 +462,11 @@ class DiscountAbsolute /** - * Initializes the intervention with random values - * Used to generate a intervention for the preview or demo models - * - * @return void + * 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() { diff --git a/htdocs/core/class/events.class.php b/htdocs/core/class/events.class.php index 4e1ec677cef..3cebdc74504 100644 --- a/htdocs/core/class/events.class.php +++ b/htdocs/core/class/events.class.php @@ -36,11 +36,8 @@ */ class Events // extends CommonObject { - var $db; //!< To store db handler - var $error; //!< To return error code (or message) - 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 + public $element='events'; //!< Id that identify managed objects + public $table_element='events'; //!< Name of table without prefix where object is stored var $id; @@ -265,8 +262,11 @@ class Events // extends CommonObject /** - * \brief Initialise object with example values - * \remarks id must be 0 if object instance is a specimen. + * 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() { diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index 88698b61a6e..c2855b42514 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -328,8 +328,11 @@ class Menubase /** - * Initialise object with example values - * Id must be 0 if object instance is a specimen. + * 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() { diff --git a/htdocs/core/class/stats.class.php b/htdocs/core/class/stats.class.php index c302b215d66..df1f7404e76 100644 --- a/htdocs/core/class/stats.class.php +++ b/htdocs/core/class/stats.class.php @@ -1,6 +1,6 @@ - * Copyright (c) 2008-2010 Laurent Destailleur + * Copyright (c) 2008-2011 Laurent Destailleur * * 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 @@ -28,8 +28,15 @@ */ abstract class Stats { - var $db ; + protected $db; + + /** + * Constructor + * + * @param DoliDB $DB Database handler + * @return Stats + */ function Stats($DB) { $this->db = $DB; @@ -37,6 +44,7 @@ abstract class Stats /** * Return nb of entity by month for several years + * * @param endyear Start year * @param startyear End year * @return array Array of values @@ -110,6 +118,7 @@ abstract class Stats /** * Return nb of elements by year + * * @param sql SQL request * @return array */ @@ -139,6 +148,7 @@ abstract class Stats /** * Return nb of elements, total amount and avg amount by year + * * @param sql SQL request * @return array */ @@ -171,6 +181,7 @@ abstract class Stats /** * Renvoie le nombre de proposition par mois pour une annee donnee + * * @param year Year * @param sql SQL */ @@ -218,6 +229,7 @@ abstract class Stats /** * Renvoie le nombre d'element par mois pour une annee donnee + * * @param year Year * @param sql SQL */ @@ -262,6 +274,7 @@ abstract class Stats /** * Renvoie le montant moyen par mois pour une annee donnee + * * @param year Year * @param sql SQL */ diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php index 0e2fd4e7259..ac8429d0c0d 100644 --- a/htdocs/ecm/class/ecmdirectory.class.php +++ b/htdocs/ecm/class/ecmdirectory.class.php @@ -30,11 +30,8 @@ */ class EcmDirectory // extends CommonObject { - var $db; //!< To store db handler - var $error; //!< To return error code (or message) - 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 + //public $element='ecm_directories'; //!< Id that identify managed objects + //public $table_element='ecm_directories'; //!< Name of table without prefix where object is stored var $id; @@ -377,8 +374,11 @@ class EcmDirectory // extends CommonObject /** - * \brief Initialise object with example values - * \remarks id must be 0 if object instance is a specimen. + * 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() { diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 8b267a173ed..036040ed06d 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -36,11 +36,9 @@ if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT."/commande/class/co */ class Expedition extends CommonObject { - var $db; - var $error; - var $element="shipping"; - var $fk_element="fk_expedition"; - var $table_element="expedition"; + public $element="shipping"; + public $fk_element="fk_expedition"; + public $table_element="expedition"; var $id; var $socid; @@ -973,8 +971,11 @@ class Expedition extends CommonObject } /** - * \brief Initialise la facture avec valeurs fictives aleatoire - * Sert a generer une facture pour l'aperu des modeles ou dem + * 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() { diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index b1b8ad1ebce..6d240bfb31d 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -32,11 +32,10 @@ require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php"); */ class Fichinter extends CommonObject { - var $db; - var $element='fichinter'; - var $table_element='fichinter'; - var $fk_element='fk_fichinter'; - var $table_element_line='fichinterdet'; + public $element='fichinter'; + public $table_element='fichinter'; + public $fk_element='fk_fichinter'; + public $table_element_line='fichinterdet'; var $id; @@ -751,8 +750,11 @@ class Fichinter extends CommonObject /** - * Initializes the intervention with random values - * Used to generate a intervention for the preview or demo models + * 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() { diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index c82680ce46b..7ee68dd62e2 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -36,15 +36,11 @@ require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php"); */ class CommandeFournisseur extends Commande { - var $id ; - var $db ; - var $error; - - var $element='order_supplier'; - 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 + public $element='order_supplier'; + public $table_element='commande_fournisseur'; + public $table_element_line = 'commande_fournisseurdet'; + public $fk_element = 'fk_commande'; + protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe var $ref; // TODO deprecated var $product_ref; @@ -1666,8 +1662,11 @@ class CommandeFournisseur extends Commande /** - * Initialise an example of instance with random values - * Used to build previews or test instances + * 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() { diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 0d98c3ef5ed..1f529dcedc4 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -35,15 +35,11 @@ include_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"); */ class FactureFournisseur extends Facture { - var $id; - var $db; - var $error; - - var $element='invoice_supplier'; - 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 + public $element='invoice_supplier'; + public $table_element='facture_fourn'; + public $table_element_line='facture_fourn_det'; + public $fk_element='fk_facture_fourn'; + protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe var $ref; // TODO deprecated var $product_ref; @@ -1201,8 +1197,11 @@ class FactureFournisseur extends Facture /** - * Initialise an example of instance with random values - * Used to build previews or test instances + * 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() { diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php index 066073f953a..ec97237457f 100644 --- a/htdocs/fourn/class/paiementfourn.class.php +++ b/htdocs/fourn/class/paiementfourn.class.php @@ -32,10 +32,8 @@ require_once(DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'); */ class PaiementFourn extends Paiement { - var $db; - var $error; - var $element='payment_supplier'; - var $table_element='paiementfourn'; + public $element='payment_supplier'; + public $table_element='paiementfourn'; var $id; var $ref; @@ -188,7 +186,7 @@ class PaiementFourn extends Paiement dol_syslog('Paiement::Create Erreur INSERT dans paiement_facture '.$facid); $error++; } - + } else { diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index 8ec3d0c9a1d..97c3a72d4b2 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -37,11 +37,9 @@ if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT."/commande/class/co */ class Livraison extends CommonObject { - var $db; - var $error; - var $element="delivery"; - var $fk_element="fk_livraison"; - var $table_element="livraison"; + public $element="delivery"; + public $fk_element="fk_livraison"; + public $table_element="livraison"; var $id; 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() { diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index c6b2f1f3f91..ec4cc4b49aa 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -34,16 +34,12 @@ require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php"); */ class Product extends CommonObject { - var $db; - var $error; - var $errno = 0; - - var $element='product'; - var $table_element='product'; - 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 + public $element='product'; + public $table_element='product'; + public $fk_element='fk_product'; + public $childtables=array('propaldet','commandedet','facturedet','contratdet','product_fournisseur'); + protected $isnolinkedbythird = 1; // No field fk_soc + protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe //! Identifiant unique var $id ; diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 0492718625d..5046fb47e28 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -33,10 +33,8 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"); class Entrepot extends CommonObject { - var $db; - var $error; - var $element='label'; - var $table_element='entrepot'; + public $element='label'; + public $table_element='entrepot'; var $id; var $libelle; diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 1f63031869e..b12edb2fb37 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -30,11 +30,8 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"); */ class Project extends CommonObject { - var $db; //!< To store db handler - var $error; //!< To return error code (or message) - 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 + public $element='project'; //!< Id that identify managed objects + public $table_element='projet'; //!< Name of table without prefix where object is stored var $id; var $ref; @@ -666,9 +663,11 @@ class Project extends CommonObject } /** - * Initialise object with default value to be used as example - * - * @return void + * 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() { diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 82b9631c852..462edcb1f25 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -32,11 +32,8 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"); */ class Task extends CommonObject { - var $db; //!< To store db handler - var $error; //!< To return error code (or message) - 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 + public $element='project_task'; //!< Id that identify managed objects + public $table_element='projet_task'; //!< Name of table without prefix where object is stored 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. * - * @return void + * @return void */ function initAsSpecimen() { diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 3551c72537a..c85f5bb1e46 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1341,7 +1341,7 @@ class Societe extends CommonObject if ($this->id) { $now=dol_now(); - + $sql = "UPDATE ".MAIN_DB_PREFIX."societe "; $sql .= " SET price_level = '".$price_level."'"; $sql .= " WHERE rowid = " . $this->id; @@ -2481,8 +2481,11 @@ class Societe extends CommonObject /** - * Initialise an example of company with random values - * Used to build previews or test instances + * 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() { diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 1ffc4000316..a67d5ed69bd 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -36,12 +36,9 @@ require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php"); */ class User extends CommonObject { - var $db; - var $error; - var $errors=array(); - 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 + public $element='user'; + public $table_element='user'; + protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe var $id=0; var $ldap_sid; @@ -1231,7 +1228,7 @@ class User extends CommonObject { global $conf, $langs; require_once(DOL_DOCUMENT_ROOT ."/lib/security.lib.php"); - + $error=0; 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() { diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index cf2faaaa451..fcc6b9c667b 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -33,12 +33,9 @@ if ($conf->ldap->enabled) require_once (DOL_DOCUMENT_ROOT."/lib/ldap.class.php") */ class UserGroup extends CommonObject { - var $db; // Database handler - var $error; - var $errors=array(); - 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 + public $element='usergroup'; + public $table_element='usergroup'; + protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe var $id; // Group id var $entity; // Entity of group @@ -679,9 +676,11 @@ class UserGroup extends CommonObject /** - * Initialise le groupe avec valeurs fictives aleatoire - * - * @return void + * 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() {