27require 
'../main.inc.php';
 
   28require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
 
   29require_once DOL_DOCUMENT_ROOT.
'/core/lib/security2.lib.php';
 
   32$langs->loadLangs(array(
"admin", 
"mails"));
 
   38$action = 
GETPOST(
'action', 
'aZ09');
 
   47if ($action == 
'setvalue') {
 
   50  $mailfrom = 
GETPOST(
'MAILING_EMAIL_FROM', 
'alpha');
 
   51  $mailerror = 
GETPOST(
'MAILING_EMAIL_ERRORSTO', 
'alpha');
 
   52  $checkread = 
GETPOST(
'value', 
'alpha');
 
   53  $checkread_key = 
GETPOST(
'MAILING_EMAIL_UNSUBSCRIBE_KEY', 
'alpha');
 
   54  $contactbulkdefault = 
GETPOSTINT(
'MAILING_CONTACT_DEFAULT_BULK_STATUS');
 
   55  if (
GETPOST(
'MAILING_DELAY', 
'alpha') != 
'') {
 
   61  if ((
float) $mailingdelay > 10) {
 
   64  if (
GETPOST(
'MAILING_DELAY', 
'alpha') != 
'' && 
GETPOST(
'MAILING_DELAY', 
'alpha') != 
'0' && (
float) $mailingdelay < 0.001) {
 
   65    $mailingdelay = 0.001;
 
   68  $res = 
dolibarr_set_const($db, 
"MAILING_EMAIL_FROM", $mailfrom, 
'chaine', 0, 
'', $conf->entity);
 
   72  $res = 
dolibarr_set_const($db, 
"MAILING_EMAIL_ERRORSTO", $mailerror, 
'chaine', 0, 
'', $conf->entity);
 
   76  $res = 
dolibarr_set_const($db, 
"MAILING_DELAY", $mailingdelay, 
'chaine', 0, 
'', $conf->entity);
 
   80  $res = 
dolibarr_set_const($db, 
"MAILING_CONTACT_DEFAULT_BULK_STATUS", $contactbulkdefault, 
'chaine', 0, 
'', $conf->entity);
 
   86  $res = 
dolibarr_set_const($db, 
"MAILING_EMAIL_UNSUBSCRIBE_KEY", $checkread_key, 
'chaine', 0, 
'', $conf->entity);
 
  100if ($action == 
'setonsearchandlistgooncustomerorsuppliercard') {
 
  101  $setonsearchandlistgooncustomerorsuppliercard = 
GETPOSTINT(
'value');
 
  102  $res = 
dolibarr_set_const($db, 
"SOCIETE_ON_SEARCH_AND_LIST_GO_ON_CUSTOMER_OR_SUPPLIER_CARD", $setonsearchandlistgooncustomerorsuppliercard, 
'yesno', 0, 
'', $conf->entity);
 
  117llxHeader(
'', $langs->trans(
"MailingSetup"), 
'', 
'', 0, 0, 
'', 
'', 
'', 
'mod-admin page-mailing');
 
  119$linkback = 
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
 
  120print 
load_fiche_titre($langs->trans(
"MailingSetup"), $linkback, 
'title_setup');
 
  122$constname = 
'MAILING_EMAIL_UNSUBSCRIBE_KEY';
 
  125include_once DOL_DOCUMENT_ROOT.
'/core/lib/security2.lib.php';
 
  129print 
'<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
 
  130print 
'<input type="hidden" name="token" value="'.newToken().
'">';
 
  131print 
'<input type="hidden" name="action" value="setvalue">';
 
  133print 
'<table class="noborder centpercent">';
 
  134print 
'<tr class="liste_titre">';
 
  135print 
'<td>'.$langs->trans(
"Parameter").
'</td>';
 
  136print 
'<td>'.$langs->trans(
"Value").
'</td>';
 
  137print 
'<td class="hideonsmartphone">'.$langs->trans(
"Example").
'</td>';
 
  140print 
'<tr class="oddeven"><td>';
 
  141$help = 
img_help(1, $langs->trans(
"EMailHelpMsgSPFDKIM"));
 
  142print $langs->trans(
"MailingEMailFrom").
' '.$help.
'</td><td>';
 
  143print 
'<input class="minwidth100" type="text" name="MAILING_EMAIL_FROM" value="' . 
getDolGlobalString(
'MAILING_EMAIL_FROM').
'">';
 
  145  print 
' '.img_warning($langs->trans(
"BadEMail"));
 
  148print 
'<td class="hideonsmartphone"><span class="opacitymedium">'.dol_escape_htmltag(($mysoc->name ? $mysoc->name : 
'MyName').
' <noreply@example.com>').
'</span></td>';
 
  151print 
'<tr class="oddeven"><td>';
 
  152print $langs->trans(
"MailingEMailError").
'</td><td>';
 
  153print 
'<input class="minwidth100" type="text" name="MAILING_EMAIL_ERRORSTO" value="'.getDolGlobalString(
'MAILING_EMAIL_ERRORSTO').
'">';
 
  155  print 
' '.img_warning($langs->trans(
"BadEMail"));
 
  158print 
'<td class="hideonsmartphone"><span class="opacitymedium">'.dol_escape_htmltag(
'<webmaster@example.com>').
'</span></td>';
 
  161print 
'<tr class="oddeven"><td>';
 
  162print $form->textwithpicto($langs->trans(
"MailingDelay"), $langs->trans(
"IfDefinedUseAValueBeetween", 
'0.001', 
'10')).
'</td><td>';
 
  163print 
'<input class="width75" type="text" name="MAILING_DELAY" value="'.getDolGlobalString(
'MAILING_DELAY').
'">';
 
  165print 
'<td class="hideonsmartphone"></td>';
 
  172print 
'<tr class="oddeven"><td>';
 
  173print $langs->trans(
"ActivateCheckReadKey").
'</td><td>';
 
  174print 
'<input class="minwidth100 maxwdith250 widthcentpercentminusx" type="text" name="MAILING_EMAIL_UNSUBSCRIBE_KEY" id="MAILING_EMAIL_UNSUBSCRIBE_KEY" value="'.getDolGlobalString(
'MAILING_EMAIL_UNSUBSCRIBE_KEY').
'">';
 
  175if (!empty($conf->use_javascript_ajax)) {
 
  176  print 
' '.img_picto($langs->trans(
'Generate'), 
'refresh', 
'id="generate_token" class="linkobject"');
 
  179print 
'<td class="hideonsmartphone"></td>';
 
  183print 
'<tr class="oddeven">';
 
  184print 
'<td>' . $langs->trans(
"DefaultBlacklistMailingStatus", $langs->transnoentitiesnoconv(
"No_Email")) . 
'</td>';
 
  186$blacklist_setting=array(0=>$langs->trans(
'No'), 1=>$langs->trans(
'Yes'), 2=>$langs->trans(
'DefaultStatusEmptyMandatory'));
 
  187print $form->selectarray(
"MAILING_CONTACT_DEFAULT_BULK_STATUS", $blacklist_setting, 
getDolGlobalString(
'MAILING_CONTACT_DEFAULT_BULK_STATUS'));
 
  189print 
'<td class="hideonsmartphone"></td>';
 
  193if (!empty($conf->use_javascript_ajax) && 
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') >= 1) {
 
  194  print 
'<tr class="oddeven"><td>';
 
  195  print $langs->trans(
"MailAdvTargetRecipients").
'</td><td>';
 
  196  print ajax_constantonoff(
'EMAILING_USE_ADVANCED_SELECTOR');
 
  198  print 
'<td class="hideonsmartphone"></td>';
 
  204print $form->buttonsSaveCancel(
"Modify", 
'');
 
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
 
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
 
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
 
img_help($usehelpcursor=1, $usealttitle=1)
Show help logo with cursor "?".
 
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
 
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
 
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
 
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
 
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
 
isValidEmail($address, $acceptsupervisorkey=0, $acceptuserkey=0)
Return true if email syntax is ok.
 
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
 
dolJSToSetRandomPassword($htmlname, $htmlnameofbutton='generate_token', $generic=1)
Output javascript to autoset a generated password using default module into a HTML element.
 
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.