diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 4378a42455e..6a38310fde1 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -67,14 +67,14 @@ class Form
/**
* Output key field for an editable field
*
- * @param text Text of label
- * @param htmlname Name of select field
- * @param preselected Preselected value for parameter
- * @param paramkey Key of parameter (unique if there is several parameter to show)
- * @param paramvalue Value of parameter
- * @param perm Permission to allow button to edit parameter
- * @param typeofdata Type of data (string by default, email, ...)
- * @return string HTML edit field
+ * @param string $text Text of label
+ * @param string $htmlname Name of select field
+ * @param string $preselected Preselected value for parameter
+ * @param string $paramkey Key of parameter (unique if there is several parameter to show)
+ * @param string $paramvalue Value of parameter
+ * @param boolean $perm Permission to allow button to edit parameter
+ * @param string $typeofdata Type of data (string by default, email, ...)
+ * @return string HTML edit field
* TODO no GET or POST in class file, use a param
*/
function editfieldkey($text,$htmlname,$preselected,$paramkey,$paramvalue,$perm,$typeofdata='string')
@@ -91,14 +91,15 @@ class Form
/**
* Output val field for an editable field
- * @param text Text of label (not used in this function)
- * @param htmlname Name of select field
- * @param preselected Preselected value for parameter
- * @param paramkey Key of parameter (unique if there is several parameter to show)
- * @param perm Permission to allow button to edit parameter
- * @param typeofdata Type of data ('string' by default, 'email', 'text', ...)
- * @param editvalue Use this value instead $preselected
- * @return string HTML edit field
+ *
+ * @param string $text Text of label (not used in this function)
+ * @param string $htmlname Name of select field
+ * @param string $preselected Preselected value for parameter
+ * @param string $paramkey Key of parameter (unique if there is several parameter to show)
+ * @param boolean $perm Permission to allow button to edit parameter
+ * @param string $typeofdata Type of data ('string' by default, 'email', 'text', ...)
+ * @param string $editvalue Use this value instead $preselected
+ * @return string HTML edit field
* TODO no GET or POST in class file, use a param
*/
function editfieldval($text,$htmlname,$preselected,$paramkey,$paramvalue,$perm,$typeofdata='string',$editvalue='')
@@ -137,6 +138,7 @@ class Form
/**
* Show a text and picto with tooltip on text or picto
+ *
* @param text Text to show
* @param htmltext Content html of tooltip. Must be HTML/UTF8 encoded.
* @param tooltipon 1=tooltip sur texte, 2=tooltip sur picto, 3=tooltip sur les 2
@@ -236,6 +238,7 @@ class Form
/**
* Return combo list of activated countries, into language of user
+ *
* @param selected Id or Code or Label of preselected country
* @param htmlname Name of html select object
* @param htmloption Options html on select object
@@ -247,6 +250,7 @@ class Form
/**
* Return combo list of activated countries, into language of user
+ *
* @param selected Id or Code or Label of preselected country
* @param htmlname Name of html select object
* @param htmloption Options html on select object
@@ -316,6 +320,7 @@ class Form
/**
* Retourne la liste des types de comptes financiers
+ *
* @param selected Type pre-selectionne
* @param htmlname Nom champ formulaire
*/
@@ -351,6 +356,7 @@ class Form
/**
* Return list of social contributions.
* Use mysoc->pays_id or mysoc->pays_code so they must be defined.
+ *
* @param selected Preselected type
* @param htmlname Name of field in form
* @param useempty Set to 1 if we want an empty value
@@ -420,6 +426,7 @@ class Form
/**
* Return list of types of lines (product or service)
* Example: 0=product, 1=service, 9=other (for external module)
+ *
* @param selected Preselected type
* @param htmlname Name of field in html form
* @param showempty Add an empty field
@@ -467,6 +474,7 @@ class Form
/**
* Return list of types of notes
+ *
* @param selected Preselected type
* @param htmlname Name of field in form
* @param showempty Add an empty field
@@ -509,6 +517,7 @@ class Form
/**
* Output html form to select a third party
+ *
* @param selected Preselected type
* @param htmlname Name of field in form
* @param filter Optionnal filters criteras
@@ -523,6 +532,7 @@ class Form
/**
* Output html form to select a third party
+ *
* @param selected Preselected type
* @param htmlname Name of field in form
* @param filter Optionnal filters criteras
@@ -598,6 +608,7 @@ class Form
/**
* Return HTML combo list of absolute discounts
+ *
* @param selected Id remise fixe pre-selectionnee
* @param htmlname Nom champ formulaire
* @param filter Criteres optionnels de filtre
@@ -663,6 +674,7 @@ class Form
/**
* Return list of all contacts (for a third party or all)
+ *
* @param socid Id ot third party or 0 for all
* @param selected Id contact pre-selectionne
* @param htmlname Name of HTML field ('none' for a not editable field)
@@ -888,6 +900,7 @@ class Form
/**
* Return list of products for customer in Ajax if Ajax activated or go to select_produits_do
+ *
* @param selected Preselected products
* @param htmlname Name of HTML seletc field (must be unique in page)
* @param filtertype Filter on product type (''=nofilter, 0=product, 1=service)
@@ -927,6 +940,7 @@ class Form
/**
* Return list of products for a customer
+ *
* @param selected Preselected product
* @param htmlname Name of select html
* @param filtertype Filter on product type (''=nofilter, 0=product, 1=service)
@@ -1143,6 +1157,7 @@ class Form
/**
* Return list of products for customer in Ajax if Ajax activated or go to select_produits_fournisseurs_do
+ *
* @param socid Id third party
* @param selected Preselected product
* @param htmlname Name of HTML Select
@@ -1167,6 +1182,7 @@ class Form
/**
* Retourne la liste des produits de fournisseurs
+ *
* @param socid Id societe fournisseur (0 pour aucun filtre)
* @param selected Produit pre-selectionne
* @param htmlname Nom de la zone select
@@ -1319,8 +1335,10 @@ class Form
/**
* Return list of suppliers prices for a product
- * @param productid Id of product
- * @param htmlname Name of HTML field
+ *
+ * @param int $productid Id of product
+ * @param string $htmlname Name of HTML field
+ * @return void
*/
function select_product_fourn_price($productid,$htmlname='productfournpriceid')
{
@@ -1407,10 +1425,12 @@ class Form
/**
* Return list of delivery address
- * @param selected Id contact pre-selectionn
- * @param socid
- * @param htmlname Name of HTML field
- * @param showempty Add an empty field
+ *
+ * @param string $selected Id contact pre-selectionn
+ * @param int $socid Id of company
+ * @param string $htmlname Name of HTML field
+ * @param int $showempty Add an empty field
+ * @return void
*/
function select_address($selected='', $socid, $htmlname='address_id',$showempty=0)
{
@@ -1457,13 +1477,14 @@ class Form
/**
* Charge dans cache la liste des conditions de paiements possibles
+ *
* @return int Nb lignes chargees, 0 si deja chargees, <0 si ko
*/
function load_cache_conditions_paiements()
{
global $langs;
- if (sizeof($this->cache_conditions_paiements)) return 0; // Cache deja charge
+ if (count($this->cache_conditions_paiements)) return 0; // Cache deja charge
$sql = "SELECT rowid, code, libelle";
$sql.= " FROM ".MAIN_DB_PREFIX.'c_payment_term';
@@ -1495,13 +1516,14 @@ class Form
/**
* Charge dans cache la liste des délais de livraison possibles
+ *
* @return int Nb lignes chargees, 0 si deja chargees, <0 si ko
*/
function load_cache_availability()
{
global $langs;
- if (sizeof($this->cache_availability)) return 0; // Cache deja charge
+ if (count($this->cache_availability)) return 0; // Cache deja charge
$sql = "SELECT rowid, code, label";
$sql.= " FROM ".MAIN_DB_PREFIX.'c_availability';
@@ -1533,6 +1555,7 @@ class Form
/**
* Retourne la liste des types de delais de livraison possibles
+ *
* @param selected Id du type de delais pre-selectionne
* @param htmlname Nom de la zone select
* @param filtertype To add a filter
@@ -1565,13 +1588,14 @@ class Form
/**
* Load into cache cache_demand_reason, array of input reasons
+ *
* @return int Nb of lines loaded, 0 if already loaded, <0 if ko
*/
function load_cache_demand_reason()
{
global $langs;
- if (sizeof($this->cache_demand_reason)) return 0; // Cache already loaded
+ if (count($this->cache_demand_reason)) return 0; // Cache already loaded
$sql = "SELECT rowid, code, label";
$sql.= " FROM ".MAIN_DB_PREFIX.'c_input_reason';
@@ -1608,6 +1632,7 @@ class Form
/**
* Return list of events that triggered an object creation
+ *
* @param selected Id du type d'origine pre-selectionne
* @param htmlname Nom de la zone select
* @param exclude To exclude a code value (Example: SRC_PROP)
@@ -1642,13 +1667,14 @@ class Form
/**
* Charge dans cache la liste des types de paiements possibles
+ *
* @return int Nb lignes chargees, 0 si deja chargees, <0 si ko
*/
function load_cache_types_paiements()
{
global $langs;
- if (sizeof($this->cache_types_paiements)) return 0; // Cache deja charge
+ if (count($this->cache_types_paiements)) return 0; // Cache deja charge
$sql = "SELECT id, code, libelle, type";
$sql.= " FROM ".MAIN_DB_PREFIX."c_paiement";
@@ -1960,7 +1986,7 @@ class Form
$output = '