Fix: No error once multicompany module has been removed.

This commit is contained in:
Laurent Destailleur 2014-05-30 13:08:01 +02:00
parent efd9337c9f
commit 4a96fd0d77
2 changed files with 36 additions and 28 deletions

View File

@ -1300,6 +1300,9 @@ else
} }
// Multicompany // Multicompany
// TODO This should be done with hook formObjectOption
if (is_object($mc))
{
if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity) if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity)
{ {
print '<tr><td valign="top">'.$langs->trans("Entity").'</td><td width="75%" class="valeur">'; print '<tr><td valign="top">'.$langs->trans("Entity").'</td><td width="75%" class="valeur">';
@ -1314,6 +1317,7 @@ else
} }
print "</td></tr>\n"; print "</td></tr>\n";
} }
}
// Other attributes // Other attributes
$parameters=array('colspan' => ' colspan="2"'); $parameters=array('colspan' => ' colspan="2"');

View File

@ -148,25 +148,29 @@ if ($resql)
$companystatic->canvas=$obj->canvas; $companystatic->canvas=$obj->canvas;
print $companystatic->getNomUrl(1); print $companystatic->getNomUrl(1);
} }
else if (! empty($conf->multicompany->enabled)) else
{
print $langs->trans("InternalUser");
}
if ($obj->ldap_sid)
{
print ' ('.$langs->trans("DomainUser").')';
}
// TODO This should be done with a hook
if (is_object($mc))
{
if (! empty($conf->multicompany->enabled))
{ {
if ($obj->admin && ! $obj->entity) if ($obj->admin && ! $obj->entity)
{ {
print $langs->trans("AllEntities"); print ' ('.$langs->trans("AllEntities").')';
} }
else else
{ {
$mc->getInfo($obj->entity); $mc->getInfo($obj->entity);
print $mc->label; print ' ('.$mc->label.')';
} }
} }
else if ($obj->ldap_sid)
{
print $langs->trans("DomainUser");
}
else
{
print $langs->trans("InternalUser");
} }
print '</td>'; print '</td>';
print '<td align="right">'.dol_print_date($db->jdate($obj->datec),'dayhour').'</td>'; print '<td align="right">'.dol_print_date($db->jdate($obj->datec),'dayhour').'</td>';