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.
https://www.dolibarr.org
GNU General Public License v3.0
5.47k stars 2.8k forks source link

show image in a line description of a proposal PDF #28670

Closed gdesnoues closed 8 months ago

gdesnoues commented 8 months ago

Feature Request

/!\ I don't speak about showing a article picture in a picture column, I know that is possible with the Setup > PDF > Other > Add column for picture on proposal lines

When you set FCKEDITOR_ENABLE_DETAILS_FULL to 1 you can add images with the WYSIWYG bar. But, in a proposal, a local picture select by the buton "Browse Server" is not show in the PDF (he is visible in the description in the web page but not in the azur PDF). the URL of the picture show in the "Image Properties" popup is /dolibarr/viewimage.php?modulepart=medias&entity=1&file=image/mypicture.jpg if I put a full URL of a external picture (from an other website) it's OK in de webpage AND in the PDF

Use case

No response

Suggested implementation

it is possible by adding this line : $labelproductservice = preg_replace('/(<img[^>]*src=")[^\"]*viewimage\.php[^\"]*modulepart=medias[^\"]*file=([^\"]*)/', '\1file:/'.DOL_DATA_ROOT.'/medias/\2\3', $labelproductservice, -1, $nbrep); after the line : $labelproductservice = preg_replace('/(<img[^>]*src=")([^"]*)(&amp;)([^"]*")/', '\1\2&\4', $labelproductservice, -1, $nbrep); in the function pdf_writelinedesc() in the file htdocs\core\lib\pdf.lib.php

can you implement it in a future version ?

Suggested steps

No response

JonBendtsen commented 8 months ago

If you already know of the code that fixes this and you have tested it in your own dolibarr installation, then I would suggest that you edit right here using the pencil icon https://github.com/Dolibarr/dolibarr/blob/develop/htdocs/core/lib/pdf.lib.php - after that you commit and mention #28670 in both commit and in the Merge Request.

JonBendtsen commented 8 months ago

@gdesnoues