Merge pull request #9792 from atm-greg/Disable_customerprospect_thirdparty_type

NEW Add configuration to disable "customer/prospect" thirdparty type
This commit is contained in:
Laurent Destailleur 2018-10-19 13:47:33 +02:00 committed by GitHub
commit 6d1a934e8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 0 deletions

View File

@ -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)

View File

@ -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 '</a></td>';
print '</tr>';
// Disable Prospect/Customer thirdparty type
print '<tr class="oddeven">';
print '<td width="80%">'.$langs->trans("DisableProspectCustomerType").'</td>';
print '<td>&nbsp</td>';
print '<td align="center">';
if (!empty($conf->global->SOCIETE_DISABLE_PROSPECTSCUSTOMERS))
{
print '<a href="'.$_SERVER['PHP_SELF'].'?action=setdisableprospectcustomer&value=0">';
print img_picto($langs->trans("Activated"),'switch_on');
}
else
{
print '<a href="'.$_SERVER['PHP_SELF'].'?action=setdisableprospectcustomer&value=1">';
print img_picto($langs->trans("Disabled"),'switch_off');
}
print '</a></td>';
print '</tr>';
/*print '<tr class="oddeven">';
print '<td width="80%">'.$langs->trans("OnSearchAndListGoOnCustomerOrSupplierCard").'</td>';
print '<td>&nbsp</td>';