Add conf to disable a thirdparty type

This commit is contained in:
atm-greg 2018-10-17 15:55:46 +02:00
parent a66256a799
commit d86c44e641
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" thirdparty type

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>';