diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 550ecea4867..27d7fe521fe 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -6674,16 +6674,17 @@ class Form
* @param string $imagesize 'mini', 'small' or '' (original)
* @param int $addlinktofullsize Add link to fullsize image
* @param int $cache 1=Accept to use image in cache
+ * @param string $forcecapture Force parameter capture on HTML input file element to ask a smartphone to allow to open camera to take photo. Auto if empty.
* @return string HTML code to output photo
*/
- static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $imagesize='', $addlinktofullsize=1, $cache=0)
+ static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $imagesize='', $addlinktofullsize=1, $cache=0, $forcecapture='')
{
global $conf,$langs;
$entity = (! empty($object->entity) ? $object->entity : $conf->entity);
$id = (! empty($object->id) ? $object->id : $object->rowid);
- $ret='';$dir='';$file='';$originalfile='';$altfile='';$email='';
+ $ret='';$dir='';$file='';$originalfile='';$altfile='';$email='';$capture='';
if ($modulepart=='societe')
{
$dir=$conf->societe->multidir_output[$entity];
@@ -6707,6 +6708,7 @@ class Form
$originalfile=get_exdir(0, 0, 0, 0, $object, 'contact').'/photos/'.$object->photo;
}
$email=$object->email;
+ $capture='user';
}
else if ($modulepart=='userphoto')
{
@@ -6720,6 +6722,7 @@ class Form
}
if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility
$email=$object->email;
+ $capture='user';
}
else if ($modulepart=='memberphoto')
{
@@ -6733,6 +6736,7 @@ class Form
}
if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility
$email=$object->email;
+ $capture='user';
}
else
{
@@ -6749,6 +6753,8 @@ class Form
$email=$object->email;
}
+ if ($forcecapture) $capture = $forcecapture;
+
if ($dir)
{
if ($file && file_exists($dir."/".$file))
@@ -6805,7 +6811,7 @@ class Form
if ($object->photo) $ret.="
\n";
$ret.='
| '.$langs->trans("Delete").' |