diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 4f61435f124..85a4f1922b0 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -21,6 +21,7 @@ * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2018 Christophe Battarel * Copyright (C) 2018 Josep Lluis Amador + * Copyright (C) 2019 Thibault FOUCART * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -6774,7 +6775,45 @@ class Form return $resultyesno; } + /** + * Return an html string with a select combo box to choose yes or no + * + * @param string $htmlname Name of html select field + * @param string $value Pre-selected value + * @param int $option 0 return automatic/manual, 1 return 1/0 + * @param bool $disabled true or false + * @param int $useempty 1=Add empty line + * @return string See option + */ + public function selectautomanual($htmlname, $value = '', $option = 0, $disabled = false, $useempty = 0) + { + global $langs; + $automatic="automatic"; $manual="manual"; + if ($option) + { + $automatic="1"; + $manual="0"; + } + + $disabled = ($disabled ? ' disabled' : ''); + + $resultautomanual = ''."\n"; + return $resultautomanual; + } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /**