Skip to content

Commit

Permalink
Merge pull request #9792 from atm-greg/Disable_customerprospect_third…
Browse files Browse the repository at this point in the history
…party_type

NEW Add configuration to disable "customer/prospect" thirdparty type
  • Loading branch information
eldy committed Oct 19, 2018
2 parents b6cb16a + c1d2556 commit 6d1a934
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions htdocs/langs/en_US/admin.lang
Expand Up @@ -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)
34 changes: 34 additions & 0 deletions htdocs/societe/admin/societe.php
Expand Up @@ -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')
{
Expand Down Expand Up @@ -821,6 +836,25 @@
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>';
Expand Down

0 comments on commit 6d1a934

Please sign in to comment.