Fix| Header title in user card

This commit is contained in:
NextGestion 2023-05-13 10:54:41 +01:00
parent b184e34611
commit 46eb222407

View file

@ -772,7 +772,19 @@ if (isModEnabled('stock')) {
$formproduct = new FormProduct($db);
}
if ($object->id > 0) {
if (GETPOSTINT('id') > 0) {
$res = $object->fetch($id, '', '', 1);
if ($res < 0) {
dol_print_error($db, $object->error);
exit;
}
if ($res == 0) {
$langs->load("errors");
print($langs->trans('ErrorRecordNotFound'));
exit;
}
$person_name = !empty($object->firstname) ? $object->lastname.", ".$object->firstname : $object->lastname;
$title = $person_name." - ".$langs->trans('Card');
} else {
@ -1380,12 +1392,7 @@ if ($action == 'create' || $action == 'adduserldap') {
print "</form>";
} else {
// View and edit mode
if ($id > 0) {
$res = $object->fetch($id, '', '', 1);
if ($res < 0) {
dol_print_error($db, $object->error);
exit;
}
if ($object->id > 0) {
$res = $object->fetch_optionals();
// Check if user has rights