Fix: add empty message in combobox
This commit is contained in:
parent
9526465824
commit
3cdff5361f
@ -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>';
|
||||
|
||||
@ -76,7 +76,6 @@ $userstatic=new User($db);
|
||||
</td>
|
||||
<td>
|
||||
<?php $nbofcontacts=$form->select_contacts($selectedCompany, '', 'contactid'); ?>
|
||||
<?php if ($nbofcontacts == 0) echo $langs->trans("NoContactDefined"); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php $formcompany->selectTypeContact($object, '', 'type','external'); ?>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user