Merge pull request #20457 from marc-dll/13.0_FIX_contact_single_extrafields_edit
FIX: contact card: single extrafield update failed
This commit is contained in:
commit
44ec8dd2b6
@ -479,6 +479,29 @@ if (empty($reshook))
|
|||||||
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
|
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update extrafields
|
||||||
|
if ($action == 'update_extras' && ! empty($user->rights->societe->contact->creer)) {
|
||||||
|
$object->oldcopy = dol_clone($object);
|
||||||
|
|
||||||
|
// Fill array 'array_options' with data from update form
|
||||||
|
$ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml'));
|
||||||
|
if ($ret < 0) {
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$error) {
|
||||||
|
$result = $object->insertExtraFields('CONTACT_MODIFY');
|
||||||
|
if ($result < 0) {
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($error) {
|
||||||
|
$action = 'edit_extras';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Actions to send emails
|
// Actions to send emails
|
||||||
$triggersendname = 'CONTACT_SENTBYMAIL';
|
$triggersendname = 'CONTACT_SENTBYMAIL';
|
||||||
$paramname = 'id';
|
$paramname = 'id';
|
||||||
|
|||||||
@ -150,6 +150,9 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element]
|
|||||||
if ($object->element == 'productlot') $permok = $user->rights->stock->creer;
|
if ($object->element == 'productlot') $permok = $user->rights->stock->creer;
|
||||||
if ($object->element == 'facturerec') $permok = $user->rights->facture->creer;
|
if ($object->element == 'facturerec') $permok = $user->rights->facture->creer;
|
||||||
if ($object->element == 'mo') $permok = $user->rights->mrp->write;
|
if ($object->element == 'mo') $permok = $user->rights->mrp->write;
|
||||||
|
if ($object->element == 'contact') {
|
||||||
|
$permok = $user->rights->societe->contact->creer;
|
||||||
|
}
|
||||||
|
|
||||||
$isdraft = ((isset($object->statut) && $object->statut == 0) || (isset($object->status) && $object->status == 0));
|
$isdraft = ((isset($object->statut) && $object->statut == 0) || (isset($object->status) && $object->status == 0));
|
||||||
if (($isdraft || !empty($extrafields->attributes[$object->table_element]['alwayseditable'][$tmpkeyextra]))
|
if (($isdraft || !empty($extrafields->attributes[$object->table_element]['alwayseditable'][$tmpkeyextra]))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user