26 require
'../main.inc.php';
27 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
28 require_once DOL_DOCUMENT_ROOT.
'/core/lib/security2.lib.php';
31 $langs->loadLangs(array(
"admin",
"mails"));
35 $action =
GETPOST(
'action',
'aZ09');
43 if ($action ==
'setvalue')
47 $mailfrom =
GETPOST(
'MAILING_EMAIL_FROM',
'alpha');
48 $mailerror =
GETPOST(
'MAILING_EMAIL_ERRORSTO',
'alpha');
49 $checkread =
GETPOST(
'value',
'alpha');
50 $checkread_key =
GETPOST(
'MAILING_EMAIL_UNSUBSCRIBE_KEY',
'alpha');
51 $mailingdelay =
GETPOST(
'MAILING_DELAY',
'int');
53 $res =
dolibarr_set_const($db,
"MAILING_EMAIL_FROM", $mailfrom,
'chaine', 0,
'', $conf->entity);
54 if (!($res > 0)) $error++;
55 $res =
dolibarr_set_const($db,
"MAILING_EMAIL_ERRORSTO", $mailerror,
'chaine', 0,
'', $conf->entity);
56 if (!($res > 0)) $error++;
57 $res =
dolibarr_set_const($db,
"MAILING_DELAY", $mailingdelay,
'chaine', 0,
'', $conf->entity);
58 if (!($res > 0)) $error++;
59 $res =
dolibarr_set_const($db,
"MAILING_CONTACT_DEFAULT_BULK_STATUS", $contactbulkdefault,
'chaine', 0,
'', $conf->entity);
60 if (!($res > 0)) $error++;
63 $res =
dolibarr_set_const($db,
"MAILING_EMAIL_UNSUBSCRIBE_KEY", $checkread_key,
'chaine', 0,
'', $conf->entity);
64 if (!($res > 0)) $error++;
81 llxHeader(
'', $langs->trans(
"MailingSetup"));
83 $linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
86 if (!empty($conf->use_javascript_ajax))
88 print "\n".
'<script type="text/javascript">';
89 print '$(document).ready(function () {
90 $("#generate_token").click(function() {
91 $.get( "'.DOL_URL_ROOT.
'/core/ajax/security.php", {
92 action: \'getrandompassword\',
96 $("#MAILING_EMAIL_UNSUBSCRIBE_KEY").val(token);
104 print '<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
105 print '<input type="hidden" name="token" value="'.newToken().
'">';
106 print '<input type="hidden" name="action" value="setvalue">';
108 print '<table class="noborder centpercent">';
109 print '<tr class="liste_titre">';
110 print '<td>'.$langs->trans(
"Parameter").
'</td>';
111 print '<td>'.$langs->trans(
"Value").
'</td>';
114 print '<tr class="oddeven"><td>';
115 print $langs->trans(
"MailingEMailFrom").
'</td><td>';
116 print '<input size="32" type="text" name="MAILING_EMAIL_FROM" value="'.$conf->global->MAILING_EMAIL_FROM.
'">';
117 if (!empty($conf->global->MAILING_EMAIL_FROM) && !
isValidEmail($conf->global->MAILING_EMAIL_FROM))
print ' '.img_warning($langs->trans(
"BadEMail"));
120 print '<tr class="oddeven"><td>';
121 print $langs->trans(
"MailingEMailError").
'</td><td>';
122 print '<input size="32" type="text" name="MAILING_EMAIL_ERRORSTO" value="'.$conf->global->MAILING_EMAIL_ERRORSTO.
'">';
123 if (!empty($conf->global->MAILING_EMAIL_ERRORSTO) && !
isValidEmail($conf->global->MAILING_EMAIL_ERRORSTO))
print ' '.img_warning($langs->trans(
"BadEMail"));
126 print '<tr class="oddeven"><td>';
127 print $langs->trans(
"MailingDelay").
'</td><td>';
128 print '<input class="width75" type="text" name="MAILING_DELAY" value="'.$conf->global->MAILING_DELAY.
'">';
135 print '<tr class="oddeven"><td>';
136 print $langs->trans(
"ActivateCheckReadKey").
'</td><td>';
137 print '<input size="32" type="text" name="MAILING_EMAIL_UNSUBSCRIBE_KEY" id="MAILING_EMAIL_UNSUBSCRIBE_KEY" value="'.$conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY.
'">';
138 if (!empty($conf->use_javascript_ajax))
print ' '.img_picto($langs->trans(
'Generate'),
'refresh',
'id="generate_token" class="linkobject"');
141 if (!empty($conf->use_javascript_ajax) && $conf->global->MAIN_FEATURES_LEVEL >= 1) {
142 print '<tr class="oddeven"><td>';
143 print $langs->trans(
"MailAdvTargetRecipients").
'</td><td>';
151 print '<div align="center"><input type="submit" class="button" value="'.$langs->trans(
"Modify").
'"></div>';
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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).
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0, $strict=0, $forcereload=0, $marginleftonlyshort=2, $forcenoajax=0)
On/off button for constant.
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
print
Draft customers invoices.
isValidEmail($address, $acceptsupervisorkey=0)
Return true if email syntax is ok.