diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php
index 85c6e815642..32a4e9d25ec 100644
--- a/htdocs/user/fiche.php
+++ b/htdocs/user/fiche.php
@@ -1300,19 +1300,23 @@ else
}
// Multicompany
- if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity)
+ // TODO This should be done with hook formObjectOption
+ if (is_object($mc))
{
- print '
| '.$langs->trans("Entity").' | ';
- if ($object->admin && ! $object->entity)
- {
- print $langs->trans("AllEntities");
- }
- else
- {
- $mc->getInfo($object->entity);
- print $mc->label;
- }
- print " |
\n";
+ if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity)
+ {
+ print '| '.$langs->trans("Entity").' | ';
+ if ($object->admin && ! $object->entity)
+ {
+ print $langs->trans("AllEntities");
+ }
+ else
+ {
+ $mc->getInfo($object->entity);
+ print $mc->label;
+ }
+ print " |
\n";
+ }
}
// Other attributes
diff --git a/htdocs/user/home.php b/htdocs/user/home.php
index 3f43e40e43a..28eade2859f 100644
--- a/htdocs/user/home.php
+++ b/htdocs/user/home.php
@@ -148,26 +148,30 @@ if ($resql)
$companystatic->canvas=$obj->canvas;
print $companystatic->getNomUrl(1);
}
- else if (! empty($conf->multicompany->enabled))
- {
- if ($obj->admin && ! $obj->entity)
- {
- print $langs->trans("AllEntities");
- }
- else
- {
- $mc->getInfo($obj->entity);
- print $mc->label;
- }
- }
- else if ($obj->ldap_sid)
- {
- print $langs->trans("DomainUser");
- }
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)
+ {
+ print ' ('.$langs->trans("AllEntities").')';
+ }
+ else
+ {
+ $mc->getInfo($obj->entity);
+ print ' ('.$mc->label.')';
+ }
+ }
+ }
print '';
print ''.dol_print_date($db->jdate($obj->datec),'dayhour').' | ';
print '';
|