diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 1cd5345c8d5..bcdcdea6147 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -5328,7 +5328,7 @@ class Form
{
$ret.='';
}
- $ret.='
'.$morehtmlright.'
';
+ if ($morehtmlright) $ret.=''.$morehtmlright.'
';
$ret.='';
return $ret;
@@ -5386,19 +5386,15 @@ class Form
$id = (! empty($object->id) ? $object->id : $object->rowid);
$ret='';$dir='';$file='';$originalfile='';$altfile='';$email='';
-
if ($modulepart=='societe')
{
$dir=$conf->societe->multidir_output[$entity];
- $smallfile=$object->logo;
- $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;
+ if ((string) $imagesize == 'mini') $file=get_exdir(0, 0, 0, 0, $object, 'thirdparty').'/logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs
+ else if ((string) $imagesize == 'small') $file=get_exdir(0, 0, 0, 0, $object, 'thirdparty').'/logos/'.getImageFileNameForSize($object->logo, '_small');
+ else $file=get_exdir(0, 0, 0, 0, $object, 'thirdparty').'/logos/'.$object->logo;
+ $originalfile=get_exdir(0, 0, 0, 0, $object, 'thirdparty').'/logos/'.$object->logo;
}
}
else if ($modulepart=='contact')
@@ -5406,11 +5402,10 @@ 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;
+ if ((string) $imagesize == 'mini') $file=get_exdir(0, 0, 0, 0, $object, 'contact').'/photos/'.getImageFileNameForSize($object->photo, '_mini');
+ else if ((string) $imagesize == 'small') $file=get_exdir(0, 0, 0, 0, $object, 'contact').'/photos/'.getImageFileNameForSize($object->photo, '_small');
+ else $file=get_exdir(0, 0, 0, 0, $object, 'contact').'/photos/'.$object->photo;
+ $originalfile=get_exdir(0, 0, 0, 0, $object, 'contact').'/photos/'.$object->photo;
}
}
else if ($modulepart=='userphoto')
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 82d5c52c575..fdb8b89f0f1 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -908,7 +908,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
}
else
{
- if ($showimage) $morehtmlleft.=''.$form->showphoto($modulepart,$object,0,0,0,'photoref','small',1,0,$maxvisiblephotos).'
';
+ if ($showimage) $morehtmlleft.=''.$form->showphoto($modulepart,$object,0,0,0,'photoref','small',1,0,$maxvisiblephotos).'
';
}
if ($showbarcode) $morehtmlleft.=''.$form->showbarcode($object).'
';
if ($object->element == 'societe' && ! empty($conf->use_javascript_ajax) && $user->rights->societe->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
@@ -3961,9 +3961,12 @@ function get_exdir($num,$level,$alpha,$withoutslash,$object,$modulepart)
else
{
// TODO
- // We will introduce here a common way of forging path for document storage
+ // We will enhance here a common way of forging path for document storage
// Here, object->id, object->ref and object->modulepart are required.
-
+ if (in_array($modulepart, array('thirdparty','contact')))
+ {
+ $path=$object->ref?$object->ref:$object->id;
+ }
}
if (empty($withoutslash) && ! empty($path)) $path.='/';
diff --git a/htdocs/product/card.php b/htdocs/product/card.php
index 9379e6d1f29..948f73b21ef 100644
--- a/htdocs/product/card.php
+++ b/htdocs/product/card.php
@@ -1315,7 +1315,7 @@ else
$picto=($object->type== Product::TYPE_SERVICE?'service':'product');
dol_fiche_head($head, 'card', $titre, 0, $picto);
- dol_banner_tab($object, 'id', '', ($user->societe_id?0:1), 'ref');
+ dol_banner_tab($object, 'ref', '', ($user->societe_id?0:1), 'ref');
print '';
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index 87c65367c93..1184a490495 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -1835,7 +1835,7 @@ class Societe extends CommonObject
{
$label.= '
';
//if (! is_object($form)) $form = new Form($db);
- $label.= Form::showphoto('societe', $this, 80);
+ $label.= Form::showphoto('societe', $this, 80, 0, 0, 'photowithmargin', 'mini');
$label.= '
';
}
$label.= '
';
diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php
index e2f40105c4a..5dd49a57266 100644
--- a/htdocs/theme/eldy/style.css.php
+++ b/htdocs/theme/eldy/style.css.php
@@ -662,6 +662,7 @@ div.statusref {
padding-right: 12px;
margin-top: 6px;
margin-bottom: 10px;
+ clear: both;
}
img.photoref {
border: 1px solid #CCC;
@@ -3650,7 +3651,7 @@ a span.select2-chosen
color: #fff !important;
}
span.noborderoncategories a, li.noborderoncategories a {
- color: #fff;
+ color: #fff !important;
line-height: normal;
vertical-align: top;
}