From e561481f1edfe9a161e4045014f1604dca7f8cc8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 May 2015 10:58:04 +0200 Subject: [PATCH] Add option THIRDPARTY_NOTCUSTOMERPROSPECT_BY_DEFAULT and THIRDPARTY_NOTCUSTOMERPROSPECT_BY_DEFAULT --- htdocs/societe/soc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index f8d7f05725a..6e6a268009f 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -759,11 +759,11 @@ else } $modCodeFournisseur = new $module; - //if ($_GET["type"]=='cp') { $object->client=3; } - if (GETPOST("type")!='f') { $object->client=3; } + // Define if customer/prospect or supplier status is set or not + if (GETPOST("type")!='f' && empty($conf->global->THIRDPARTY_NOTCUSTOMERPROSPECT_BY_DEFAULT)) { $object->client=3; } if (GETPOST("type")=='c') { $object->client=1; } if (GETPOST("type")=='p') { $object->client=2; } - if (! empty($conf->fournisseur->enabled) && (GETPOST("type")=='f' || GETPOST("type")=='')) { $object->fournisseur=1; } + if (! empty($conf->fournisseur->enabled) && (GETPOST("type")=='f' || (GETPOST("type")=='' && empty($conf->global->THIRDPARTY_NOTSUPPLIER_BY_DEFAULT)))) { $object->fournisseur=1; } $object->name = GETPOST('nom', 'alpha'); $object->firstname = GETPOST('firstname', 'alpha');