forked from Wavyzz/dolibarr
FIX missing quick edit for extrafields
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user