From 3a8bde227b199167f1c16f3670a675eb7b1560eb Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 31 Aug 2018 19:26:08 +0200 Subject: [PATCH] Standardize and update code --- htdocs/asset/class/asset.class.php | 5 +++++ htdocs/categories/class/categorie.class.php | 16 ++++++++++------ htdocs/contrat/class/contrat.class.php | 5 ++++- htdocs/core/class/comment.class.php | 3 +++ htdocs/core/class/discount.class.php | 6 +++++- htdocs/core/class/events.class.php | 6 +++++- htdocs/core/modules/action/rapport.pdf.php | 10 +++++++--- htdocs/ecm/class/ecmdirectory.class.php | 7 ++++++- htdocs/ecm/class/ecmfiles.class.php | 10 ++++++++++ htdocs/fichinter/class/fichinter.class.php | 17 +++++++++++------ htdocs/holiday/class/holiday.class.php | 7 ++++++- htdocs/livraison/class/livraison.class.php | 18 +++++++++++------- .../class/opensurveysondage.class.php | 4 ++++ .../class/price_global_variable.class.php | 17 +++++++++++------ .../price_global_variable_updater.class.php | 19 ++++++++++++------- htdocs/product/stock/class/entrepot.class.php | 11 ++++++++--- htdocs/projet/class/project.class.php | 6 +++++- htdocs/projet/class/task.class.php | 6 +++++- htdocs/ticket/class/actions_ticket.class.php | 14 +++++++++----- htdocs/website/class/websitepage.class.php | 9 +++++++-- 20 files changed, 144 insertions(+), 52 deletions(-) diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index 6a9e6c7c485..70b45e88d73 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -111,7 +111,12 @@ class Asset extends CommonObject public $amount; public $fk_soc; + + /** + * @var string description + */ public $description; + public $note_public; public $note_private; public $date_creation; diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 8903e43c2ba..c028aee050d 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -152,20 +152,24 @@ class Categorie extends CommonObject * @var string ID to identify managed object */ public $element='category'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='categorie'; public $fk_parent; - + /** - * @var string proper name for given parameter - */ - public $label; - + * @var string proper name for given parameter + */ + public $label; + + /** + * @var string description + */ public $description; + /** * @var string Color */ diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 26a32fe8468..481c005a7b4 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -2498,7 +2498,10 @@ class ContratLigne extends CommonObjectLine */ public $libelle; - var $description; + /** + * @var string description + */ + public $description; var $product_ref; var $product_label; diff --git a/htdocs/core/class/comment.class.php b/htdocs/core/class/comment.class.php index 40402eb9717..33e727dcfd0 100644 --- a/htdocs/core/class/comment.class.php +++ b/htdocs/core/class/comment.class.php @@ -34,6 +34,9 @@ class Comment extends CommonObject public $fk_element; public $element_type; + /** + * @var string description + */ public $description; public $tms; diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index ca90a545645..f310f6e4d04 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -51,7 +51,11 @@ class DiscountAbsolute */ public $fk_user; - public $description; // Description libre + /** + * @var string description + */ + public $description; + public $datec; // Date creation public $fk_facture_line; // Id invoice line when a discount is used into an invoice line (for absolute discounts) public $fk_facture; // Id invoice when a discount line is used into an invoice (for credit note) diff --git a/htdocs/core/class/events.class.php b/htdocs/core/class/events.class.php index 6a2374a7d3b..30a03b71b4d 100644 --- a/htdocs/core/class/events.class.php +++ b/htdocs/core/class/events.class.php @@ -63,7 +63,11 @@ class Events // extends CommonObject var $type; var $entity; var $dateevent; - var $description; + + /** + * @var string description + */ + public $description; // List of all Audit/Security events supported by triggers var $eventstolog=array( diff --git a/htdocs/core/modules/action/rapport.pdf.php b/htdocs/core/modules/action/rapport.pdf.php index fe7be7f3052..51825939ae8 100644 --- a/htdocs/core/modules/action/rapport.pdf.php +++ b/htdocs/core/modules/action/rapport.pdf.php @@ -39,8 +39,12 @@ class CommActionRapport * @var DoliDB Database handler. */ public $db; - - var $description; + + /** + * @var string description + */ + public $description; + var $date_edition; var $year; var $month; @@ -103,7 +107,7 @@ class CommActionRapport if (! is_object($outputlangs)) $outputlangs=$langs; // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - + // Load traductions files requiredby by page $outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products")); diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php index 539baf9460a..7da35d19ee1 100644 --- a/htdocs/ecm/class/ecmdirectory.class.php +++ b/htdocs/ecm/class/ecmdirectory.class.php @@ -50,7 +50,12 @@ class EcmDirectory // extends CommonObject public $label; var $fk_parent; - var $description; + + /** + * @var string description + */ + public $description; + var $cachenbofdoc=-1; // By default cache initialized with value 'not calculated' var $date_c; var $date_m; diff --git a/htdocs/ecm/class/ecmfiles.class.php b/htdocs/ecm/class/ecmfiles.class.php index 25dc979a5db..07494f84d3d 100644 --- a/htdocs/ecm/class/ecmfiles.class.php +++ b/htdocs/ecm/class/ecmfiles.class.php @@ -64,7 +64,12 @@ class EcmFiles extends CommonObject public $filename; public $filepath; public $fullpath_orig; + + /** + * @var string description + */ public $description; + public $keywords; public $cover; public $position; @@ -848,7 +853,12 @@ class EcmfilesLine public $filename; public $filepath; public $fullpath_orig; + + /** + * @var string description + */ public $description; + public $keywords; public $cover; public $position; diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 7c772d460a5..c3cf277f409 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -39,12 +39,12 @@ class Fichinter extends CommonObject * @var string ID to identify managed object */ public $element='fichinter'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='fichinter'; - + public $fk_element='fk_fichinter'; public $table_element_line='fichinterdet'; public $picto = 'intervention'; @@ -65,7 +65,12 @@ class Fichinter extends CommonObject var $datem; var $duration; var $statut = 0; // 0=draft, 1=validated, 2=invoiced, 3=Terminate - var $description; + + /** + * @var string description + */ + public $description; + var $fk_contrat = 0; var $fk_project = 0; var $extraparams=array(); @@ -1321,7 +1326,7 @@ class FichinterLigne extends CommonObjectLine * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ @@ -1338,12 +1343,12 @@ class FichinterLigne extends CommonObjectLine * @var string ID to identify managed object */ public $element='fichinterdet'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='fichinterdet'; - + public $fk_element='fk_fichinter'; /** diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 89d60be7569..c6ab0281120 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -58,7 +58,12 @@ class Holiday extends CommonObject public $fk_user; var $date_create=''; - var $description; + + /** + * @var string description + */ + public $description; + var $date_debut=''; // Date start in PHP server TZ var $date_fin=''; // Date end in PHP server TZ var $date_debut_gmt=''; // Date start in GMT diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index 763b28fb445..8c73339c612 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -43,14 +43,14 @@ class Livraison extends CommonObject * @var string ID to identify managed object */ public $element="delivery"; - + public $fk_element="fk_livraison"; - + /** * @var string Name of table without prefix where object is stored */ public $table_element="livraison"; - + public $table_element_line="livraisondet"; var $brouillon; @@ -1078,13 +1078,17 @@ class LivraisonLigne extends CommonObjectLine var $price; var $fk_product; var $origin_id; - + /** * @var string proper name for given parameter */ public $label; - - var $description; // Description produit + + /** + * @var string description produit + */ + public $description; + /** * @deprecated * @see product_ref @@ -1103,7 +1107,7 @@ class LivraisonLigne extends CommonObjectLine * @var string ID to identify managed object */ public $element='livraisondet'; - + /** * @var string Name of table without prefix where object is stored */ diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index 5d3129f1585..cbfd73ac9bf 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -52,6 +52,10 @@ class Opensurveysondage extends CommonObject * @see description */ public $commentaires; + + /** + * @var string description + */ public $description; public $mail_admin; diff --git a/htdocs/product/dynamic_price/class/price_global_variable.class.php b/htdocs/product/dynamic_price/class/price_global_variable.class.php index f30260a30c0..2997e88c589 100644 --- a/htdocs/product/dynamic_price/class/price_global_variable.class.php +++ b/htdocs/product/dynamic_price/class/price_global_variable.class.php @@ -33,26 +33,31 @@ class PriceGlobalVariable * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ public $error=''; - + /** * @var string[] Error codes (or messages) */ public $errors = array(); - + /** * @var int ID */ public $id; - + var $code; - var $description; + + /** + * @var string description + */ + public $description; + var $value; - + /** * @var string Name of table without prefix where object is stored */ diff --git a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php index 7ca18f36b5d..2155470484e 100644 --- a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php +++ b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php @@ -33,33 +33,38 @@ class PriceGlobalVariableUpdater * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ public $error=''; - + /** * @var string[] Error codes (or messages) */ public $errors = array(); - + var $types=array(0, 1); //!< Updater types var $update_min = 5; //!< Minimal update rate - + /** * @var int ID */ public $id; - + var $type; - var $description; + + /** + * @var string description + */ + public $description; + var $parameters; var $fk_variable; var $update_interval; //!< Interval in mins var $next_update; //!< Next update timestamp var $last_status; - + /** * @var string Name of table without prefix where object is stored */ diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index f8e60f135b9..6015608f5e3 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -37,12 +37,12 @@ class Entrepot extends CommonObject * @var string ID to identify managed object */ public $element='stock'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='entrepot'; - + public $picto='stock'; /** @@ -61,7 +61,12 @@ class Entrepot extends CommonObject const STATUS_OPEN_INTERNAL = 2; var $libelle; - var $description; + + /** + * @var string description + */ + public $description; + var $statut; var $lieu; var $address; diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 91cc8dbbcad..24cfef47ea8 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -53,7 +53,11 @@ class Project extends CommonObject */ protected $table_ref_field = 'ref'; - var $description; + /** + * @var string description + */ + public $description; + /** * @var string * @deprecated diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 2d16e2f53fb..6cd128380e5 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -52,7 +52,11 @@ class Task extends CommonObject */ public $label; - var $description; + /** + * @var string description + */ + public $description; + var $duration_effective; // total of time spent on this task var $planned_workload; var $date_c; diff --git a/htdocs/ticket/class/actions_ticket.class.php b/htdocs/ticket/class/actions_ticket.class.php index 49007d325c4..e8e637dd87a 100644 --- a/htdocs/ticket/class/actions_ticket.class.php +++ b/htdocs/ticket/class/actions_ticket.class.php @@ -39,21 +39,21 @@ class ActionsTicket * @var DoliDB Database handler. */ public $db; - + public $dao; public $mesg; - + /** * @var string Error code (or message) */ public $error; - + /** * @var string[] Error codes (or messages) */ public $errors = array(); - + //! Numero de l'erreur public $errno = 0; @@ -61,7 +61,11 @@ class ActionsTicket public $template; public $label; - public $description; + + /** + * @var string description + */ + public $description; public $fk_statut; public $fk_soc; diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index 9874b1fa8b0..f7dec16c6c0 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -39,12 +39,12 @@ class WebsitePage extends CommonObject * @var string Id to identify managed objects */ public $element = 'websitepage'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'website_page'; - + /** * @var string String with name of icon for websitepage. Must be the part after the 'object_' into object_myobject.png */ @@ -55,7 +55,12 @@ class WebsitePage extends CommonObject public $aliasalt; public $type_container; public $title; + + /** + * @var string description + */ public $description; + public $keywords; public $htmlheader; public $content;