Added idprof url for country PT

This commit is contained in:
Rui Strecht 2018-02-28 12:51:29 +00:00
parent 5ef00d200f
commit 9eb9228268

View File

@ -2920,20 +2920,35 @@ class Societe extends CommonObject
$hookmanager->initHooks(array('idprofurl'));
$parameters=array('idprof'=>$idprof, 'company'=>$thirdparty);
$reshook=$hookmanager->executeHooks('getIdProfUrl',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
if (empty($reshook))
{
if (! empty($conf->global->MAIN_DISABLEPROFIDRULES)) return '';
if (empty($reshook)) {
if (! empty($conf->global->MAIN_DISABLEPROFIDRULES)) {
return '';
}
// TODO Move links to validate professional ID into a dictionary table "country" + "link"
if ($idprof == 1 && $thirdparty->country_code == 'FR') $url='http://www.societe.com/cgi-bin/search?champs='.$thirdparty->idprof1; // See also http://avis-situation-sirene.insee.fr/
//if ($idprof == 1 && ($thirdparty->country_code == 'GB' || $thirdparty->country_code == 'UK')) $url='http://www.companieshouse.gov.uk/WebCHeck/findinfolink/'; // Link no more valid
if ($idprof == 1 && $thirdparty->country_code == 'ES') $url='http://www.e-informa.es/servlet/app/portal/ENTP/screen/SProducto/prod/ETIQUETA_EMPRESA/nif/'.$thirdparty->idprof1;
if ($idprof == 1 && $thirdparty->country_code == 'IN') $url='http://www.tinxsys.com/TinxsysInternetWeb/dealerControllerServlet?tinNumber='.$thirdparty->idprof1.';&searchBy=TIN&backPage=searchByTin_Inter.jsp';
if ($idprof == 1 && $thirdparty->country_code == 'FR') {
$url='http://www.societe.com/cgi-bin/search?champs='.$thirdparty->idprof1; // See also http://avis-situation-sirene.insee.fr/
}
/*
if ($idprof == 1 && ($thirdparty->country_code == 'GB' || $thirdparty->country_code == 'UK')) {
$url='http://www.companieshouse.gov.uk/WebCHeck/findinfolink/'; // Link no more valid
}
*/
if ($idprof == 1 && $thirdparty->country_code == 'ES') {
$url='http://www.e-informa.es/servlet/app/portal/ENTP/screen/SProducto/prod/ETIQUETA_EMPRESA/nif/'.$thirdparty->idprof1;
}
if ($idprof == 1 && $thirdparty->country_code == 'IN') {
$url='http://www.tinxsys.com/TinxsysInternetWeb/dealerControllerServlet?tinNumber='.$thirdparty->idprof1.';&searchBy=TIN&backPage=searchByTin_Inter.jsp';
}
if ($idprof == 1 && $thirdparty->country_code == 'PT') {
$url='http://www.nif.pt/'.$thirdparty->idprof1.'/';
}
if ($url) return '<a target="_blank" href="'.$url.'">'.$langs->trans("Check").'</a>';
if ($url) {
return '<a target="_blank" href="'.$url.'">'.$langs->trans("Check").'</a>';
}
}
else
{
else {
return $hookmanager->resPrint;
}