28 if (!defined(
'NOLOGIN')) define(
'NOLOGIN',
'1');
29 if (!defined(
'NOCSRFCHECK')) define(
'NOCSRFCHECK',
'1');
30 if (!defined(
'NOBROWSERNOTIF')) define(
'NOBROWSERNOTIF',
'1');
31 if (!defined(
'NOREQUIRETRAN')) define(
'NOREQUIRETRAN',
'1');
32 if (!defined(
'NOTOKENRENEWAL')) define(
'NOTOKENRENEWAL',
'1');
33 if (!defined(
'NOREQUIREMENU')) define(
'NOREQUIREMENU',
'1');
34 if (!defined(
'NOIPCHECK')) define(
'NOIPCHECK',
'1');
35 if (!defined(
"NOSESSION")) define(
"NOSESSION",
'1');
55 require
'../../main.inc.php';
60 $securitykey =
GETPOST(
'securitykey');
67 dol_syslog(
"public/emailing/mailing-read.php : tag=".$tag.
" securitykey=".$securitykey, LOG_DEBUG);
69 if ($securitykey != $conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY)
71 print 'Bad security key value.';
77 dol_syslog(
"public/emailing/mailing-read.php : Update status of email target and thirdparty for tag ".$tag, LOG_DEBUG);
79 $sql =
"SELECT mc.rowid, mc.email, mc.statut, mc.source_type, mc.source_id, m.entity";
80 $sql .=
" FROM ".MAIN_DB_PREFIX.
"mailing_cibles as mc, ".MAIN_DB_PREFIX.
"mailing as m";
81 $sql .=
" WHERE mc.fk_mailing = m.rowid AND mc.tag='".$db->escape($tag).
"'";
86 $obj = $db->fetch_object(
$resql);
89 print 'Email target not valid. Operation canceled.';
92 if (empty($obj->email)) {
93 print 'Email target not valid. Operation canceled.';
96 if ($obj->statut == 2 || $obj->statut == 3) {
97 print 'Email target already set to read or unsubscribe. Operation canceled.';
111 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"mailing_cibles SET statut=".$statut.
" WHERE rowid = ".((int) $obj->rowid);
112 $resql = $db->query($sql);
116 if ($obj->source_id > 0 && $obj->source_type ==
'thirdparty' && $obj->entity) {
117 $sql =
"UPDATE ".MAIN_DB_PREFIX.
'societe SET fk_stcomm = 3 WHERE fk_stcomm <> -1 AND entity = '.$obj->entity.
' AND rowid = '.$obj->source_id;
118 $resql = $db->query($sql);
122 if ($obj->source_id > 0 && $obj->source_type ==
'contact' && $obj->entity) {
123 $sql =
"UPDATE ".MAIN_DB_PREFIX.
'societe SET fk_stcomm = 3 WHERE fk_stcomm <> -1 AND entity = '.$obj->entity.
' AND rowid IN (SELECT sc.fk_soc FROM '.MAIN_DB_PREFIX.
'socpeople AS sc WHERE sc.rowid = '.$obj->source_id.
')';
124 $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_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
print
Draft customers invoices.
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...