|
@@ -391,7 +391,7 @@ class FormFile
|
|
|
|
|
|
// Add entity in $param if not already exists
|
|
|
if (!preg_match('/entity\=[0-9]+/', $param)) {
|
|
|
- $param .= ($param ? '&' : '').'entity='.(!empty($object->entity) ? $object->entity : $conf->entity);
|
|
|
+ $param .= ($param ? '&' : '').'entity='.(empty($object->entity) ? $conf->entity : $object->entity);
|
|
|
}
|
|
|
|
|
|
$printer = 0;
|
|
@@ -1401,7 +1401,7 @@ class FormFile
|
|
|
}
|
|
|
// Preview link
|
|
|
if (!$editline) {
|
|
|
- print $this->showPreview($file, $modulepart, $filepath, 0, '&entity='.(!empty($object->entity) ? $object->entity : $conf->entity));
|
|
|
+ print $this->showPreview($file, $modulepart, $filepath, 0, '&entity='.(empty($object->entity) ? $conf->entity : $object->entity));
|
|
|
}
|
|
|
|
|
|
print "</td>\n";
|
|
@@ -1435,14 +1435,14 @@ class FormFile
|
|
|
}
|
|
|
//print $file['path'].'/'.$smallfile.'<br>';
|
|
|
|
|
|
- $urlforhref = getAdvancedPreviewUrl($modulepart, $relativepath.$fileinfo['filename'].'.'.strtolower($fileinfo['extension']), 1, '&entity='.(!empty($object->entity) ? $object->entity : $conf->entity));
|
|
|
+ $urlforhref = getAdvancedPreviewUrl($modulepart, $relativepath.$fileinfo['filename'].'.'.strtolower($fileinfo['extension']), 1, '&entity='.(empty($object->entity) ? $conf->entity : $object->entity));
|
|
|
if (empty($urlforhref)) {
|
|
|
- $urlforhref = DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.(!empty($object->entity) ? $object->entity : $conf->entity).'&file='.urlencode($relativepath.$fileinfo['filename'].'.'.strtolower($fileinfo['extension']));
|
|
|
+ $urlforhref = DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.(empty($object->entity) ? $conf->entity : $object->entity).'&file='.urlencode($relativepath.$fileinfo['filename'].'.'.strtolower($fileinfo['extension']));
|
|
|
print '<a href="'.$urlforhref.'" class="aphoto" target="_blank" rel="noopener noreferrer">';
|
|
|
} else {
|
|
|
print '<a href="'.$urlforhref['url'].'" class="'.$urlforhref['css'].'" target="'.$urlforhref['target'].'" mime="'.$urlforhref['mime'].'">';
|
|
|
}
|
|
|
- print '<img class="photo maxwidth200 shadow valignmiddle" height="'.(($useinecm == 4 || $useinecm == 5 || $useinecm == 6) ? '20' : $maxheightmini).'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.(!empty($object->entity) ? $object->entity : $conf->entity).'&file='.urlencode($relativepath.$smallfile).'" title="">';
|
|
|
+ print '<img class="photo maxwidth200 shadow valignmiddle" height="'.(($useinecm == 4 || $useinecm == 5 || $useinecm == 6) ? '20' : $maxheightmini).'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.(empty($object->entity) ? $conf->entity : $object->entity).'&file='.urlencode($relativepath.$smallfile).'" title="">';
|
|
|
print '</a>';
|
|
|
} else {
|
|
|
print ' ';
|