From 54d51ec557a1f98d631bb26b8590e2b5f65d0ff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 11 Dec 2020 13:46:47 +0100 Subject: [PATCH] Update html.form.class.php --- htdocs/core/class/html.form.class.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 8a928aeeb34..e1e1fc45228 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5930,20 +5930,25 @@ class Form * * @param string $prefix Prefix * @param string $selected Selected duration type - * @param array|null $excludetypes Array of duration types to exclude. Example array('y', 'm') + * @param array $excludetypes Array of duration types to exclude. Example array('y', 'm') * @return string HTML select string */ - public function selectTypeDuration($prefix, $selected = 'i', $excludetypes = null) + public function selectTypeDuration($prefix, $selected = 'i', $excludetypes = array()) { global $langs; - $TDurationTypes = array('y'=>$langs->trans('Years'), 'm'=>$langs->trans('Month'), 'w'=>$langs->trans('Weeks'), 'd'=>$langs->trans('Days'), 'h'=>$langs->trans('Hours'), 'i'=>$langs->trans('Minutes')); + $TDurationTypes = array( + 'y'=>$langs->trans('Years'), + 'm'=>$langs->trans('Month'), + 'w'=>$langs->trans('Weeks'), + 'd'=>$langs->trans('Days'), + 'h'=>$langs->trans('Hours'), + 'i'=>$langs->trans('Minutes') + ); // Removed undesired duration types - if (is_array($excludetypes)) { - foreach($excludetypes as $value) { - unset($TDurationTypes[$value]); - } + foreach ($excludetypes as $value) { + unset($TDurationTypes[$value]); } $retstring = '