diff --git a/pandora_console/extras/mr/42.sql b/pandora_console/extras/mr/42.sql index 914ae0fae7..26f20e0f0a 100644 --- a/pandora_console/extras/mr/42.sql +++ b/pandora_console/extras/mr/42.sql @@ -25,4 +25,10 @@ ALTER TABLE talert_actions ADD COLUMN `field20_recovery` TEXT NOT NULL DEFAULT " ALTER TABLE `treport_content` add column `graph_render` tinyint(1) UNSIGNED NOT NULL default 0; ALTER TABLE `treport_content_template` add column `graph_render` tinyint(1) UNSIGNED NOT NULL default 0; +ALTER TABLE `treport` ADD COLUMN `cover_page_render` tinyint(1) NOT NULL DEFAULT 1; +ALTER TABLE `treport` ADD COLUMN `index_render` tinyint(1) NOT NULL DEFAULT 1; + +ALTER TABLE `treport_template` ADD COLUMN `cover_page_render` tinyint(1) NOT NULL DEFAULT 1; +ALTER TABLE `treport_template` ADD COLUMN `index_render` tinyint(1) NOT NULL DEFAULT 1; + COMMIT; \ No newline at end of file diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index e6208f034a..664a7749e1 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -770,7 +770,8 @@ CREATE TABLE IF NOT EXISTS `treport_template` ( `custom_font` varchar(200) default NULL, `metaconsole` tinyint(1) DEFAULT 0, `agent_regex` varchar(600) NOT NULL default '', - + `cover_page_render` tinyint(1) NOT NULL DEFAULT 1, + `index_render` tinyint(1) NOT NULL DEFAULT 1, PRIMARY KEY(`id_report`) ) ENGINE = InnoDB DEFAULT CHARSET=utf8; @@ -2227,13 +2228,15 @@ INSERT INTO tlog_graph_models VALUES (6, 'Pages with warnings', INSERT INTO tlog_graph_models VALUES (7, 'Users login', 'Starting Session \d+\ of user (.*)', 'user', 0); + -- ----------------------------------------------------- -- Add column in table `treport` -- ----------------------------------------------------- - ALTER TABLE `treport` ADD COLUMN `hidden` tinyint(1) NOT NULL DEFAULT 0; ALTER TABLE `treport` ADD COLUMN `orientation` varchar(25) NOT NULL default 'vertical'; ALTER TABLE `treport` MODIFY COLUMN `hidden` tinyint(1) NULL DEFAULT '0' AFTER `non_interactive`; +ALTER TABLE `treport` ADD COLUMN `cover_page_render` tinyint(1) NOT NULL DEFAULT 1; +ALTER TABLE `treport` ADD COLUMN `index_render` tinyint(1) NOT NULL DEFAULT 1; ALTER TABLE `trecon_task` ADD COLUMN `snmp_version` varchar(5) NOT NULL default '1'; ALTER TABLE `trecon_task` ADD COLUMN `snmp_auth_user` varchar(255) NOT NULL default ''; diff --git a/pandora_console/godmode/reporting/reporting_builder.main.php b/pandora_console/godmode/reporting/reporting_builder.main.php index b8b375bed1..224b2ce517 100755 --- a/pandora_console/godmode/reporting/reporting_builder.main.php +++ b/pandora_console/godmode/reporting/reporting_builder.main.php @@ -1,18 +1,28 @@ id = 'add_alert_table'; $table->class = 'databox filters'; $table->head = []; -if (is_metaconsole()) { +if (is_metaconsole() === true) { $table->head[0] = __('Main data'); $table->head_colspan[0] = 4; $table->headstyle[0] = 'text-align: center'; @@ -70,7 +80,7 @@ $table->size = []; $table->size = []; $table->size[0] = '15%'; $table->size[1] = '90%'; -if (!is_metaconsole()) { +if (is_metaconsole() === false) { $table->style[0] = 'font-weight: bold; vertical-align: top;'; } else { $table->style[0] = 'font-weight: bold;'; @@ -89,14 +99,18 @@ $table->data['name'][1] = html_print_input_text( ); $table->data['group'][0] = __('Group'); -$write_groups = users_get_groups_for_select(false, 'AR', true, true, false, 'id_grupo'); +$write_groups = users_get_groups_for_select( + false, + 'AR', + true, + true, + false, + 'id_grupo' +); - - - - -// If the report group is not among the RW groups (special permission) we add it -if (!isset($write_groups[$idGroupReport]) && $idGroupReport) { +// If the report group is not among the +// RW groups (special permission) we add it. +if (isset($write_groups[$idGroupReport]) === false && $idGroupReport) { $write_groups[$idGroupReport] = groups_get_name($idGroupReport); } @@ -123,7 +137,11 @@ if ($report_id_user == $config['id_user'] 'group_edit' => __('The next group can edit the report'), 'user_edit' => __('Only the user and admin user can edit the report'), ]; - $table->data['access'][0] = __('Write Access').ui_print_help_tip(__('For example, you want a report that the people of "All" groups can see but you want to edit only for you or your group.'), true); + $table->data['access'][0] = __('Write Access'); + $table->data['access'][0] .= ui_print_help_tip( + __('For example, you want a report that the people of "All" groups can see but you want to edit only for you or your group.'), + true + ); $table->data['access'][1] = html_print_select( $type_access, 'type_access', @@ -163,14 +181,19 @@ if ($enterpriseEnable) { } $table->data['interactive_report'][0] = __('Non interactive report'); - $table->data['interactive_report'][1] = __('Yes').' '.html_print_radio_button( + $table->data['interactive_report'][1] = __('Yes'); + $table->data['interactive_report'][1] .= ' '; + $table->data['interactive_report'][1] .= html_print_radio_button( 'non_interactive', 1, '', $non_interactive_check, true - ).' '; - $table->data['interactive_report'][1] .= __('No').' '.html_print_radio_button( + ); + $table->data['interactive_report'][1] .= ' '; + $table->data['interactive_report'][1] .= __('No'); + $table->data['interactive_report'][1] .= ' '; + $table->data['interactive_report'][1] .= html_print_radio_button( 'non_interactive', 0, '', @@ -180,7 +203,32 @@ if ($enterpriseEnable) { } $table->data['description'][0] = __('Description'); -$table->data['description'][1] = html_print_textarea('description', 5, 15, $description, '', true); +$table->data['description'][1] = html_print_textarea( + 'description', + 5, + 15, + $description, + '', + true +); + +if (enterprise_installed() === true) { + $table->data['cover'][0] = __('Generate cover page in PDF render'); + $table->data['cover'][1] = html_print_checkbox_switch( + 'cover_page_render', + 1, + $cover_page_render, + true + ); + + $table->data['index'][0] = __('Generate index in PDF render'); + $table->data['index'][1] = html_print_checkbox_switch( + 'index_render', + 1, + $index_render, + true + ); +} echo '