-
+
{[ "type": "text", "label": "", "name": "name", "value": "$title$", "required": 1, "extra": "" ]}
{[ "type": "span", "label": "", "name": "module", "values": "query=SELECT `zz_modules`.`id`, `title` AS descrizione FROM `zz_modules` LEFT JOIN `zz_modules_lang` ON (`zz_modules`.`id` = `zz_modules_lang`.`id_record` AND `zz_modules_lang`.`id_lang` = id); ?>) WHERE `enabled` = 1", "value": "getTranslation('title'); ?>" ]}
+
+
+ {[ "type": "checkbox", "label": "", "name": "enabled", "value": "$enabled$", "values": "Sì,No" ]}
+
diff --git a/src/HTMLBuilder/Manager/ButtonManager.php b/src/HTMLBuilder/Manager/ButtonManager.php
index f82388b52..fce2223b4 100755
--- a/src/HTMLBuilder/Manager/ButtonManager.php
+++ b/src/HTMLBuilder/Manager/ButtonManager.php
@@ -125,7 +125,7 @@ class ButtonManager implements ManagerInterface
if ($options['type'] == 'print') {
$results = \Prints::getModulePrints($options['id_module']);
} elseif ($options['type'] == 'email') {
- $results = TemplateEmail::where('id_module', $options['id_module'])->with(['translations' => function ($query) {
+ $results = TemplateEmail::where('id_module', $options['id_module'])->where('enabled', 1)->with(['translations' => function ($query) {
$query->orderBy('title');
}])->get()->toArray();
} elseif ($options['type'] == 'sms') {
diff --git a/update/2_5_5.sql b/update/2_5_5.sql
index 764173d8b..fe3072bc4 100644
--- a/update/2_5_5.sql
+++ b/update/2_5_5.sql
@@ -37,4 +37,7 @@ INSERT INTO `zz_settings` (`id`, `nome`, `valore`, `tipo`, `editable`, `sezione`
INSERT INTO `zz_settings_lang` (`id`, `id_lang`, `id_record`, `title`, `help`) VALUES
(NULL, '1', (SELECT `zz_settings`.`id` FROM `zz_settings` WHERE `zz_settings`.`nome` = 'Tile server satellite'), 'Tile server satellite', ''),
-(NULL, '2', (SELECT `zz_settings`.`id` FROM `zz_settings` WHERE `zz_settings`.`nome` = 'Tile server satellite'), 'Satellite tile server', '');
\ No newline at end of file
+(NULL, '2', (SELECT `zz_settings`.`id` FROM `zz_settings` WHERE `zz_settings`.`nome` = 'Tile server satellite'), 'Satellite tile server', '');
+
+-- Aggiunto flag Attivo in Template
+ALTER TABLE `em_templates` ADD `enabled` BOOLEAN NOT NULL DEFAULT TRUE AFTER `note_aggiuntive`;
\ No newline at end of file