From 4ec4801c77d79be71b7e9a486272c2b2496a14f8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Oct 2020 15:54:08 +0200 Subject: [PATCH] FIX Only template of enabled modules visible --- htdocs/admin/mails_templates.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 9ff86260c4b..b9281765771 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -429,7 +429,7 @@ if ($action == 'delete') } -$sql = "SELECT rowid as rowid, label, type_template, lang, fk_user, private, position, topic, joinfiles, content_lines, content, enabled, active"; +$sql = "SELECT rowid as rowid, module, label, type_template, lang, fk_user, private, position, topic, joinfiles, content_lines, content, enabled, active"; $sql .= " FROM ".MAIN_DB_PREFIX."c_email_templates"; $sql .= " WHERE entity IN (".getEntity('email_template').")"; if (!$user->admin) @@ -779,6 +779,13 @@ if ($resql) print "\n"; } else { + if ($obj->module) { + $tempmodulekey = $obj->module; + if (empty($conf->$tempmodulekey) || empty($conf->$tempmodulekey->enabled)) { + $i++; + continue; + } + } $keyforobj = 'type_template'; if (!in_array($obj->$keyforobj, array_keys($elementList))) {