This commit is contained in:
Laurent Destailleur 2020-09-07 10:34:44 +02:00
parent 7c1bcfe66a
commit c538dfb5b2
2 changed files with 4 additions and 10 deletions

View File

@ -624,13 +624,11 @@ class UserGroup extends CommonObject
global $user, $conf;
$this->datec = dol_now();
if (empty($this->nom) && !empty($this->name)) {
$this->nom = $this->name;
if (!empty($this->name)) {
$this->nom = $this->name; // Field for 'name' is called 'nom' in database
}
if (!isset($this->entity)) $this->entity = $conf->entity; // If not defined, we use default value
$entity = $this->entity;
if (!empty($conf->multicompany->enabled) && $conf->entity == 1) $entity = $this->entity;
return $this->createCommon($user, $notrigger);
}
@ -645,10 +643,8 @@ class UserGroup extends CommonObject
{
global $user, $conf;
$entity = $conf->entity;
if (!empty($conf->multicompany->enabled) && $conf->entity == 1)
{
$entity = $this->entity;
if (!empty($this->name)) {
$this->nom = $this->name; // Field for 'name' is called 'nom' in database
}
return $this->updateCommon($user, $notrigger);

View File

@ -130,7 +130,6 @@ if (empty($reshook)) {
$action = "create"; // Go back to create page
} else {
$object->name = GETPOST("nom", 'nohtml');
//$object->nom = $object->name; // For backward compatibility
$object->note = dol_htmlcleanlastbr(trim(GETPOST("note", 'none')));
// Fill array 'array_options' with data from add form
@ -205,7 +204,6 @@ if (empty($reshook)) {
$object->oldcopy = clone $object;
$object->name = GETPOST("nom", 'nohtml');
//$object->nom = $object->name; // For backward compatibility
$object->note = dol_htmlcleanlastbr(trim(GETPOST("note", 'none')));
// Fill array 'array_options' with data from add form