2
0
forked from Wavyzz/dolibarr

Fix: add empty message in combobox

This commit is contained in:
Regis Houssin
2012-03-18 12:18:23 +01:00
parent 9526465824
commit 3cdff5361f
2 changed files with 6 additions and 3 deletions

View File

@@ -815,9 +815,9 @@ class Form
if ($resql)
{
$num=$this->db->num_rows($resql);
if ($num == 0) return 0;
$disable=($num==0 ? ' disabled="disabled"' : '');
if ($htmlname != 'none') print '<select class="flat'.($moreclass?' '.$moreclass:'').'" id="'.$htmlname.'" name="'.$htmlname.'">';
if ($htmlname != 'none') print '<select class="flat'.($moreclass?' '.$moreclass:'').'" id="'.$htmlname.'" name="'.$htmlname.'"'.$disable.'>';
if ($showempty) print '<option value="0"></option>';
$num = $this->db->num_rows($resql);
$i = 0;
@@ -870,6 +870,10 @@ class Form
$i++;
}
}
else
{
print '<option value="-1" selected="selected">'.$langs->trans("NoContactDefined").'</option>';
}
if ($htmlname != 'none')
{
print '</select>';