Skip to content

Commit

Permalink
Fix: preview image not show with multicompany product sharing
Browse files Browse the repository at this point in the history
  • Loading branch information
hregis committed Jan 15, 2017
1 parent 1fd9f5e commit fd4a198
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions htdocs/core/class/html.formfile.class.php
Expand Up @@ -76,7 +76,7 @@ function form_attach_new_file($url, $title='', $addcancel=0, $sectionid=0, $perm
global $conf,$langs, $hookmanager;
$hookmanager->initHooks(array('formfile'));


if (! empty($conf->browser->layout) && $conf->browser->layout != 'classic') $useajax=0;

if ((! empty($conf->global->MAIN_USE_JQUERY_FILEUPLOAD) && $useajax) || ($useajax==2))
Expand Down Expand Up @@ -276,7 +276,7 @@ function showdocuments($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed
if (0 !== $iconPDF) {
dol_syslog(__METHOD__ . ": passing iconPDF parameter is deprecated", LOG_WARNING);
}

global $langs, $conf, $user, $hookmanager;
global $form, $bc;

Expand All @@ -288,7 +288,7 @@ function showdocuments($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed
if (! empty($iconPDF)) {
return $this->getDocumentsLink($modulepart, $modulesubdir, $filedir);
}

$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
{
Expand Down Expand Up @@ -506,7 +506,7 @@ function showdocuments($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed

$addcolumforpicto=($delallowed || $printer || $morepicto);
$out.= '<th align="center" colspan="'.(3+($addcolumforpicto?'2':'1')).'" class="formdoc liste_titre maxwidthonsmartphone">';

// Model
if (! empty($modellist))
{
Expand Down Expand Up @@ -863,8 +863,8 @@ function list_of_documents($filearray,$object,$modulepart,$param='',$forcedownlo
$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
//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 '<img border="0" height="'.$maxheightmini.'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&file='.urlencode($relativepath.$minifile).'" title="">';
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.'&entity='.(!empty($object->entity)?$object->entity:$conf->entity).'&file='.urlencode($relativepath.$minifile).'" title="">';
print '</a>';
}
else print '&nbsp;';
Expand Down

0 comments on commit fd4a198

Please sign in to comment.