diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 9f56fe507bb..6974daabc00 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -5304,7 +5304,7 @@ class Form
$entity = (! empty($object->entity) ? $object->entity : $conf->entity);
$id = (! empty($object->id) ? $object->id : $object->rowid);
- $ret='';$dir='';$file='';$altfile='';$email='';
+ $ret='';$dir='';$file='';$originalfile='';$altfile='';$email='';
if ($modulepart=='societe')
{
@@ -5313,9 +5313,11 @@ class Form
$smallfile=preg_replace('/(\.png|\.gif|\.jpg|\.jpeg|\.bmp)/i','_small\\1',$smallfile);
if (! empty($object->logo))
{
+ // TODO Introduce get_exdir
if ((string) $imagesize == 'mini') $file=$id.'/logos/thumbs/'.getImageFileNameForSize($object->logo, '_mini');
else if ((string) $imagesize == 'small') $file=$id.'/logos/thumbs/'.getImageFileNameForSize($object->logo, '_small');
else $file=$id.'/logos/thumbs/'.$smallfile;
+ $originalfile=$id.'/logos/thumbs/'.$smallfile;
}
}
else if ($modulepart=='contact')
@@ -5323,9 +5325,11 @@ class Form
$dir=$conf->societe->multidir_output[$entity].'/contact';
if (! empty($object->photo))
{
+ // TODO Introduce get_exdir
if ((string) $imagesize == 'mini') $file=$id.'/photos/thumbs/'.getImageFileNameForSize($object->photo, '_mini');
else if ((string) $imagesize == 'small') $file=$id.'/photos/thumbs/'.getImageFileNameForSize($object->photo, '_small');
else $file=$id.'/photos/'.$object->photo;
+ $originalfile=$id.'/photos/'.$object->photo;
}
}
else if ($modulepart=='userphoto')
@@ -5336,6 +5340,7 @@ class Form
if ((string) $imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_mini');
else if ((string) $imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_small');
else $file=get_exdir($id, 2, 0, 0, $object, 'user').$object->photo;
+ $originalfile=get_exdir($id, 2, 0, 0, $object, 'user').$object->photo;
}
if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility
$email=$object->email;
@@ -5348,6 +5353,7 @@ class Form
if ((string) $imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini');
else if ((string) $imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small');
else $file=get_exdir($id, 2, 0, 0, $object, 'member').'photos/'.$object->photo;
+ $originalfile=get_exdir($id, 2, 0, 0, $object, 'member').'photos/'.$object->photo;
}
if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility
$email=$object->email;
@@ -5360,6 +5366,7 @@ class Form
if ((string) $imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_mini');
else if ((string) $imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_small');
else $file=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.$object->photo;
+ $originalfile=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.$object->photo;
}
if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility
$email=$object->email;
@@ -5369,13 +5376,13 @@ class Form
{
if ($file && file_exists($dir."/".$file))
{
- if ($addlinktofullsize) $ret.='';
+ if ($addlinktofullsize) $ret.='';
$ret.='';
if ($addlinktofullsize) $ret.='';
}
else if ($altfile && file_exists($dir."/".$altfile))
{
- if ($addlinktofullsize) $ret.='';
+ if ($addlinktofullsize) $ret.='';
$ret.='
';
if ($addlinktofullsize) $ret.='';
}
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 4a94863e8c4..5685a2fbb92 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -892,7 +892,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
$showimage=$object->is_photo_available($conf->product->multidir_output[$object->entity]);
$maxvisiblephotos=(isset($conf->global->PRODUCT_MAX_VISIBLE_PHOTO)?$conf->global->PRODUCT_MAX_VISIBLE_PHOTO:5);
if ($conf->browser->phone) $maxvisiblephotos=1;
- if ($showimage) $morehtmlleft.='