From 449ef9c4641cbe90cf3992294682a4356004efe1 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 22 Aug 2018 18:12:44 +0200 Subject: [PATCH] Update and standardize code --- htdocs/accountancy/class/bookkeeping.class.php | 5 ++++- htdocs/adherents/class/adherent.class.php | 5 +++++ htdocs/adherents/class/adherent_type.class.php | 4 ++++ htdocs/adherents/class/adherentstats.class.php | 5 ++++- htdocs/adherents/class/subscription.class.php | 5 +++++ htdocs/asset/class/asset.class.php | 4 ++++ htdocs/asset/class/asset_type.class.php | 4 ++++ htdocs/bookmarks/class/bookmark.class.php | 7 ++++++- htdocs/categories/class/categorie.class.php | 4 ++++ htdocs/comm/action/class/actioncomm.class.php | 7 ++++++- htdocs/comm/action/class/actioncommreminder.class.php | 3 +++ htdocs/comm/mailing/class/mailing.class.php | 5 +++++ htdocs/comm/propal/class/propal.class.php | 11 +++++++++++ htdocs/comm/propal/class/propalestats.class.php | 5 ++++- htdocs/commande/class/commande.class.php | 7 ++++++- htdocs/commande/class/commandestats.class.php | 3 +++ 16 files changed, 78 insertions(+), 6 deletions(-) diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 2d9e2fa4fdb..a3a91cdc8e5 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -35,14 +35,17 @@ class BookKeeping extends CommonObject * @var string Error code (or message) */ public $error; + /** * @var string[] Error codes (or messages) */ - public $errors = array (); + public $errors = array(); + /** * @var string Id to identify managed objects */ public $element = 'accountingbookkeeping'; + /** * @var string Name of table without prefix where object is stored */ diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 6b7462ba42a..9ced11e7d5d 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -42,7 +42,12 @@ require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; class Adherent extends CommonObject { public $element='member'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element='adherent'; + public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe var $mesgs; diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index ca8372c04ed..3af6206d274 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -32,7 +32,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; */ class AdherentType extends CommonObject { + /** + * @var string Name of table without prefix where object is stored + */ public $table_element = 'adherent_type'; + public $element = 'adherent_type'; public $picto = 'group'; public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe diff --git a/htdocs/adherents/class/adherentstats.class.php b/htdocs/adherents/class/adherentstats.class.php index 59c51cb1d21..aef2f275c89 100644 --- a/htdocs/adherents/class/adherentstats.class.php +++ b/htdocs/adherents/class/adherentstats.class.php @@ -32,7 +32,10 @@ include_once DOL_DOCUMENT_ROOT . '/adherents/class/subscription.class.php'; */ class AdherentStats extends Stats { - public $table_element; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element; var $socid; var $userid; diff --git a/htdocs/adherents/class/subscription.class.php b/htdocs/adherents/class/subscription.class.php index 1c4007780b9..71c304e5765 100644 --- a/htdocs/adherents/class/subscription.class.php +++ b/htdocs/adherents/class/subscription.class.php @@ -33,7 +33,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; class Subscription extends CommonObject { public $element='subscription'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element='subscription'; + public $picto='payment'; var $datec; // Date creation diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index 4ab05ce675c..002dca8bf56 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -35,18 +35,22 @@ class Asset extends CommonObject * @var string ID to identify managed object */ public $element = 'asset'; + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'asset'; + /** * @var int Does module support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ public $ismultientitymanaged = 0; + /** * @var int Does asset support extrafields ? 0=No, 1=Yes */ public $isextrafieldmanaged = 1; + /** * @var string String with name of icon for asset. Must be the part after the 'object_' into object_asset.png */ diff --git a/htdocs/asset/class/asset_type.class.php b/htdocs/asset/class/asset_type.class.php index 51ea3a0c799..8922701d698 100644 --- a/htdocs/asset/class/asset_type.class.php +++ b/htdocs/asset/class/asset_type.class.php @@ -29,7 +29,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; */ class AssetType extends CommonObject { + /** + * @var string Name of table without prefix where object is stored + */ public $table_element = 'asset_type'; + public $element = 'asset_type'; public $picto = 'group'; public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe diff --git a/htdocs/bookmarks/class/bookmark.class.php b/htdocs/bookmarks/class/bookmark.class.php index 737ecf717d8..a78c75a43db 100644 --- a/htdocs/bookmarks/class/bookmark.class.php +++ b/htdocs/bookmarks/class/bookmark.class.php @@ -29,7 +29,12 @@ class Bookmark extends CommonObject { public $element='bookmark'; - public $table_element='bookmark'; + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element='bookmark'; + public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe public $picto = 'bookmark'; diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 70b2108dd4c..1fccadc0a53 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -149,6 +149,10 @@ class Categorie extends CommonObject ); public $element='category'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element='categorie'; public $fk_parent; diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 78caa56b503..34478c0b6b2 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -35,7 +35,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; class ActionComm extends CommonObject { public $element='action'; - public $table_element = 'actioncomm'; + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'actioncomm'; + public $table_rowid = 'id'; public $picto='action'; diff --git a/htdocs/comm/action/class/actioncommreminder.class.php b/htdocs/comm/action/class/actioncommreminder.class.php index 4873db461f6..ce32234be56 100644 --- a/htdocs/comm/action/class/actioncommreminder.class.php +++ b/htdocs/comm/action/class/actioncommreminder.class.php @@ -34,14 +34,17 @@ class ActionCommReminder extends CommonObject * @var string ID to identify managed object */ public $element = 'actioncomm_reminder'; + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'actioncomm_reminder'; + /** * @var array Does actioncommreminder support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ public $ismultientitymanaged = 0; + /** * @var string String with name of icon for actioncommreminder. Must be the part after the 'object_' into object_actioncommreminder.png */ diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index 63fc0a2caab..f5c1fd84d9e 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -32,7 +32,12 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; class Mailing extends CommonObject { public $element='mailing'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element='mailing'; + public $picto='email'; var $titre; diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 848ac60d822..02ab37c626a 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -46,15 +46,22 @@ require_once DOL_DOCUMENT_ROOT .'/multicurrency/class/multicurrency.class.php'; class Propal extends CommonObject { public $element='propal'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element='propal'; + public $table_element_line='propaldet'; public $fk_element='fk_propal'; public $picto='propal'; + /** * 0=No test on entity, 1=Test with field entity, 2=Test with link by societe * @var int */ public $ismultientitymanaged = 1; + /** * 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user * @var integer @@ -3650,6 +3657,10 @@ class Propal extends CommonObject class PropaleLigne extends CommonObjectLine { public $element='propaldet'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element='propaldet'; var $oldline; diff --git a/htdocs/comm/propal/class/propalestats.class.php b/htdocs/comm/propal/class/propalestats.class.php index d6e9ee3b103..bb4e0ab56f4 100644 --- a/htdocs/comm/propal/class/propalestats.class.php +++ b/htdocs/comm/propal/class/propalestats.class.php @@ -35,7 +35,10 @@ include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; */ class PropaleStats extends Stats { - public $table_element; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element; var $socid; var $userid; diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 6c5a9db68ac..6ff85f51ca5 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -43,7 +43,12 @@ require_once DOL_DOCUMENT_ROOT .'/multicurrency/class/multicurrency.class.php'; class Commande extends CommonOrder { public $element='commande'; - public $table_element='commande'; + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element='commande'; + public $table_element_line = 'commandedet'; public $class_element_line = 'OrderLine'; public $fk_element = 'fk_commande'; diff --git a/htdocs/commande/class/commandestats.class.php b/htdocs/commande/class/commandestats.class.php index 6d9dde94bc4..6ab9965f307 100644 --- a/htdocs/commande/class/commandestats.class.php +++ b/htdocs/commande/class/commandestats.class.php @@ -34,6 +34,9 @@ include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; */ class CommandeStats extends Stats { + /** + * @var string Name of table without prefix where object is stored + */ public $table_element; var $socid;