From e038e1a2f5825d02343565336017d89a64614b7c Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 12 Sep 2017 09:27:59 +0200 Subject: [PATCH] Fix: missing select2 combobox --- htdocs/core/class/html.form.class.php | 57 +++++++++++++++------------ 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index c8ea494ad3a..a296fc9079a 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4296,7 +4296,7 @@ class Form */ function select_currency($selected='',$htmlname='currency_id') { - print $this->selectcurrency($selected,$htmlname); + print $this->selectCurrency($selected,$htmlname); } /** @@ -4306,35 +4306,40 @@ class Form * @param string $htmlname name of HTML select list * @return string */ - function selectCurrency($selected='',$htmlname='currency_id') - { - global $conf,$langs,$user; + function selectCurrency($selected='',$htmlname='currency_id') + { + global $conf,$langs,$user; - $langs->loadCacheCurrencies(''); + $langs->loadCacheCurrencies(''); - $out=''; + $out=''; - if ($selected=='euro' || $selected=='euros') $selected='EUR'; // Pour compatibilite + if ($selected=='euro' || $selected=='euros') $selected='EUR'; // Pour compatibilite - $out.= ''; - if ($user->admin) $out.= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); - return $out; - } + $out.= ''; + if ($user->admin) $out.= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); + + // Make select dynamic + include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; + $out .= ajax_combobox($htmlname); + + return $out; + } /** * Return array of currencies in user language