From 975d3ecf99f4330b31855b7efee87f99a9ac2291 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 4 Sep 2022 12:11:45 +0200 Subject: [PATCH 1/9] update code --- htdocs/admin/fckeditor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index 3c3cd731a7d..60d0f52b036 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -65,7 +65,7 @@ $conditions = array( 'PRODUCTDESC' => (isModEnabled("product") || isModEnabled("service")), 'DETAILS' => (isModEnabled('facture') || isModEnabled("propal") || isModEnabled('commande') || isModEnabled('supplier_proposal') || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")), 'USERSIGN' => 1, - 'MAILING' => !empty($conf->mailing->enabled), + 'MAILING' => isModEnabled('mailing'), 'MAIL' => (isModEnabled('facture') || isModEnabled("propal") || isModEnabled('commande')), 'TICKET' => !empty($conf->ticket->enabled), ); From 34b4ba7f33dd52c139461f4f237b0f799afe3b85 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 4 Sep 2022 13:24:12 +0200 Subject: [PATCH 2/9] update code --- .../canvas/actions_contactcard_common.class.php | 2 +- htdocs/contact/card.php | 16 ++++++++-------- htdocs/contact/list.php | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php index d1cc70b4927..4a3fc28c9de 100644 --- a/htdocs/contact/canvas/actions_contactcard_common.class.php +++ b/htdocs/contact/canvas/actions_contactcard_common.class.php @@ -180,7 +180,7 @@ abstract class ActionsContactCardCommon if ($action == 'view' || $action == 'edit' || $action == 'delete') { // Emailing - if (!empty($conf->mailing->enabled)) { + if (isModEnabled('mailing')) { $langs->load("mails"); $this->tpl['nb_emailing'] = $this->object->getNbOfEMailings(); } diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 4712b673ad1..d751cbef511 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -249,7 +249,7 @@ if (empty($reshook)) { $action = 'create'; } - if (!empty($conf->mailing->enabled) && $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2 && $object->no_email == -1 && !empty($object->email)) { + if (isModEnabled('mailing') && $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2 && $object->no_email == -1 && !empty($object->email)) { $error++; $errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentities("No_Email")); $action = 'create'; @@ -290,7 +290,7 @@ if (empty($reshook)) { } } - if (empty($error) && !empty($conf->mailing->enabled) && !empty($object->email)) { + if (empty($error) && isModEnabled('mailing') && !empty($object->email)) { // Add mass emailing flag into table mailing_unsubscribe $result = $object->setNoEmail($object->no_email); if ($result < 0) { @@ -342,7 +342,7 @@ if (empty($reshook)) { $action = 'edit'; } - if (!empty($conf->mailing->enabled) && $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2 && GETPOST("no_email", "int") == -1 && !empty(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL))) { + if (isModEnabled('mailing') && $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2 && GETPOST("no_email", "int") == -1 && !empty(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL))) { $error++; $errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentities("No_Email")); $action = 'edit'; @@ -830,7 +830,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; // Unsubscribe - if (!empty($conf->mailing->enabled)) { + if (isModEnabled('mailing')) { if ($conf->use_javascript_ajax && $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2) { print "\n".'