diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index b095712d972..6df0e2f006d 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -7154,20 +7154,20 @@ abstract class CommonObject
$dir = $sdir.'/';
$pdir = '/';
- $dir .= get_exdir(0, 0, 0, 0, $this, $modulepart).$this->ref.'/';
- $pdir .= get_exdir(0, 0, 0, 0, $this, $modulepart).$this->ref.'/';
+ $dir .= get_exdir(0, 0, 0, 0, $this, $modulepart);
+ $pdir .= get_exdir(0, 0, 0, 0, $this, $modulepart);
// For backward compatibility
- if ($modulepart == 'product' && !empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO))
- {
- $dir = $sdir.'/'.get_exdir($this->id, 2, 0, 0, $this, $modulepart).$this->id."/photos/";
- $pdir = '/'.get_exdir($this->id, 2, 0, 0, $this, $modulepart).$this->id."/photos/";
+ if ($modulepart == 'product') {
+ if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) {
+ $dir = $sdir.'/'.get_exdir($this->id, 2, 0, 0, $this, $modulepart).$this->id."/photos/";
+ $pdir = '/'.get_exdir($this->id, 2, 0, 0, $this, $modulepart).$this->id."/photos/";
+ }
}
// Defined relative dir to DOL_DATA_ROOT
$relativedir = '';
- if ($dir)
- {
+ if ($dir) {
$relativedir = preg_replace('/^'.preg_quote(DOL_DATA_ROOT, '/').'/', '', $dir);
$relativedir = preg_replace('/^[\\/]/', '', $relativedir);
$relativedir = preg_replace('/[\\/]$/', '', $relativedir);
@@ -7189,23 +7189,19 @@ abstract class CommonObject
completeFileArrayWithDatabaseInfo($filearray, $relativedir);
- if (count($filearray))
- {
- if ($sortfield && $sortorder)
- {
+ if (count($filearray)) {
+ if ($sortfield && $sortorder) {
$filearray = dol_sort_array($filearray, $sortfield, $sortorder);
}
- foreach ($filearray as $key => $val)
- {
+ foreach ($filearray as $key => $val) {
$photo = '';
$file = $val['name'];
//if (! utf8_check($file)) $file=utf8_encode($file); // To be sure file is stored in UTF8 in memory
//if (dol_is_file($dir.$file) && image_format_supported($file) >= 0)
- if (image_format_supported($file) >= 0)
- {
+ if (image_format_supported($file) >= 0) {
$nbphoto++;
$photo = $file;
$viewfilename = $file;
@@ -7242,12 +7238,9 @@ abstract class CommonObject
$alt .= ' - '.$langs->transnoentitiesnoconv('Size').': '.$imgarray['width'].'x'.$imgarray['height'];
if ($notitle) $alt = '';
- if ($usesharelink)
- {
- if ($val['share'])
- {
- if (empty($maxHeight) || $photo_vignette && $imgarray['height'] > $maxHeight)
- {
+ if ($usesharelink) {
+ if ($val['share']) {
+ if (empty($maxHeight) || $photo_vignette && $imgarray['height'] > $maxHeight) {
$return .= '';
$return .= '';
} else {
@@ -7259,10 +7252,9 @@ abstract class CommonObject
$return .= '
';
}
} else {
- if (empty($maxHeight) || $photo_vignette && $imgarray['height'] > $maxHeight)
- {
+ if (empty($maxHeight) || $photo_vignette && $imgarray['height'] > $maxHeight) {
$return .= '';
- $return .= '';
+ $return .= '
';
} else {
$return .= '';
$return .= '
';
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index 437cef27afc..6836b70fe2d 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -1254,7 +1254,7 @@ class FormFile
} else {
print '';
}
- print '
';
+ print '
';
print '';
} else print ' ';
print '';
@@ -1779,7 +1779,7 @@ class FormFile
print ''."\n";
// Show list of associated links
- print load_fiche_titre($langs->trans("LinkedFiles"), '', 'external-link-square-alt', 0, '', 'table-list-of-links');
+ print load_fiche_titre($langs->trans("LinkedFiles"), '', 'link', 0, '', 'table-list-of-links');
print '