Fix: avoid warning

This commit is contained in:
Regis Houssin 2012-10-31 09:59:24 +01:00
parent 2607a8a3dd
commit b70af837df

View File

@ -625,17 +625,20 @@ class FormCompany
*/ */
function selectTypeContact($object, $selected, $htmlname = 'type', $source='internal', $order='code', $showempty=0) function selectTypeContact($object, $selected, $htmlname = 'type', $source='internal', $order='code', $showempty=0)
{ {
$lesTypes = $object->liste_type_contact($source, $order); if (is_object($object) && method_exists($object, 'liste_type_contact'))
print '<select class="flat" name="'.$htmlname.'" id="'.$htmlname.'">';
if ($showempty) print '<option value="0"></option>';
foreach($lesTypes as $key=>$value)
{ {
print '<option value="'.$key.'"'; $lesTypes = $object->liste_type_contact($source, $order);
if ($key == $selected) print '<select class="flat" name="'.$htmlname.'" id="'.$htmlname.'">';
print ' selected'; if ($showempty) print '<option value="0"></option>';
print '>'.$value.'</option>'; foreach($lesTypes as $key=>$value)
{
print '<option value="'.$key.'"';
if ($key == $selected)
print ' selected';
print '>'.$value.'</option>';
}
print "</select>\n";
} }
print "</select>\n";
} }
/** /**