Update card.php

This commit is contained in:
Laurent Destailleur 2021-05-17 07:08:45 +02:00 committed by GitHub
parent e5e317bae3
commit 7d0fa95d81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -138,7 +138,11 @@ if (empty($reshook)) {
if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
$object->entity = 0;
} else {
$object->entity = GETPOSTISSET("entity") ? GETPOST("entity") : $conf->entity;
if ($conf->entity == 1 && $user->admin && !$user->entity) { // Same permissions test than the one used to show the combo of entities into the form
$object->entity = GETPOSTISSET("entity") ? GETPOST("entity") : $conf->entity;
} else {
$object->entity = $conf->entity;
}
}
$db->begin();