Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
gdesnoues opened this issue Mar 6, 2024 · 2 comments · Fixed by #28780
Closed

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

gdesnoues opened this issue Mar 6, 2024 · 2 comments · Fixed by #28780
Labels
Feature request This is a feature request

Comments

@gdesnoues
Copy link
Contributor

gdesnoues commented Mar 6, 2024

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

@gdesnoues gdesnoues added the Feature request This is a feature request label Mar 6, 2024
@JonBendtsen
Copy link
Contributor

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
Copy link
Contributor

@gdesnoues

gdesnoues added a commit to gdesnoues/dolibarr that referenced this issue Mar 12, 2024
When you set FCKEDITOR_ENABLE_DETAILS_FULL to 1 you can add pictures in description proposal with the WYSIWYG bar.
Add preg_replace() to show this pictures in the PDF
eldy added a commit that referenced this issue Mar 12, 2024
show image in a line description of a proposal PDF #28670
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature request This is a feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants