diff --git a/htdocs/user/card.php b/htdocs/user/card.php index a2938a89712..eeb1e898736 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1010,21 +1010,6 @@ if ($action == 'create' || $action == 'adduserldap') } print ''; - // Multicompany - if (! empty($conf->multicompany->enabled) && is_object($mc)) - { - if (empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && ! $user->entity) - { - print "".''.$langs->trans("Entity").''; - print "".$mc->select_entities($conf->entity); - print "\n"; - } - else - { - print ''; - } - } - // Accountancy code if ($conf->accounting->enabled) { @@ -1109,6 +1094,24 @@ if ($action == 'create' || $action == 'adduserldap') print ""; } + // Multicompany + // This is now done with hook formObjectOptions + /* + if (! empty($conf->multicompany->enabled) && is_object($mc)) + { + if (empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && ! $user->entity) // condition must be same for create and edit mode + { + print "".''.$langs->trans("Entity").''; + print "".$mc->select_entities($conf->entity); + print "\n"; + } + else + { + print ''; + } + } + */ + // Other attributes $parameters=array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"'); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook @@ -1498,6 +1501,24 @@ else print ''.dol_print_date($object->datepreviouslogin,"dayhour").''; print "\n"; + // Multicompany + // This is now done with hook formObjectOptions (included into /core/tpl/extrafields_view.tpl.php) + /* + if (! empty($conf->multicompany->enabled) && is_object($mc)) + { + if (! empty($conf->multicompany->enabled) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && ! $user->entity) + { + print '' . $langs->trans("Entity") . ''; + if (empty($object->entity)) { + print $langs->trans("AllEntities"); + } else { + $mc->getInfo($object->entity); + print $mc->label; + } + print "\n"; + } + }*/ + // Other attributes include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; @@ -2392,6 +2413,25 @@ else print "\n"; } + // Multicompany + // This is now done with hook formObjectOptions + /* + // TODO check if user not linked with the current entity before change entity (thirdparty, invoice, etc.) !! + if (! empty($conf->multicompany->enabled) && is_object($mc)) + { + if (empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity) + { + print "".''.$langs->trans("Entity").''; + print "".$mc->select_entities($object->entity, 'entity', '', 0, 1); // last parameter 1 means, show also a choice 0=>'all entities' + print "\n"; + } + else + { + print ''; + } + } + */ + // Other attributes $parameters=array('colspan' => ' colspan="2"'); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook