From 8666725c624d7886ed634ff59211d70c667d7a4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Salvador?= Date: Mon, 10 Jun 2013 18:10:06 +0200 Subject: [PATCH] Preselected supplier when there's only one --- htdocs/core/class/html.form.class.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 2b540f3aabd..6983865eac9 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1829,7 +1829,7 @@ class Form * @param string $htmlname Name of HTML field * @return void */ - function select_product_fourn_price($productid,$htmlname='productfournpriceid') + function select_product_fourn_price($productid,$htmlname='productfournpriceid', $showempty=0) { global $langs,$conf; @@ -1860,9 +1860,15 @@ class Form { $form.= ''; } + else if ($num == 1) { + $objp = $this->db->fetch_object($result); + $form = $objp->nom; + $form .= ''; + } else { - $form.= ''; + $form = '