Fix problem of display photo in the model

Fix a problem with photo in the model :
Before : Check in the current entity the product's repertory to find a photo
Now : Check all entities product's repertories to find a photo
This commit is contained in:
Pierre Ardoin 2019-11-08 22:02:30 +01:00 committed by GitHub
parent 8f35c24b62
commit 88fb094a78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,6 +8,7 @@
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2017-2018 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2019 Pierre Ardoin <mapiolca@me.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -257,7 +258,13 @@ class pdf_azur extends ModelePDFPropales
{
if (! $arephoto)
{
$dir = $conf->product->dir_output.'/'.$midir;
if ($conf->product->entity != $objphoto->entity) {
$dir = $conf->product->multidir_output[$objphoto->entity].'/'.$midir; //Check repertories of current entities
}else{
$dir = $conf->product->dir_output.'/'.$midir; //Check repertory of the current product
}
foreach ($objphoto->liste_photos($dir, 1) as $key => $obj)
{