From 13c93ba1c280a881313d10103236e24495f5e1f0 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 31 Mar 2019 19:26:40 +0200 Subject: [PATCH] transfert from html.form.class.php --- htdocs/core/class/html.formother.class.php | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 3957e44daf5..200a0d1f9f3 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -9,6 +9,7 @@ * Copyright (C) 2006 Marc Barilley/Ocebo * Copyright (C) 2007 Franky Van Liedekerke * Copyright (C) 2007 Patrick Raguin + * 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 @@ -1232,4 +1233,44 @@ class FormOther dol_print_error($this->db); } } + + /** + * 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; + } }