diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 68bca2606b7..625791ea0d0 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -3342,7 +3342,6 @@ class Form
}
$outref = $objp->ref;
- $outval = '';
$outbarcode = $objp->barcode;
$outqty = 1;
$outdiscount = 0;
@@ -3523,48 +3522,52 @@ class Form
}
}
- $opt = '\n";
// Add new entry
// "key" value of json key array is used by jQuery automatically as selected value. Example: 'type' = product or service, 'price_ht' = unit price without tax
// "label" value of json key array is used by jQuery automatically as text for combo box
- $out .= $opt;
- array_push(
- $outarray,
- array('key'=>$outkey,
- 'value'=>$outref,
- 'label'=>$outval,
- 'qty'=>$outqty,
- 'price_qty_ht'=>price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty
- 'price_unit_ht'=>price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price
- 'price_ht'=>price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility)
- 'tva_tx'=>$objp->tva_tx,
- 'default_vat_code'=>$objp->default_vat_code,
- 'discount'=>$outdiscount,
- 'type'=>$outtype,
- 'duration_value'=>$outdurationvalue,
- 'duration_unit'=>$outdurationunit,
- 'disabled'=>(empty($objp->idprodfournprice) ? true : false),
- 'description'=>$objp->description
- )
- );
+ $out .= $optstart . ' data-html="'.dol_escape_htmltag($optlabel).'">' . $optlabel . "\n";;
+ array_push($outarray, $outarrayentry);
+
// Exemple of var_dump $outarray
// array(1) {[0]=>array(6) {[key"]=>string(1) "2" ["value"]=>string(3) "ppp"
// ["label"]=>string(76) "ppp (fff2) - ppp - 20,00 Euros/1unité (20,00 Euros/unité)"