Fix: missing select2 combobox
This commit is contained in:
parent
44405e5415
commit
e038e1a2f5
@ -4296,7 +4296,7 @@ class Form
|
|||||||
*/
|
*/
|
||||||
function select_currency($selected='',$htmlname='currency_id')
|
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
|
* @param string $htmlname name of HTML select list
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function selectCurrency($selected='',$htmlname='currency_id')
|
function selectCurrency($selected='',$htmlname='currency_id')
|
||||||
{
|
{
|
||||||
global $conf,$langs,$user;
|
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.= '<select class="flat" name="'.$htmlname.'" id="'.$htmlname.'">';
|
$out.= '<select class="flat maxwidth200onsmartphone minwidth300" name="'.$htmlname.'" id="'.$htmlname.'">';
|
||||||
foreach ($langs->cache_currencies as $code_iso => $currency)
|
foreach ($langs->cache_currencies as $code_iso => $currency)
|
||||||
{
|
{
|
||||||
if ($selected && $selected == $code_iso)
|
if ($selected && $selected == $code_iso)
|
||||||
{
|
{
|
||||||
$out.= '<option value="'.$code_iso.'" selected>';
|
$out.= '<option value="'.$code_iso.'" selected>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$out.= '<option value="'.$code_iso.'">';
|
$out.= '<option value="'.$code_iso.'">';
|
||||||
}
|
}
|
||||||
$out.= $currency['label'];
|
$out.= $currency['label'];
|
||||||
$out.= ' ('.$langs->getCurrencySymbol($code_iso).')';
|
$out.= ' ('.$langs->getCurrencySymbol($code_iso).')';
|
||||||
$out.= '</option>';
|
$out.= '</option>';
|
||||||
}
|
}
|
||||||
$out.= '</select>';
|
$out.= '</select>';
|
||||||
if ($user->admin) $out.= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
|
if ($user->admin) $out.= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
|
||||||
return $out;
|
|
||||||
}
|
// 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
|
* Return array of currencies in user language
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user