diff --git a/pandora_console/extras/mr/20.sql b/pandora_console/extras/mr/20.sql new file mode 100644 index 0000000000..a78963b813 --- /dev/null +++ b/pandora_console/extras/mr/20.sql @@ -0,0 +1 @@ +ALTER TABLE treport_content ADD COLUMN `recursion` TINYINT(1) default NULL; \ 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 2e6457c3f0..a472b8b6dd 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 @@ -1337,6 +1337,7 @@ ALTER TABLE treport_content ADD COLUMN `lapse_calc` tinyint(1) default '0'; ALTER TABLE treport_content ADD COLUMN `lapse` int(11) default '300'; ALTER TABLE treport_content ADD COLUMN `visual_format` tinyint(1) default '0'; ALTER TABLE treport_content ADD COLUMN `hide_no_data` tinyint(1) default '0'; +ALTER TABLE treport_content ADD COLUMN `recursion` tinyint(1) default NULL; -- --------------------------------------------------------------------- -- Table `tmodule_relationship` diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index c2ebad004d..9a2f5f3018 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -426,9 +426,12 @@ switch ($action) { $description = $item['description']; $period = $item['period']; $group = $item['id_group']; + $recursion = $item['recursion']; break; case 'event_report_agent': case 'event_report_group': + $recursion = $item['recursion']; + break; case 'event_report_module': $description = $item['description']; $period = $item['period']; @@ -477,12 +480,14 @@ switch ($action) { case 'group_report': $description = $item['description']; $group = $item['id_group']; + $recursion = $item['recursion']; break; case 'network_interfaces_report': $description = $item['description']; $group = $item['id_group']; $period = $item['period']; $fullscale = isset($style['fullscale']) ? (bool) $style['fullscale'] : 0; + $recursion = $item['recursion']; break; case 'top_n': $description = $item['description']; @@ -521,6 +526,7 @@ switch ($action) { $es = json_decode($item['external_source'], true); $id_agents = $es['id_agents']; $selection_a_m = get_parameter('selection'); + $recursion = $item['recursion']; if ((count($es['module']) == 1) && ($es['module'][0] == 0)) { $module = ""; @@ -538,6 +544,7 @@ switch ($action) { $date = $es['date']; $inventory_modules = $es['inventory_modules']; $id_agents = $es['id_agents']; + $recursion = $item['recursion']; $idAgent = $es['id_agents']; $idAgentModule = $inventory_modules; @@ -549,6 +556,7 @@ switch ($action) { $es = json_decode($item['external_source'], true); $inventory_modules = $es['inventory_modules']; $id_agents = $es['id_agents']; + $recursion = $item['recursion']; break; case 'agent_configuration': @@ -557,6 +565,7 @@ switch ($action) { case 'group_configuration': $group = $item['id_group']; + $recursion = $item['recursion']; break; case 'netflow_area': @@ -609,6 +618,7 @@ switch ($action) { break; } + $urlForm = $config['homeurl'] . 'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=item_editor&action=' . $actionParameter . '&id_report=' . $idReport; @@ -914,7 +924,7 @@ You can of course remove the warnings, that's why we include the source and do n html_print_select_groups($config['id_user'], "RM", true, 'combo_group', $group, ''); - echo "   ".__('Recursion').html_print_checkbox('recursion', 1, 0, true); + echo "   ".__('Recursion').html_print_checkbox('recursion', 1, $recursion, true); ?> @@ -1760,6 +1770,9 @@ function print_SLA_list($width, $action, $idItem = null) { $itemsSLA = db_get_all_rows_filter( 'treport_content_sla_combined', array('id_report_content' => $idItem)); + + + if ($itemsSLA === false) { $itemsSLA = array(); } @@ -1971,6 +1984,9 @@ function print_General_list($width, $action, $idItem = null, $type = 'general') $itemsGeneral = db_get_all_rows_filter( 'treport_content_item', array('id_report_content' => $idItem)); + + + if ($itemsGeneral === false) { $itemsGeneral = array(); } diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index a9e955a04e..067b756908 100755 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -940,17 +940,22 @@ switch ($action) { $report = db_get_row_filter('treport', array('id_report' => $idReport)); + + + $reportName = $report['name']; $idGroupReport = $report['id_group']; $description = $report['description']; $good_format = false; switch ($action) { case 'update': + $values = array(); - $values['id_report'] = $idReport; + $values['id_report'] = $idReport; //--------------------------------------------------- //$values['name'] = (string) get_parameter('name'); $values['description'] = get_parameter('description'); $values['type'] = get_parameter('type', null); + $values['recursion'] = get_parameter('recursion', null); $label = get_parameter('label', ''); //Add macros name @@ -1290,6 +1295,7 @@ switch ($action) { } break; case 'save': + $values = array(); $values['id_report'] = $idReport; $values['type'] = get_parameter('type', null); @@ -1303,6 +1309,7 @@ switch ($action) { $items_label['id_agent'] = get_parameter('id_agent'); $items_label['id_agent_module'] = get_parameter('id_agent_module'); $name_it = (string) get_parameter('name'); + $values['recursion'] = get_parameter('recursion', null); $values['name'] = reporting_label_macro($items_label, $name_it); // Support for projection graph, prediction date and SLA reports diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 1940c2cc45..3255136a7b 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -1289,6 +1289,7 @@ CREATE TABLE IF NOT EXISTS `treport_content` ( `lapse` int(11) UNSIGNED NOT NULL default '300', `visual_format` tinyint(1) UNSIGNED NOT NULL default '0', `hide_no_data` tinyint(1) default 0, + `recursion` tinyint(1) default NULL, PRIMARY KEY(`id_rc`), FOREIGN KEY (`id_report`) REFERENCES treport(`id_report`) ON UPDATE CASCADE ON DELETE CASCADE