From db32d8903e2d48d8233297db75f31410b01b58af Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 1 Sep 2018 23:20:20 +0200 Subject: [PATCH] Standardize and Update code --- .../class/fournisseur.commande.class.php | 5 +- .../fournisseur.commande.dispatch.class.php | 5 +- .../fourn/class/fournisseur.product.class.php | 54 +++++++++---------- .../class/productcustomerprice.class.php | 36 ++++++------- .../class/propalmergepdfproduct.class.php | 16 +++--- .../class/price_expression.class.php | 12 ++--- .../class/price_global_variable.class.php | 4 +- .../price_global_variable_updater.class.php | 16 +++--- .../inventory/class/inventory.class.php | 2 + htdocs/societe/class/address.class.php | 9 ++++ 10 files changed, 88 insertions(+), 71 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 0f727559507..6768097f7c1 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -76,7 +76,10 @@ class CommandeFournisseur extends CommonOrder */ protected $table_ref_field = 'ref'; - public $id; + /** + * @var int ID + */ + public $id; /** * Supplier order reference diff --git a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php index 4052d17b8b0..2e1162873d5 100644 --- a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php +++ b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php @@ -60,7 +60,10 @@ class CommandeFournisseurDispatch extends CommonObject public $table_element='commande_fournisseur_dispatch'; //!< Name of table without prefix where object is stored public $lines=array(); - public $id; + /** + * @var int ID + */ + public $id; public $fk_commande; public $fk_product; diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 77a31689237..994358e4511 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -41,52 +41,52 @@ class ProductFournisseur extends Product * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ public $error=''; - var $product_fourn_price_id; // id of ligne product-supplier + public $product_fourn_price_id; // id of ligne product-supplier /** * @var int ID */ public $id; - + /** * @deprecated * @see ref_supplier */ - var $fourn_ref; - var $delivery_time_days; - var $ref_supplier; // ref supplier (can be set by get_buyprice) - var $desc_supplier; - var $vatrate_supplier; // default vat rate for this supplier/qty/product (can be set by get_buyprice) + public $fourn_ref; + public $delivery_time_days; + public $ref_supplier; // ref supplier (can be set by get_buyprice) + public $desc_supplier; + public $vatrate_supplier; // default vat rate for this supplier/qty/product (can be set by get_buyprice) - var $fourn_id; //supplier id - var $fourn_qty; // quantity for price (can be set by get_buyprice) - var $fourn_pu; // unit price for quantity (can be set by get_buyprice) + public $fourn_id; //supplier id + public $fourn_qty; // quantity for price (can be set by get_buyprice) + public $fourn_pu; // unit price for quantity (can be set by get_buyprice) - var $fourn_price; // price for quantity - var $fourn_remise_percent; // discount for quantity (percent) - var $fourn_remise; // discount for quantity (amount) - var $product_fourn_id; // supplier id - var $fk_availability; // availability delay - visible/used if option FOURN_PRODUCT_AVAILABILITY is on (duplicate information compared to delivery delay) - var $fourn_unitprice; - var $fourn_tva_tx; - var $fourn_tva_npr; + public $fourn_price; // price for quantity + public $fourn_remise_percent; // discount for quantity (percent) + public $fourn_remise; // discount for quantity (amount) + public $product_fourn_id; // supplier id + public $fk_availability; // availability delay - visible/used if option FOURN_PRODUCT_AVAILABILITY is on (duplicate information compared to delivery delay) + public $fourn_unitprice; + public $fourn_tva_tx; + public $fourn_tva_npr; - var $fk_supplier_price_expression; - var $supplier_reputation; // reputation of supplier - var $reputations=array(); // list of available supplier reputations + public $fk_supplier_price_expression; + public $supplier_reputation; // reputation of supplier + public $reputations=array(); // list of available supplier reputations // Multicurreny - var $fourn_multicurrency_id; - var $fourn_multicurrency_code; - var $fourn_multicurrency_tx; - var $fourn_multicurrency_price; - var $fourn_multicurrency_unitprice; + public $fourn_multicurrency_id; + public $fourn_multicurrency_code; + public $fourn_multicurrency_tx; + public $fourn_multicurrency_price; + public $fourn_multicurrency_unitprice; /** * Constructor diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index 011a95345db..35ba8621ae8 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -970,28 +970,28 @@ class PriceByCustomerLine */ public $id; - var $entity; - var $datec = ''; - var $tms = ''; - var $fk_product; - var $fk_soc; - var $price; - var $price_ttc; - var $price_min; - var $price_min_ttc; - var $price_base_type; - var $default_vat_code; - var $tva_tx; - var $recuperableonly; - var $localtax1_tx; - var $localtax2_tx; + public $entity; + public $datec = ''; + public $tms = ''; + public $fk_product; + public $fk_soc; + public $price; + public $price_ttc; + public $price_min; + public $price_min_ttc; + public $price_base_type; + public $default_vat_code; + public $tva_tx; + public $recuperableonly; + public $localtax1_tx; + public $localtax2_tx; /** * @var int User ID */ public $fk_user; - var $import_key; - var $socname; - var $prodref; + public $import_key; + public $socname; + public $prodref; } diff --git a/htdocs/product/class/propalmergepdfproduct.class.php b/htdocs/product/class/propalmergepdfproduct.class.php index 75fe5282bd1..fb0a7ad2cb5 100644 --- a/htdocs/product/class/propalmergepdfproduct.class.php +++ b/htdocs/product/class/propalmergepdfproduct.class.php @@ -645,14 +645,14 @@ class PropalmergepdfproductLine */ public $id; - var $fk_product; - var $file_name; - var $lang; - var $fk_user_author; - var $fk_user_mod; - var $datec=''; - var $tms=''; - var $import_key; + public $fk_product; + public $file_name; + public $lang; + public $fk_user_author; + public $fk_user_mod; + public $datec=''; + public $tms=''; + public $import_key; /** * Constructor diff --git a/htdocs/product/dynamic_price/class/price_expression.class.php b/htdocs/product/dynamic_price/class/price_expression.class.php index 0d991ace9fe..c80cb43e727 100644 --- a/htdocs/product/dynamic_price/class/price_expression.class.php +++ b/htdocs/product/dynamic_price/class/price_expression.class.php @@ -33,7 +33,7 @@ class PriceExpression * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ @@ -43,15 +43,15 @@ class PriceExpression * @var string[] Error codes (or messages) */ public $errors = array(); - + /** * @var int ID */ public $id; - - var $title; - var $expression; - + + public $title; + public $expression; + /** * @var string Name of table without prefix where object is stored */ 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 2997e88c589..ebdba3b5949 100644 --- a/htdocs/product/dynamic_price/class/price_global_variable.class.php +++ b/htdocs/product/dynamic_price/class/price_global_variable.class.php @@ -49,14 +49,14 @@ class PriceGlobalVariable */ public $id; - var $code; + public $code; /** * @var string description */ public $description; - var $value; + public $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 943e78d633c..8c7c936856b 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 @@ -44,26 +44,26 @@ class PriceGlobalVariableUpdater */ public $errors = array(); - var $types=array(0, 1); //!< Updater types - var $update_min = 5; //!< Minimal update rate + public $types=array(0, 1); //!< Updater types + public $update_min = 5; //!< Minimal update rate /** * @var int ID */ public $id; - var $type; + public $type; /** * @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; + public $parameters; + public $fk_variable; + public $update_interval; //!< Interval in mins + public $next_update; //!< Next update timestamp + public $last_status; /** * @var string Name of table without prefix where object is stored diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index 7e068818db8..2233a6c76e5 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -483,10 +483,12 @@ class InventoryObjectLine * @var int ID */ public $id; + /** * @var mixed Sample line property 1 */ public $prop1; + /** * @var mixed Sample line property 2 */ diff --git a/htdocs/societe/class/address.class.php b/htdocs/societe/class/address.class.php index 1cb4f1c4b65..7a6fc299a78 100644 --- a/htdocs/societe/class/address.class.php +++ b/htdocs/societe/class/address.class.php @@ -33,7 +33,11 @@ class Address { protected $db; + /** + * @var int ID + */ public $id; + public $type; public $label; public $socid; @@ -496,7 +500,12 @@ class Address class AddressLine { protected $db; + + /** + * @var int ID + */ public $id; + public $date_creation; public $date_modification; public $label;