Fix update default contact type
This commit is contained in:
parent
93ca27d808
commit
7e8d06e8b8
@ -400,9 +400,7 @@ if (empty($reshook))
|
|||||||
$object->note_public = (string) GETPOST("note_public", 'restricthtml');
|
$object->note_public = (string) GETPOST("note_public", 'restricthtml');
|
||||||
$object->note_private = (string) GETPOST("note_private", 'restricthtml');
|
$object->note_private = (string) GETPOST("note_private", 'restricthtml');
|
||||||
|
|
||||||
if (GETPOSTISSET("roles")) {
|
$object->roles = GETPOST("roles", 'array'); // Note GETPOSTISSET("role") is null when combo is empty
|
||||||
$object->roles = GETPOST("roles", 'array');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fill array 'array_options' with data from add form
|
// Fill array 'array_options' with data from add form
|
||||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||||
|
|||||||
@ -1747,14 +1747,14 @@ class Contact extends CommonObject
|
|||||||
if (count($this->roles) > 0) {
|
if (count($this->roles) > 0) {
|
||||||
foreach ($this->roles as $keyRoles => $valRoles) {
|
foreach ($this->roles as $keyRoles => $valRoles) {
|
||||||
$idrole = 0;
|
$idrole = 0;
|
||||||
if (is_array($idrole)) {
|
if (is_array($valRoles)) {
|
||||||
$idrole = $valRoles['id'];
|
$idrole = $valRoles['id'];
|
||||||
} else {
|
} else {
|
||||||
$idrole = $valRoles;
|
$idrole = $valRoles;
|
||||||
}
|
}
|
||||||
|
|
||||||
$socid = 0;
|
$socid = 0;
|
||||||
if (is_array($idrole)) {
|
if (is_array($valRoles)) {
|
||||||
$socid = $valRoles['socid'];
|
$socid = $valRoles['socid'];
|
||||||
} else {
|
} else {
|
||||||
$socid = $this->socid;
|
$socid = $this->socid;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user