You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Dolibarr plugin can create extrafields. Sometime, these extrafields are then required for the module to work.
But any admin can modify the extrafield definition, or event accidentally delete the field (and lose all data!).
It would be very nice to have a way to prevent extrafields modification/deletion.
Use case
Plugins that need extrafields that can't be modified/deleted.
Suggested implementation
For example, an argument for the addExtrafield method, that says that this extrafield can't be edited in the front-end.
So the module can create the extrafield on init. Eventually delete the extrafield on module->remove (or call updateExtrafield to make it editable).
Suggested steps
add a column on llx_extrafields table (for example def_editable)
add an argument on methods addExtrafield and updateExtrafield to change this new column value
admin_extrafields_view.tpl.php: remove delete and edit button if this flag is on
admin_extrafields_edit.tpl : check the flag to prevent the edition
actions_extrafields.inc.php : check this flag to prevent edition and deletion
modMyModule.class.php : update addExtrafields examples in init method. In remove method, add an example of updating the extrafield to set def_editable to false, and an example with deleteExtrafield
I think that's all.
The text was updated successfully, but these errors were encountered:
Feature Request
A Dolibarr plugin can create extrafields. Sometime, these extrafields are then required for the module to work.
But any admin can modify the extrafield definition, or event accidentally delete the field (and lose all data!).
It would be very nice to have a way to prevent extrafields modification/deletion.
Use case
Plugins that need extrafields that can't be modified/deleted.
Suggested implementation
For example, an argument for the addExtrafield method, that says that this extrafield can't be edited in the front-end.
So the module can create the extrafield on init. Eventually delete the extrafield on module->remove (or call updateExtrafield to make it editable).
Suggested steps
I think that's all.
The text was updated successfully, but these errors were encountered: