2
0
forked from Wavyzz/dolibarr

FIX missing quick edit for extrafields

This commit is contained in:
Regis Houssin
2025-01-29 19:44:50 +01:00
parent 5b2da39fa5
commit 4fc66c6ee1
2 changed files with 27 additions and 0 deletions

View File

@@ -159,6 +159,9 @@ if (empty($reshook) && !empty($object->table_element) && isset($extrafields->att
if ($object->element == 'product') {
$keyforperm = 'produit';
}
if ($object->element == 'project') {
$keyforperm = 'projet';
}
if (isset($user->rights->$keyforperm)) {
$permok = $user->hasRight($keyforperm, 'creer') || $user->hasRight($keyforperm, 'create') || $user->hasRight($keyforperm, 'write');
}

View File

@@ -553,6 +553,30 @@ if (empty($reshook)) {
}
}
// Quick edit for extrafields
if ($action == 'update_extras' && $permissiontoadd) {
$object->oldcopy = dol_clone($object, 2);
// Fill array 'array_options' with data from update form
$ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml'));
if ($ret < 0) {
$error++;
}
if (!$error) {
// Actions on extra fields
$result = $object->insertExtraFields('PROJECT_MODIFY');
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
$error++;
}
}
if ($error) {
$action = 'edit_extras';
}
}
// Actions to send emails
$triggersendname = 'PROJECT_SENTBYMAIL';
$paramname = 'id';