To add the 'Linked File' feature to permissions and to generate a PDF output

Hello,

“I’m very new to using Dolibarr. I want to add the ‘Linked File’ feature shown in the image below to the permissions module. I want someone with permissions to be able to get a PDF output of this. How can I do this easily?”

You want a PDF output that shows a list of all the linked files?

No, I think you want something else. I can not see the URLs of the page you want it added on, that would be nice to have too, because it reveals which file to edit.

Hello Sir,

I want to generate a holiday leave form in PDF format.

Sample.


aha, I see, makes more sense now. Don’t restrict it to only holiday leave, think of maternity leave too + possibly other kinds of leaves.

“Yes, I think so too. However, I don’t know how to do it.”

  1. IF you use your dolibarr in a production setting, then you need to do an additional installation of dolibarr that you can use purely for development. Select the newest version possible.

  2. create a github account

  3. Fork this project GitHub - Dolibarr/dolibarr: Dolibarr ERP CRM is a modern software package to manage your company or foundation's activity (contacts, suppliers, invoices, orders, stocks, agenda, accounting, ...). it's an open source Web application (written in PHP) designed for businesses of any sizes, foundations and freelancers.

  4. then clone your forked project to your own harddisk and create a new branch

  5. you probably need to change files under this directory dolibarr/htdocs/holiday

  6. when you have made changes to a file(s), then copy only those files into your development dolibarr installation and start testing it.

  7. when you have a well working solution then commit the changes to your new git branch, push it to your forked github repo and from there create a merge request to get it back into Dolibarr. Then you need to wait until it is merged into dolibarr and then wait more until a new version - with your changes - are released and then you can install that into production.

As for HOW to change the files and implement it. Look at what public functions are available in this file dolibarr/htdocs/holiday/class/holiday.class.php - which you then compare with other class files of dolibarr modules that does have the needed PDF functionality. You can - and should - copy a lot of the needed functionality from other dolibarr files to preserve the same look’n’feel as well as code style.