Code cleaner when we are using multicompany
This commit is contained in:
parent
c25872b182
commit
d944c3bf17
@ -78,7 +78,27 @@ foreach($fulltree as $key => $val)
|
|||||||
$userstatic->firstname=$val['firstname'];
|
$userstatic->firstname=$val['firstname'];
|
||||||
$userstatic->lastname=$val['lastname'];
|
$userstatic->lastname=$val['lastname'];
|
||||||
$userstatic->statut=$val['statut'];
|
$userstatic->statut=$val['statut'];
|
||||||
$li=$userstatic->getNomUrl(1,'').' ('.$val['login'].(empty($conf->multicompany->enabled)?'':' - '.$langs->trans("Instance").' '.$val['entity']).')';
|
|
||||||
|
$entity=$val['entity'];
|
||||||
|
$entitystring='';
|
||||||
|
// TODO Set of entitystring should be done with a hook
|
||||||
|
if (is_object($mc))
|
||||||
|
{
|
||||||
|
if (! empty($conf->multicompany->enabled))
|
||||||
|
{
|
||||||
|
if (empty($entity))
|
||||||
|
{
|
||||||
|
$entitystring=$langs->trans("AllEntities");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$mc->getInfo($entity);
|
||||||
|
$entitystring=$mc->label;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$li=$userstatic->getNomUrl(1,'').' ('.$val['login'].($entitystring?' - '.$entitystring:'').')';
|
||||||
|
|
||||||
$data[] = array(
|
$data[] = array(
|
||||||
'rowid'=>$val['rowid'],
|
'rowid'=>$val['rowid'],
|
||||||
|
|||||||
@ -176,22 +176,27 @@ if ($resql)
|
|||||||
{
|
{
|
||||||
print ' ('.$langs->trans("DomainUser").')';
|
print ' ('.$langs->trans("DomainUser").')';
|
||||||
}
|
}
|
||||||
// TODO This should be done with a hook
|
|
||||||
|
$entity=$obj->entity;
|
||||||
|
$entitystring='';
|
||||||
|
// TODO Set of entitystring should be done with a hook
|
||||||
if (is_object($mc))
|
if (is_object($mc))
|
||||||
{
|
{
|
||||||
if (! empty($conf->multicompany->enabled))
|
if (! empty($conf->multicompany->enabled))
|
||||||
{
|
{
|
||||||
if (empty($obj->entity))
|
if (empty($entity))
|
||||||
{
|
{
|
||||||
print ' ('.$langs->trans("AllEntities").')';
|
$entitystring=$langs->trans("AllEntities");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$mc->getInfo($obj->entity);
|
$mc->getInfo($entity);
|
||||||
print ' ('.$mc->label.')';
|
$entitystring=$mc->label;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
print ($entitystring?' ('.$entitystring.')':'');
|
||||||
|
|
||||||
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>';
|
||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user