diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index e4dc71fcb9a..da63720a69c 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -1615,9 +1615,11 @@ class Form
* @param int $hidelabel Hide label (0=no, 1=yes, 2=show search icon (before) and placeholder, 3 search icon after)
* @param array $ajaxoptions Options for ajax_autocompleter
* @param int $socid Thirdparty Id (to get also price dedicated to this customer)
+ * @param string $showempty '' to not show empty line. Translation key to show an empty line. '1' show empty line with no text.
+ * @param int $forcecombo Force to use combo box
* @return void
*/
- function select_produits($selected='', $htmlname='productid', $filtertype='', $limit=20, $price_level=0, $status=1, $finished=2, $selected_input_value='', $hidelabel=0, $ajaxoptions=array(), $socid=0)
+ function select_produits($selected='', $htmlname='productid', $filtertype='', $limit=20, $price_level=0, $status=1, $finished=2, $selected_input_value='', $hidelabel=0, $ajaxoptions=array(), $socid=0, $showempty='1', $forcecombo=0)
{
global $langs,$conf;
@@ -1650,14 +1652,14 @@ class Form
print img_picto($langs->trans("Search"), 'search');
}
}
- print 'global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />';
+ print 'global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />';
if ($hidelabel == 3) {
print img_picto($langs->trans("Search"), 'search');
}
}
else
{
- print $this->select_produits_list($selected,$htmlname,$filtertype,$limit,$price_level,'',$status,$finished,0,$socid);
+ print $this->select_produits_list($selected,$htmlname,$filtertype,$limit,$price_level,'',$status,$finished,0,$socid,$showempty,$forcecombo);
}
}
@@ -1674,9 +1676,11 @@ class Form
* @param int $finished Filter on finished field: 2=No filter
* @param int $outputmode 0=HTML select string, 1=Array
* @param int $socid Thirdparty Id (to get also price dedicated to this customer)
+ * @param string $showempty '' to not show empty line. Translation key to show an empty line. '1' show empty line with no text.
+ * @param int $forcecombo Force to use combo box
* @return array Array of keys for json
*/
- function select_produits_list($selected='',$htmlname='productid',$filtertype='',$limit=20,$price_level=0,$filterkey='',$status=1,$finished=2,$outputmode=0,$socid=0)
+ function select_produits_list($selected='',$htmlname='productid',$filtertype='',$limit=20,$price_level=0,$filterkey='',$status=1,$finished=2,$outputmode=0,$socid=0,$showempty='1',$forcecombo=0)
{
global $langs,$conf,$user,$db;
@@ -1767,8 +1771,27 @@ class Form
require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
$num = $this->db->num_rows($result);
- $out.='