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:
commit
6d1a934e8d
@ -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)
|
||||
|
||||
@ -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> </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> </td>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user