|
@@ -248,7 +248,7 @@ if (empty($reshook)) {
|
|
|
$action = 'create';
|
|
|
}
|
|
|
|
|
|
- if (isModEnabled('mailing') && $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2 && $object->no_email == -1 && !empty($object->email)) {
|
|
|
+ if (isModEnabled('mailing') && getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS') == 2 && $object->no_email == -1 && !empty($object->email)) {
|
|
|
$error++;
|
|
|
$errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentities("No_Email"));
|
|
|
$action = 'create';
|
|
@@ -338,7 +338,7 @@ if (empty($reshook)) {
|
|
|
$action = 'edit';
|
|
|
}
|
|
|
|
|
|
- if (isModEnabled('mailing') && $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2 && GETPOST("no_email", "int") == -1 && !empty(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL))) {
|
|
|
+ if (isModEnabled('mailing') && getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS') == 2 && GETPOST("no_email", "int") == -1 && !empty(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL))) {
|
|
|
$error++;
|
|
|
$errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentities("No_Email"));
|
|
|
$action = 'edit';
|
|
@@ -759,7 +759,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|
|
|
|
|
// State
|
|
|
if (empty($conf->global->SOCIETE_DISABLE_STATE)) {
|
|
|
- if (!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && ($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 1 || $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 2)) {
|
|
|
+ if (!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && (getDolGlobalInt('MAIN_SHOW_REGION_IN_STATE_SELECT') == 1 || getDolGlobalInt('MAIN_SHOW_REGION_IN_STATE_SELECT') == 2)) {
|
|
|
print '<tr><td><label for="state_id">'.$langs->trans('Region-State').'</label></td><td colspan="'.$colspan.'" class="maxwidthonsmartphone">';
|
|
|
} else {
|
|
|
print '<tr><td><label for="state_id">'.$langs->trans('State').'</label></td><td colspan="'.$colspan.'" class="maxwidthonsmartphone">';
|
|
@@ -821,7 +821,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|
|
|
|
|
// Unsubscribe
|
|
|
if (isModEnabled('mailing')) {
|
|
|
- if ($conf->use_javascript_ajax && $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2) {
|
|
|
+ if ($conf->use_javascript_ajax && getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS') == 2) {
|
|
|
print "\n".'<script type="text/javascript">'."\n";
|
|
|
print '$(document).ready(function () {
|
|
|
$("#email").keyup(function() {
|
|
@@ -843,7 +843,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|
|
print '<tr>';
|
|
|
print '<td class="noemail"><label for="no_email">'.$langs->trans("No_Email").'</label></td>';
|
|
|
print '<td>';
|
|
|
- print $form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOST("no_email", 'int') : $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS), 1, false, ($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2));
|
|
|
+ print $form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOST("no_email", 'int') : $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS), 1, false, (getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS') == 2));
|
|
|
print '</td>';
|
|
|
print '</tr>';
|
|
|
}
|
|
@@ -1040,7 +1040,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|
|
|
|
|
// State
|
|
|
if (empty($conf->global->SOCIETE_DISABLE_STATE)) {
|
|
|
- if (!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && ($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 1 || $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 2)) {
|
|
|
+ if (!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && (getDolGlobalInt('MAIN_SHOW_REGION_IN_STATE_SELECT') == 1 || getDolGlobalInt('MAIN_SHOW_REGION_IN_STATE_SELECT') == 2)) {
|
|
|
print '<tr><td><label for="state_id">'.$langs->trans('Region-State').'</label></td><td colspan="3" class="maxwidthonsmartphone">';
|
|
|
} else {
|
|
|
print '<tr><td><label for="state_id">'.$langs->trans('State').'</label></td><td colspan="3" class="maxwidthonsmartphone">';
|
|
@@ -1092,7 +1092,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|
|
|
|
|
// Unsubscribe
|
|
|
if (isModEnabled('mailing')) {
|
|
|
- if ($conf->use_javascript_ajax && isset($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS) && $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2) {
|
|
|
+ if ($conf->use_javascript_ajax && isset($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS) && getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS') == 2) {
|
|
|
print "\n".'<script type="text/javascript">'."\n";
|
|
|
|
|
|
print '
|
|
@@ -1120,7 +1120,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|
|
print '<tr>';
|
|
|
print '<td class="noemail"><label for="no_email">'.$langs->trans("No_Email").'</label></td>';
|
|
|
print '<td>';
|
|
|
- $useempty = (isset($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS) && ($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2));
|
|
|
+ $useempty = (getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS') == 2);
|
|
|
print $form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOST("no_email", 'int') : $object->no_email), 1, false, $useempty);
|
|
|
print '</td>';
|
|
|
print '</tr>';
|