Merge branch 'ent-6800-campos-no-se-guaerdan-plantillas' into 'develop'

Ent 6800 campos no se guaerdan plantillas

Closes pandora_enterprise#6800

See merge request artica/pandorafms!3693
This commit is contained in:
Daniel Rodriguez 2020-12-17 17:00:07 +01:00
commit 22159a6d69
4 changed files with 36 additions and 1 deletions

View File

@ -0,0 +1,15 @@
START TRANSACTION;
ALTER TABLE `talert_templates`
ADD COLUMN `field16` TEXT NOT NULL AFTER `field15`
,ADD COLUMN `field17` TEXT NOT NULL AFTER `field16`
,ADD COLUMN `field18` TEXT NOT NULL AFTER `field17`
,ADD COLUMN `field19` TEXT NOT NULL AFTER `field18`
,ADD COLUMN `field20` TEXT NOT NULL AFTER `field19`
,ADD COLUMN `field16_recovery` TEXT NOT NULL AFTER `field15_recovery`
,ADD COLUMN `field17_recovery` TEXT NOT NULL AFTER `field16_recovery`
,ADD COLUMN `field18_recovery` TEXT NOT NULL AFTER `field17_recovery`
,ADD COLUMN `field19_recovery` TEXT NOT NULL AFTER `field18_recovery`
,ADD COLUMN `field20_recovery` TEXT NOT NULL AFTER `field19_recovery`;
COMMIT;

View File

@ -1267,11 +1267,21 @@ ALTER TABLE talert_templates ADD COLUMN `field12` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN `field13` TEXT NOT NULL DEFAULT ""; ALTER TABLE talert_templates ADD COLUMN `field13` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN `field14` TEXT NOT NULL DEFAULT ""; ALTER TABLE talert_templates ADD COLUMN `field14` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN `field15` TEXT NOT NULL DEFAULT ""; ALTER TABLE talert_templates ADD COLUMN `field15` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN `field16` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN `field17` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN `field18` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN `field19` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN `field20` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN `field11_recovery` TEXT NOT NULL DEFAULT ""; ALTER TABLE talert_templates ADD COLUMN `field11_recovery` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN `field12_recovery` TEXT NOT NULL DEFAULT ""; ALTER TABLE talert_templates ADD COLUMN `field12_recovery` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN `field13_recovery` TEXT NOT NULL DEFAULT ""; ALTER TABLE talert_templates ADD COLUMN `field13_recovery` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN `field14_recovery` TEXT NOT NULL DEFAULT ""; ALTER TABLE talert_templates ADD COLUMN `field14_recovery` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN `field15_recovery` TEXT NOT NULL DEFAULT ""; ALTER TABLE talert_templates ADD COLUMN `field15_recovery` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN `field16_recovery` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN `field17_recovery` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN `field18_recovery` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN `field19_recovery` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_templates ADD COLUMN `field20_recovery` TEXT NOT NULL DEFAULT "";
ALTER TABLE `talert_templates` ADD COLUMN `disable_event` tinyint(1) DEFAULT 0; ALTER TABLE `talert_templates` ADD COLUMN `disable_event` tinyint(1) DEFAULT 0;
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------

View File

@ -148,7 +148,7 @@ if ($update_template) {
$recovery_notify = (bool) get_parameter('recovery_notify'); $recovery_notify = (bool) get_parameter('recovery_notify');
$fields_recovery = []; $fields_recovery = [];
for ($i = 1; $i <= 10; $i++) { for ($i = 1; $i <= $config['max_macro_fields']; $i++) {
$values['field'.$i] = (string) get_parameter('field'.$i); $values['field'.$i] = (string) get_parameter('field'.$i);
$values['field'.$i.'_recovery'] = ($recovery_notify) ? (string) get_parameter('field'.$i.'_recovery') : ''; $values['field'.$i.'_recovery'] = ($recovery_notify) ? (string) get_parameter('field'.$i.'_recovery') : '';
} }

View File

@ -469,6 +469,11 @@ CREATE TABLE IF NOT EXISTS `talert_templates` (
`field13` text NOT NULL, `field13` text NOT NULL,
`field14` text NOT NULL, `field14` text NOT NULL,
`field15` text NOT NULL, `field15` text NOT NULL,
`field16` text NOT NULL,
`field17` text NOT NULL,
`field18` text NOT NULL,
`field19` text NOT NULL,
`field20` text NOT NULL,
`type` ENUM ('regex', 'max_min', 'max', 'min', 'equal', 'not_equal', 'warning', 'critical', 'onchange', 'unknown', 'always', 'not_normal'), `type` ENUM ('regex', 'max_min', 'max', 'min', 'equal', 'not_equal', 'warning', 'critical', 'onchange', 'unknown', 'always', 'not_normal'),
`value` varchar(255) default '', `value` varchar(255) default '',
`matches_value` tinyint(1) default 0, `matches_value` tinyint(1) default 0,
@ -502,6 +507,11 @@ CREATE TABLE IF NOT EXISTS `talert_templates` (
`field13_recovery` text NOT NULL, `field13_recovery` text NOT NULL,
`field14_recovery` text NOT NULL, `field14_recovery` text NOT NULL,
`field15_recovery` text NOT NULL, `field15_recovery` text NOT NULL,
`field16_recovery` text NOT NULL,
`field17_recovery` text NOT NULL,
`field18_recovery` text NOT NULL,
`field19_recovery` text NOT NULL,
`field20_recovery` text NOT NULL,
`priority` tinyint(4) default '0', `priority` tinyint(4) default '0',
`id_group` mediumint(8) unsigned NULL default 0, `id_group` mediumint(8) unsigned NULL default 0,
`special_day` tinyint(1) default 0, `special_day` tinyint(1) default 0,