diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php
index 39493825377..437ac507462 100644
--- a/htdocs/core/class/hookmanager.class.php
+++ b/htdocs/core/class/hookmanager.class.php
@@ -177,6 +177,7 @@ class HookManager
'getFormatedCustomerRef',
'getFormatedSupplierRef',
'getIdProfUrl',
+ 'getInputIdProf',
'moveUploadedFile',
'moreHtmlStatus',
'pdf_build_address',
diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php
index 69858876fef..0d0c0d74661 100644
--- a/htdocs/core/class/html.formcompany.class.php
+++ b/htdocs/core/class/html.formcompany.class.php
@@ -833,7 +833,7 @@ class FormCompany extends Form
public function get_input_id_prof($idprof, $htmlname, $preselected, $country_code, $morecss = 'maxwidth100onsmartphone quatrevingtpercent')
{
// phpcs:enable
- global $conf, $langs;
+ global $conf, $langs, $hookmanager;
$formlength = 0;
if (empty($conf->global->MAIN_DISABLEPROFIDRULES)) {
@@ -866,7 +866,16 @@ class FormCompany extends Form
$maxlength = $formlength;
if (empty($formlength)) { $formlength = 24; $maxlength = 128; }
- $out = '';
+ $out = '';
+
+ // Execute hook getInputIdProf to complete or replace $out
+ $parameters=array('formlength'=>$formlength, 'selected'=>$preselected, 'idprof'=>$idprof, 'htmlname'=>$htmlname, 'country_code'=>$country_code);
+ $reshook=$hookmanager->executeHooks('getInputIdProf', $parameters);
+ if (empty($reshook))
+ {
+ $out .= '';
+ }
+ $out .= $hookmanager->resPrint;
return $out;
}