diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 37ec9e05e67..06ef10ff0ad 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3315,7 +3315,7 @@ class Form /** * Return HTML code to output a photo - * @param modulepart Id to define module concerned + * @param modulepart Key to define module concerned ('societe', 'userphoto', 'memberphoto') * @param object Object containing data to retrieve file name * @param width Width of photo * @return string HTML code to output photo @@ -3333,14 +3333,14 @@ class Form $smallfile=preg_replace('/(\.png|\.gif|\.jpg|\.jpeg|\.bmp)/i','_small\\1',$smallfile); $file=$object->id.'/logos/thumbs/'.$smallfile; } - if ($modulepart=='userphoto') + else if ($modulepart=='userphoto') { $dir=$conf->user->dir_output; $file=get_exdir($object->id,2).$object->photo; $altfile=$object->id.".jpg"; // For backward compatibility $email=$object->email; } - if ($modulepart=='memberphoto') + else if ($modulepart=='memberphoto') { $dir=$conf->adherent->dir_output; $file=get_exdir($object->id,2).'photos/'.$object->photo; @@ -3352,11 +3352,11 @@ class Form { if (file_exists($dir."/".$file)) { - $ret.='Photo'; + $ret.=''; } else if ($altfile && file_exists($dir."/".$altfile)) { - $ret.='Photo'; + $ret.=''; } else { @@ -3364,18 +3364,15 @@ class Form { global $dolibarr_main_url_root; $ret.=''; - $ret.='Photo found on Gravatar'; + $ret.=''; } else { - $ret.='No photo'; + $ret.=''; } } } - else - { - dol_print_error('','Call to showrefnav with wrong parameters'); - } + else dol_print_error('','Call of showphoto with wrong parameters'); return $ret; }