New: Add hidden option MAIN_DISABLEPROFIDRULES to allow a module to disables rules check on prof id
This commit is contained in:
parent
f239237299
commit
e2ffd8276c
@ -1763,13 +1763,17 @@ class Societe extends CommonObject
|
|||||||
* Verifie la validite d'un identifiant professionnel en fonction du pays de la societe (siren, siret, ...)
|
* Verifie la validite d'un identifiant professionnel en fonction du pays de la societe (siren, siret, ...)
|
||||||
* @param idprof 1,2,3,4 (Exemple: 1=siren,2=siret,3=naf,4=rcs/rm)
|
* @param idprof 1,2,3,4 (Exemple: 1=siren,2=siret,3=naf,4=rcs/rm)
|
||||||
* @param soc Objet societe
|
* @param soc Objet societe
|
||||||
* @return int <0 si ko, >0 si ok
|
* @return int <=0 if KO, >0 if OK
|
||||||
* TODO not in business class
|
* TODO not in business class
|
||||||
*/
|
*/
|
||||||
function id_prof_check($idprof,$soc)
|
function id_prof_check($idprof,$soc)
|
||||||
{
|
{
|
||||||
|
global $conf;
|
||||||
|
|
||||||
$ok=1;
|
$ok=1;
|
||||||
|
|
||||||
|
if (! empty($conf->global->MAIN_DISABLEPROFIDRULES)) return 1;
|
||||||
|
|
||||||
// Verifie SIREN si pays FR
|
// Verifie SIREN si pays FR
|
||||||
if ($idprof == 1 && $soc->pays_code == 'FR')
|
if ($idprof == 1 && $soc->pays_code == 'FR')
|
||||||
{
|
{
|
||||||
@ -1880,9 +1884,12 @@ class Societe extends CommonObject
|
|||||||
*/
|
*/
|
||||||
function id_prof_url($idprof,$soc)
|
function id_prof_url($idprof,$soc)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
|
if (! empty($conf->global->MAIN_DISABLEPROFIDRULES)) return '';
|
||||||
|
|
||||||
$url='';
|
$url='';
|
||||||
|
|
||||||
if ($idprof == 1 && $soc->pays_code == 'FR') $url='http://www.societe.com/cgi-bin/recherche?rncs='.$soc->siren;
|
if ($idprof == 1 && $soc->pays_code == 'FR') $url='http://www.societe.com/cgi-bin/recherche?rncs='.$soc->siren;
|
||||||
if ($idprof == 1 && $soc->pays_code == 'GB') $url='http://www.companieshouse.gov.uk/WebCHeck/findinfolink/';
|
if ($idprof == 1 && $soc->pays_code == 'GB') $url='http://www.companieshouse.gov.uk/WebCHeck/findinfolink/';
|
||||||
if ($idprof == 1 && $soc->pays_code == 'ES') $url='http://www.e-informa.es/servlet/app/portal/ENTP/screen/SProducto/prod/ETIQUETA_EMPRESA/nif/'.$soc->siren;
|
if ($idprof == 1 && $soc->pays_code == 'ES') $url='http://www.e-informa.es/servlet/app/portal/ENTP/screen/SProducto/prod/ETIQUETA_EMPRESA/nif/'.$soc->siren;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user