Update mailing-read.php

This commit is contained in:
UT from dolibit 2022-12-20 21:16:17 +01:00 committed by GitHub
parent 7eedcdd115
commit fcec48ea7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,8 +46,8 @@ if (!defined('NOREQUIREMENU')) {
if (!defined('NOIPCHECK')) { if (!defined('NOIPCHECK')) {
define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
} }
if (!defined("NOSESSION")) { if (!defined('NOSESSION')) {
define("NOSESSION", '1'); define('NOSESSION', '1');
} }
/** /**
@ -58,6 +58,8 @@ if (!defined("NOSESSION")) {
function llxHeader() function llxHeader()
{ {
} }
/** /**
* Footer empty * Footer empty
* *
@ -121,19 +123,19 @@ if (!empty($tag)) {
} }
*/ */
//Update status of target // Update status of target
$statut = '2'; $statut = '2';
$sql = "UPDATE ".MAIN_DB_PREFIX."mailing_cibles SET statut=".((int) $statut)." WHERE rowid = ".((int) $obj->rowid); $sql = "UPDATE ".MAIN_DB_PREFIX."mailing_cibles SET statut=".((int) $statut)." WHERE rowid = ".((int) $obj->rowid);
$resql = $db->query($sql); $resql = $db->query($sql);
if (!$resql) dol_print_error($db); if (!$resql) dol_print_error($db);
//Update status communication of thirdparty prospect // Update status communication of thirdparty prospect
if ($obj->source_id > 0 && $obj->source_type == 'thirdparty' && $obj->entity) { if ($obj->source_id > 0 && $obj->source_type == 'thirdparty' && $obj->entity) {
$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); $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);
$resql = $db->query($sql); $resql = $db->query($sql);
} }
//Update status communication of contact prospect // Update status communication of contact prospect
if ($obj->source_id > 0 && $obj->source_type == 'contact' && $obj->entity) { if ($obj->source_id > 0 && $obj->source_type == 'contact' && $obj->entity) {
$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).')'; $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).')';
$resql = $db->query($sql); $resql = $db->query($sql);