Skip to content
Snippets Groups Projects
Commit fd4a1985 authored by Regis Houssin's avatar Regis Houssin
Browse files

Fix: preview image not show with multicompany product sharing

parent 1fd9f5e1
No related branches found
No related tags found
No related merge requests found
...@@ -76,7 +76,7 @@ class FormFile ...@@ -76,7 +76,7 @@ class FormFile
global $conf,$langs, $hookmanager; global $conf,$langs, $hookmanager;
$hookmanager->initHooks(array('formfile')); $hookmanager->initHooks(array('formfile'));
if (! empty($conf->browser->layout) && $conf->browser->layout != 'classic') $useajax=0; if (! empty($conf->browser->layout) && $conf->browser->layout != 'classic') $useajax=0;
if ((! empty($conf->global->MAIN_USE_JQUERY_FILEUPLOAD) && $useajax) || ($useajax==2)) if ((! empty($conf->global->MAIN_USE_JQUERY_FILEUPLOAD) && $useajax) || ($useajax==2))
...@@ -276,7 +276,7 @@ class FormFile ...@@ -276,7 +276,7 @@ class FormFile
if (0 !== $iconPDF) { if (0 !== $iconPDF) {
dol_syslog(__METHOD__ . ": passing iconPDF parameter is deprecated", LOG_WARNING); dol_syslog(__METHOD__ . ": passing iconPDF parameter is deprecated", LOG_WARNING);
} }
global $langs, $conf, $user, $hookmanager; global $langs, $conf, $user, $hookmanager;
global $form, $bc; global $form, $bc;
...@@ -288,7 +288,7 @@ class FormFile ...@@ -288,7 +288,7 @@ class FormFile
if (! empty($iconPDF)) { if (! empty($iconPDF)) {
return $this->getDocumentsLink($modulepart, $modulesubdir, $filedir); return $this->getDocumentsLink($modulepart, $modulesubdir, $filedir);
} }
$printer=0; $printer=0;
if (in_array($modulepart,array('facture','supplier_proposal','propal','proposal','order','commande','expedition', 'commande_fournisseur'))) // The direct print feature is implemented only for such elements if (in_array($modulepart,array('facture','supplier_proposal','propal','proposal','order','commande','expedition', 'commande_fournisseur'))) // The direct print feature is implemented only for such elements
{ {
...@@ -506,7 +506,7 @@ class FormFile ...@@ -506,7 +506,7 @@ class FormFile
$addcolumforpicto=($delallowed || $printer || $morepicto); $addcolumforpicto=($delallowed || $printer || $morepicto);
$out.= '<th align="center" colspan="'.(3+($addcolumforpicto?'2':'1')).'" class="formdoc liste_titre maxwidthonsmartphone">'; $out.= '<th align="center" colspan="'.(3+($addcolumforpicto?'2':'1')).'" class="formdoc liste_titre maxwidthonsmartphone">';
// Model // Model
if (! empty($modellist)) if (! empty($modellist))
{ {
...@@ -863,8 +863,8 @@ class FormFile ...@@ -863,8 +863,8 @@ class FormFile
$minifile=getImageFileNameForSize($file['name'], '_mini'); // For new thumbs using same ext (in lower case howerver) than original $minifile=getImageFileNameForSize($file['name'], '_mini'); // For new thumbs using same ext (in lower case howerver) than original
if (! dol_is_file($file['path'].'/'.$minifile)) $minifile=getImageFileNameForSize($file['name'], '_mini', '.png'); // For backward compatibility of old thumbs that were created with filename in lower case and with .png extension if (! dol_is_file($file['path'].'/'.$minifile)) $minifile=getImageFileNameForSize($file['name'], '_mini', '.png'); // For backward compatibility of old thumbs that were created with filename in lower case and with .png extension
//print $file['path'].'/'.$minifile.'<br>'; //print $file['path'].'/'.$minifile.'<br>';
print '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&file='.urlencode($relativepath.$fileinfo['filename'].'.'.strtolower($fileinfo['extension'])).'" class="aphoto" target="_blank">'; print '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.(!empty($object->entity)?$object->entity:$conf->entity).'&file='.urlencode($relativepath.$fileinfo['filename'].'.'.strtolower($fileinfo['extension'])).'" class="aphoto" target="_blank">';
print '<img border="0" height="'.$maxheightmini.'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&file='.urlencode($relativepath.$minifile).'" title="">'; print '<img border="0" height="'.$maxheightmini.'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.(!empty($object->entity)?$object->entity:$conf->entity).'&file='.urlencode($relativepath.$minifile).'" title="">';
print '</a>'; print '</a>';
} }
else print '&nbsp;'; else print '&nbsp;';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment