What is the best way to disable and modify fields?

I have seen similar questions in this forum. There were suggestions to use https://www.dolistore.com/en/modules/469-myField---personalization-of-fields-and-of-their-access.html. I am not sure if that module can do all the changes that I want to have, so I would like to explore my options.

For instance on the detail of a third-party, I would like to disable and change the fields highlighted below.

For the fields highlighted in green, I can disable them by setting their corresponding parameters to “-”, e.g. ProfId[1-6]=-, in htdocs/langs/en_US/companies.lang file. Or I can modify them by setting them to the values that I want.

However for the fields highlighted in red, I have to edit the file htdocs/societe/card.php. I basically just commented the codes relevant to those fields. The result is as below.

Especially for the fields highlighted in red, I don’t think that is the best way to cannibalise the code like that.

It looks like I cannot achieve that by setting them in the theme. Or can I do that?

Is the only best option to achieve that by using the module above or create my own module following the guide on https://wiki.dolibarr.org/index.php/Module_development?

Thanks a lot in advance for your advices.

Hi,

Search the code to see if you can use the HOOK system : https://wiki.dolibarr.org/index.php?title=Hooks_system#Implement_the_Hook

Thanks a lot @ksar for your suggestion.

It looks like the Hook system is trade off of Module development. But that will still take me some time to understand how it should work and implement the changes that I want to.

We are currently still evaluation and testing Dolibarr ERP. I think for this purpose, “cannibalising” the core codes would be the fastest solution. We will implement the proper solution later on based on our test results.