From d86c44e641b336a46a6b673298db44704a019090 Mon Sep 17 00:00:00 2001 From: atm-greg Date: Wed, 17 Oct 2018 15:55:46 +0200 Subject: [PATCH 1/2] Add conf to disable a thirdparty type --- htdocs/langs/en_US/admin.lang | 1 + htdocs/societe/admin/societe.php | 34 ++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 4630757dbad..4054ca8c254 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1821,3 +1821,4 @@ DisabledResourceLinkUser=Disable feature to link a resource to users DisabledResourceLinkContact=Disable feature to link a resource to contacts ConfirmUnactivation=Confirm module reset OnMobileOnly=On small screen (smartphone) only +DisableProspectCustomerType=Disable the "Prospect/customer" thirdparty type diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index 3a7b26505c7..49a9538e225 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -211,6 +211,21 @@ if ($action=="setaskforshippingmet") { } } +//Activate "Disable prospect/customer type" +if ($action=="setdisableprospectcustomer") { + $setdisableprospectcustomer = GETPOST('value','int'); + $res = dolibarr_set_const($db, "SOCIETE_DISABLE_PROSPECTSCUSTOMERS", $setdisableprospectcustomer,'yesno',0,'',$conf->entity); + if (! $res > 0) $error++; + if (! $error) + { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } + else + { + setEventMessages($langs->trans("Error"), null, 'errors'); + } +} + //Activate ProfId unique if ($action == 'setprofid') { @@ -821,6 +836,25 @@ else print ''; print ''; +// Disable Prospect/Customer thirdparty type +print ''; +print ''.$langs->trans("DisableProspectCustomerType").''; +print ' '; +print ''; +if (!empty($conf->global->SOCIETE_DISABLE_PROSPECTSCUSTOMERS)) +{ + print ''; + print img_picto($langs->trans("Activated"),'switch_on'); + +} +else +{ + print ''; + print img_picto($langs->trans("Disabled"),'switch_off'); +} +print ''; +print ''; + /*print ''; print ''.$langs->trans("OnSearchAndListGoOnCustomerOrSupplierCard").''; print ' '; From c1d25569659de4cc2790304207b4f698e9250e48 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Oct 2018 13:47:18 +0200 Subject: [PATCH 2/2] Update admin.lang --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 4054ca8c254..3acc7c3c046 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1821,4 +1821,4 @@ DisabledResourceLinkUser=Disable feature to link a resource to users DisabledResourceLinkContact=Disable feature to link a resource to contacts ConfirmUnactivation=Confirm module reset OnMobileOnly=On small screen (smartphone) only -DisableProspectCustomerType=Disable the "Prospect/customer" thirdparty type +DisableProspectCustomerType=Disable the "Prospect + Customer" third party type (so third party must be Prospect or Customer but can't be both)