|
@@ -225,7 +225,7 @@ if (empty($reshook)) {
|
|
|
$action = 'create';
|
|
|
}
|
|
|
|
|
|
- if (!empty($conf->mailing->enabled) && $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == -1 && $object->no_email == -1 && !empty($object->email)) {
|
|
|
+ if (!empty($conf->mailing->enabled) && $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2 && $object->no_email == -1 && !empty($object->email)) {
|
|
|
$error++;
|
|
|
$errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentities("No_Email"));
|
|
|
$action = 'create';
|
|
@@ -317,7 +317,7 @@ if (empty($reshook)) {
|
|
|
$action = 'edit';
|
|
|
}
|
|
|
|
|
|
- if (!empty($conf->mailing->enabled) && $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == -1 && GETPOST("no_email", "int") == -1 && !empty(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL))) {
|
|
|
+ if (!empty($conf->mailing->enabled) && $conf->global->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';
|
|
@@ -780,7 +780,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|
|
|
|
|
// Unsubscribe
|
|
|
if (!empty($conf->mailing->enabled)) {
|
|
|
- if ($conf->use_javascript_ajax && $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == -1) {
|
|
|
+ if ($conf->use_javascript_ajax && $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2) {
|
|
|
print "\n".'<script type="text/javascript" language="javascript">'."\n";
|
|
|
print '$(document).ready(function () {
|
|
|
$("#email").keyup(function() {
|
|
@@ -801,7 +801,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>'.$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 == -1)).'</td>';
|
|
|
+ print '<td>'.$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)).'</td>';
|
|
|
print '</tr>';
|
|
|
}
|
|
|
|
|
@@ -1060,7 +1060,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|
|
|
|
|
// Unsubscribe
|
|
|
if (!empty($conf->mailing->enabled)) {
|
|
|
- if ($conf->use_javascript_ajax && isset($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS) && $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == -1) {
|
|
|
+ if ($conf->use_javascript_ajax && isset($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS) && $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2) {
|
|
|
print "\n".'<script type="text/javascript" language="javascript">'."\n";
|
|
|
|
|
|
print '
|
|
@@ -1087,7 +1087,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|
|
}
|
|
|
print '<tr>';
|
|
|
print '<td class="noemail"><label for="no_email">'.$langs->trans("No_Email").'</label></td>';
|
|
|
- $useempty = (isset($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS) && ($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == -1));
|
|
|
+ $useempty = (isset($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS) && ($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2));
|
|
|
print '<td>'.$form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOST("no_email", 'int') : $object->no_email), 1, false, $useempty).'</td>';
|
|
|
print '</tr>';
|
|
|
}
|