diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index 0d2e3163be6df3fd1c0ae12fcc7ce8a5825d48d8..9368864c7d08f546aae1a49c38e85fae80cecad0 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -495,7 +495,7 @@ class FormFile
 					// Autre cas
 					if ($modulepart == 'donation')            { $relativepath = get_exdir($filename,2).$file["name"]; }
 					if ($modulepart == 'export')              { $relativepath = $file["name"]; }
-
+					
 					$out.= "<tr ".$bc[$var].">";
 
 					// Show file name with link to download
@@ -533,7 +533,11 @@ class FormFile
                         $out.= ($param?'&'.$param:'');
                         $out.= '">'.img_printer().'</a></td>';
                     }
-                    if (is_object($hookmanager)) $out.= $hookmanager->executeHooks('formBuilddocLineOptions',$parameters,$file);
+                    if (is_object($hookmanager)) 
+                    {
+            			$parameters=array('socid'=>(isset($GLOBALS['socid'])?$GLOBALS['socid']:''),'id'=>(isset($GLOBALS['id'])?$GLOBALS['id']:''),'modulepart'=>$modulepart,'relativepath'=>$relativepath);
+                    	$out.= $hookmanager->executeHooks('formBuilddocLineOptions',$parameters,$file);
+                    }
 				}
 
                 $out.= '</tr>';