diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php
index 44a4e37922a03ef32353f795b8a68493b9206bc9..2ac33a71796aba7c39d1cddb53ba10a1ea251351 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 de78dcb5b3cd9d95bd93a2708522194de036426f..aa08f2cbbe3d161d827850dcb02c3d419307fd4d 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 5ea122c80d3bd5fc1686a688f6863ad237468807..24f2450dd19089d4dc57bb126d93407be1b1e14c 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 75c7749e4655f1f20756cf83f5bc1abd371d5e23..0ac1523f6d5293b7b2a49bcb87447a2b0ec7b3d6 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 6613ada6ae8f726c00155aa089dc64fcf04456cc..e1e68db7a58a6a2cb4351c122115410d8de0bf09 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 93f40c13a77b2a5e4d79105294efb9906205f048..8b5658fcf93eff89e79882348e536237c2f571a6 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 5b27032918ebd8906f8867e35d21124f7ac88891..60fe869aa973f7b92ba72bc441ba592464328d3a 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 84b0d47377a4eeb1d670c6e429ed20928ce4791b..6adbc8f94d1d01b1f615ac217f6c18f43c8be67a 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 018dff2c73cb31163bc3aef7ecb20dccc389a5d4..b817c000646964c17749bd60b0a597c92fbaa35f 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 09ae19b49919e8fe3a1346bfb2bd2115e7e02518..409df18639fe8fcdae89b933787f02b5aa3960e4 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 e30a2c645a81d884b068a3b099317e06ba154a44..294e3d522601b54786955ac89fbf1cf945050ef0 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 d5d14e9e816f39927d3dd4c5cd1b7570388f4675..40362bb5f70e6e1e116ac950d8e7d4ecf8fe512b 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 32b341c3276762311912608d1c5646b4d76bc5c6..061d70556379966b8b822b1751374010fc5d6b69 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 e2cbc28f14efa61a7cb29f00707971786ac845ee..f71828698707be1a1138e44c017d0ec9039aba68 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 3e212918849b0d9b4a088a8217ca10dea26585fb..f6569ca10ae432828b3e295b07be71357d781937 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 a714a6505856ff1ec7437177831bbec1b33cfc38..71ead3c64d16d7f34a55e267243dc65e2c432a42 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 3535470dd90ec7eb28106c820eac63911560d53e..f9baebbe540ae00ac286e2218a8eab6f63ba7b03 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 02874e46bdfc17a7a3d4508eaee750ad6a621979..c65623d2cfef9d12229b7012dc40f311a5859861 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 136121faabdd2efb343ef83d68344c08a1bfdb43..c4fc13c00a500ce9900fafd12a934f261b44be7a 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 e84256983434f650e7bb5f46e2d5500bc9792d83..a2e74b9d1f15bba6ee263bf7a6aa444d57a4f33a 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 37151fa53024c4ccd60e0f37676240e7347977aa..e7890ec980ad85c9db182e4ac86bf6a33024e6d4 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 5f30071089256e56b6f216828199482c56f6ed0f..3c673da95d09086a2be273c986634a07af02be0f 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 d659010841911a985832b669d9f18ae175105118..fc6f468637a3274f8da486dfdb43a83724089a77 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 a344f8fb774e35dad5c533865dede174bbbac701..9e8c08c8e0341b818c8b5dd738dc65fa0029269d 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 a7915ae9d8a01eb816473cb3e5bca2a608ef6f61..13bd7a5d0f4139cc62de305e947f4eee706e81d9 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 112fdf228335b8e79b4ed1719147919a88912581..18e021b15be21bb4c237c218475c7c722293bf65 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 4680d47cd5105799b673642da141a07958006728..cefaf94c63e2613b7b0f107d4cdcb3a159da9784 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 aa01c56bce8cae402dc325c6fb623e182de43b22..093a227ced0c21528623b21cea4ede15528ec55f 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 4e1ec677cef285e7f84fbf9c87f164c24771e762..3cebdc74504c4bb0d6698eb1b6b62ead51e01a2a 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 88698b61a6eb209d9b9546e8dc88c65a965a1707..c2855b42514056e1f4116869e7532b84abaf0ac6 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 c302b215d66eb468afb909ce47a9425b0ec463d0..df1f7404e76dd19584539b4614dbc17df30d8f67 100644
--- a/htdocs/core/class/stats.class.php
+++ b/htdocs/core/class/stats.class.php
@@ -1,6 +1,6 @@
 <?php
 /* 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
  * 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 0e2fd4e7259f2606c25a6ff0358708b669a3bbf2..ac8429d0c0df7a13972e7c64b3259f3a3007cc6a 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 8b267a173edd5fc1a143ac105c5894f361bf9f46..036040ed06da87ecb52dcbace44d29f53dac0f45 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 b1b8ad1ebcee503e95c05258649e728b9cd13c89..6d240bfb31def18ca19e2daa0ee4e0b24fa9273e 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 c82680ce46b758cf974b0816c36ebca949cac9d1..7ee68dd62e2a894a378b06d80dbc1cdce214c36b 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 0d98c3ef5edefc5ee930f7ee26e3256c8691773e..1f529dcedc4dc17d430c0be6e5d183e82cf08a9b 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 066073f953a9a63669f3c149611068df8e09f6df..ec97237457f3a7249ec5e46706884296c703323b 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 8ec3d0c9a1dad5b300cd27e4dcce706d37fcdeb9..97c3a72d4b2d01eae62269a8f2519b6b58035ec0 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 c6b2f1f3f917896380c3f4c3b82740051db9709c..ec4cc4b49aa3daf6fc3d20e891a8105903dd099e 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 0492718625d3186178568c3490d7b832244bb97d..5046fb47e28a7a2cf6cc33bd9d6abf19675237bf 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 1f63031869e16c155755660b418d100d3a0c7b19..b12edb2fb37abbf6b341352f8117c3fe53387577 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 82b9631c85233f42a6d6934ac5e136a118f30b8c..462edcb1f256dcde283b3d92bb2b001daa762e19 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 3551c72537afaa2288c6196da99b73ef168073ff..c85f5bb1e4642ea89f3bef0dfba29dee049ab1d5 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 1ffc40003162f0082070da6b77d35705ec04002d..a67d5ed69bdba2df57ba526d05a4645f09e6fd38 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 cf2faaaa451ac0c7974c7b9df1f6764537e17763..fcc6b9c667b9be67237cc3fab71c9dc5be68ef3d 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()
 	{