NEW Add hook getInputIdProf. Better solution for #13228
This commit is contained in:
parent
dea8525a6c
commit
00483e4e85
@ -177,6 +177,7 @@ class HookManager
|
|||||||
'getFormatedCustomerRef',
|
'getFormatedCustomerRef',
|
||||||
'getFormatedSupplierRef',
|
'getFormatedSupplierRef',
|
||||||
'getIdProfUrl',
|
'getIdProfUrl',
|
||||||
|
'getInputIdProf',
|
||||||
'moveUploadedFile',
|
'moveUploadedFile',
|
||||||
'moreHtmlStatus',
|
'moreHtmlStatus',
|
||||||
'pdf_build_address',
|
'pdf_build_address',
|
||||||
|
|||||||
@ -833,7 +833,7 @@ class FormCompany extends Form
|
|||||||
public function get_input_id_prof($idprof, $htmlname, $preselected, $country_code, $morecss = 'maxwidth100onsmartphone quatrevingtpercent')
|
public function get_input_id_prof($idprof, $htmlname, $preselected, $country_code, $morecss = 'maxwidth100onsmartphone quatrevingtpercent')
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf, $langs;
|
global $conf, $langs, $hookmanager;
|
||||||
|
|
||||||
$formlength = 0;
|
$formlength = 0;
|
||||||
if (empty($conf->global->MAIN_DISABLEPROFIDRULES)) {
|
if (empty($conf->global->MAIN_DISABLEPROFIDRULES)) {
|
||||||
@ -866,7 +866,16 @@ class FormCompany extends Form
|
|||||||
$maxlength = $formlength;
|
$maxlength = $formlength;
|
||||||
if (empty($formlength)) { $formlength = 24; $maxlength = 128; }
|
if (empty($formlength)) { $formlength = 24; $maxlength = 128; }
|
||||||
|
|
||||||
$out = '<input type="text" '.($morecss ? 'class="'.$morecss.'" ' : '').'name="'.$htmlname.'" id="'.$htmlname.'" maxlength="'.$maxlength.'" value="'.$selected.'">';
|
$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 .= '<input type="text" '.($morecss ? 'class="'.$morecss.'" ' : '').'name="'.$htmlname.'" id="'.$htmlname.'" maxlength="'.$maxlength.'" value="'.$selected.'">';
|
||||||
|
}
|
||||||
|
$out .= $hookmanager->resPrint;
|
||||||
|
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user