diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index b173f7912dd9f..52445134f0f6a 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" third party type (so third party must be Prospect or Customer but can't be both) diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index 3a7b26505c781..49a9538e225e0 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -211,6 +211,21 @@ } } +//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 @@ 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 ' ';