How to provide only PDF files during online sign of Proposals, Orders, Invoices etc

Hi @eldy, @ksar, all,

Environment : Dolibarr v 16.0.0 / Linux / MySQL

Can you kindly help on the know-how to provide only PDF version of generated files for Proposals, Invoices, and Purchase orders since providing editable .ODF file may not be safe business practice.

For example:

https://dolibarr_url/public/onlinesign/newonlinesign.php?source=proposal&ref=XXXXX&securekey=Hashp of the file&entity=multi-company id

downloads the editable ODT file and not the PDF file to the external customer.

I hv checked the file and understand the ecm->share is being used to hashp and the object $ecm in commonobject.class.php relies only on last_main_doc which is an ODT file.

Interestingly, the table llx_ecm_files contains share for only the .ODT file and Null for the .PDF files.

Can you please help how to allow to download only the .PDF version of Proposals, Orders and Invoices to external people and NOT the editable .ODT versions…

Thanks and regards,
yesbee

Hello,

You need to activate ODT_TO_PDF

Dear @ksar, @eldy, all,

Thank you for the reply. In fact, my server already has the ODT_TO_PDF details on other setup and Libre office is already installed on the server.

The issue is as below:

Request to kindly guide please.

thanks and regards,
yesbee

Hello,

Not possible for now.
This would require a dedicated module or core change.

Hi @ksar, @eldy, all,

Quick work around is to touch /htdocs/document.php file and make the following changes:

This works fine for me in 16.0.0. If any one found any where else to be changed, please let me know. I am sure you don’t like to give a quotation that can be editable by customer !

Thanks and Regards,
yesbee.

Hello,

Ok, but you modify the core file, meaning that your modification will be erased at each new version you will put…

I think, the best it’s to try to modify the /public/page where you have the download link, either by a module or proposing a core change on GITHUB.

Dear @ksar,

Yes, first I was thinking about modifying the download link option. But I didnt want to change the versatile architecture for security in dolibarr using hashp to get the file. PDF files donot have hashp in the db,

Also, can you please guide me how to propose a core change on Github.

By the way, @eldy and the best minds of dolibarr project requested to check the possibility of creating a system that checks for customizations directory/htdocs//customized file.php and execute it if present or execute the core default…

thanks and regards,
yesbee.

The PDF file can have a hashp into the db.
For the moment this is possible and done automatically if a hidden option that allow sharing of PDF is set (so still in dev). By default no sharing is done.
To suggest core change, if less than 100 lines of code, just send a PR with core change.
If more, may be you can create a issue to let the community give feedback of what you want to do to avoid to waste your dev time.

Sure, thanks @eldy.

regards,
yesbee