diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index 0215f20e3c6..f08143c443c 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -134,6 +134,40 @@ class FormProduct return $out; } + /** + * Display form to select warehouse + * + * @param string $page Page + * @param int $selected Id of warehouse + * @param string $htmlname Name of select html field + * @param int $addempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries. + * @return void + */ + function formSelectWarehouses($page, $selected='', $htmlname='warehouse_id', $addempty=0) + { + global $langs; + if ($htmlname != "none") { + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + print '
'; + print $this->selectWarehouses($selected, $htmlname, '', $addempty); + print '
'; + } else { + if ($selected) { + require_once DOL_DOCUMENT_ROOT .'/product/stock/class/entrepot.class.php'; + $warehousestatic=new Entrepot($this->db); + $warehousestatic->fetch($selected); + print $warehousestatic->getNomUrl(); + } else { + print " "; + } + } + } + /** * Output a combo box with list of units * pour l'instant on ne definit pas les unites dans la base