mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-05 17:18:13 +01:00
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') {
|
if ($object->element == 'product') {
|
||||||
$keyforperm = 'produit';
|
$keyforperm = 'produit';
|
||||||
}
|
}
|
||||||
|
if ($object->element == 'project') {
|
||||||
|
$keyforperm = 'projet';
|
||||||
|
}
|
||||||
if (isset($user->rights->$keyforperm)) {
|
if (isset($user->rights->$keyforperm)) {
|
||||||
$permok = $user->hasRight($keyforperm, 'creer') || $user->hasRight($keyforperm, 'create') || $user->hasRight($keyforperm, 'write');
|
$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
|
// Actions to send emails
|
||||||
$triggersendname = 'PROJECT_SENTBYMAIL';
|
$triggersendname = 'PROJECT_SENTBYMAIL';
|
||||||
$paramname = 'id';
|
$paramname = 'id';
|
||||||
|
|||||||
Reference in New Issue
Block a user