30if (!defined(
'NOLOGIN')) {
31 define(
'NOLOGIN',
'1');
33if (!defined(
'NOCSRFCHECK')) {
34 define(
'NOCSRFCHECK',
'1');
36if (!defined(
'NOBROWSERNOTIF')) {
37 define(
'NOBROWSERNOTIF',
'1');
39if (!defined(
'NOREQUIRETRAN')) {
40 define(
'NOREQUIRETRAN',
'1');
42if (!defined(
'NOTOKENRENEWAL')) {
43 define(
'NOTOKENRENEWAL',
'1');
45if (!defined(
'NOREQUIREMENU')) {
46 define(
'NOREQUIREMENU',
'1');
48if (!defined(
'NOIPCHECK')) {
49 define(
'NOIPCHECK',
'1');
51if (!defined(
'NOSESSION')) {
52 define(
'NOSESSION',
'1');
77function llxHeader($head =
'', $title =
'', $help_url =
'', $target =
'', $disablejs = 0, $disablehead = 0, $arrayofjs =
'', $arrayofcss =
'', $morequerystring =
'', $morecssonbody =
'', $replacemainareaby =
'', $disablenofollow = 0, $disablenoindex = 0)
92function llxFooter($comment =
'', $zone =
'private', $disabledoutputofmessages = 0)
98require
'../../main.inc.php';
105$securitykey =
GETPOST(
'securitykey');
112dol_syslog(
"public/emailing/mailing-read.php : tag=".$tag.
" securitykey=".$securitykey, LOG_DEBUG);
115 print
'Bad security key value.';
119if (!empty($tag) && $tag !=
'undefined') {
120 dol_syslog(
"public/emailing/mailing-read.php : Update status of email target and thirdparty for tag ".$tag, LOG_DEBUG);
122 $sql =
"SELECT mc.rowid, mc.email, mc.statut, mc.source_type, mc.source_id, m.entity";
123 $sql .=
" FROM ".MAIN_DB_PREFIX.
"mailing_cibles as mc, ".MAIN_DB_PREFIX.
"mailing as m";
124 $sql .=
" WHERE mc.fk_mailing = m.rowid AND mc.tag = '".$db->escape($tag).
"'";
126 $resql = $db->query($sql);
131 $obj = $db->fetch_object($resql);
134 print
'Email target not valid. Operation canceled.';
137 if (empty($obj->email)) {
138 print
'Email target not valid. Operation canceled.';
141 if ($obj->statut == 2 || $obj->statut == 3) {
142 print
'Email target already set to read or unsubscribe. Operation canceled.';
156 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"mailing_cibles SET statut=".((int) $statut).
" WHERE rowid = ".((int) $obj->rowid);
157 $resql = $db->query($sql);
163 if ($obj->source_id > 0 && $obj->source_type ==
'thirdparty' && $obj->entity) {
164 $sql =
"UPDATE ".MAIN_DB_PREFIX.
'societe SET fk_stcomm = 3 WHERE fk_stcomm <> -1 AND entity = '.((int) $obj->entity).
' AND rowid = '.((int) $obj->source_id);
165 $resql = $db->query($sql);
169 if ($obj->source_id > 0 && $obj->source_type ==
'contact' && $obj->entity) {
170 $sql =
"UPDATE ".MAIN_DB_PREFIX.
'societe SET fk_stcomm = 3 WHERE fk_stcomm <> -1 AND entity = '.((int) $obj->entity).
' AND rowid IN (SELECT sc.fk_soc FROM '.MAIN_DB_PREFIX.
'socpeople AS sc WHERE sc.rowid = '.((int) $obj->source_id).
')';
171 $resql = $db->query($sql);
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Footer empty.
if(!defined('NOLOGIN')) if(!defined( 'NOCSRFCHECK')) if(!defined('NOBROWSERNOTIF')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOIPCHECK')) if(!defined( 'NOSESSION')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Header empty.
dol_hash($chain, $type='0', $nosalt=0, $mode=0)
Returns a hash (non reversible encryption) of a string.