diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index 9368864c7d0..5e17cf830a8 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -64,7 +64,8 @@ class FormFile
*/
function form_attach_new_file($url, $title='', $addcancel=0, $sectionid=0, $perm=1, $size=50, $object='', $options='', $useajax=true)
{
- global $conf,$langs;
+ global $conf,$langs, $hookmanager;
+ $hookmanager->initHooks(array('formfile'));
if (! empty($conf->browser->phone)) return 0;
@@ -139,6 +140,8 @@ class FormFile
if (empty($sectionid)) print '
';
print "\n\n\n";
+ $parameters = array('socid'=>(isset($GLOBALS['socid'])?$GLOBALS['socid']:''),'id'=>(isset($GLOBALS['id'])?$GLOBALS['id']:''), 'url'=>$url);
+ print $hookmanager->executeHooks('formattachOptions',$parameters,$object);
return 1;
}