diff --git a/pandora_console/extras/mr/19.sql b/pandora_console/extras/mr/19.sql new file mode 100644 index 0000000000..97275c0961 --- /dev/null +++ b/pandora_console/extras/mr/19.sql @@ -0,0 +1,56 @@ +START TRANSACTION; + +-- --------------------------------------------------------------------- +-- Table `tlayout_template` +-- --------------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `tlayout_template` ( + `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL, + `id_group` INTEGER UNSIGNED NOT NULL, + `background` varchar(200) NOT NULL, + `height` INTEGER UNSIGNED NOT NULL default 0, + `width` INTEGER UNSIGNED NOT NULL default 0, + `background_color` varchar(50) NOT NULL default '#FFF', + `is_favourite` INTEGER UNSIGNED NOT NULL default 0, + PRIMARY KEY(`id`) +) ENGINE = InnoDB DEFAULT CHARSET=utf8; + +-- --------------------------------------------------------------------- +-- Table `tlayout_template_data` +-- --------------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `tlayout_template_data` ( + `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, + `id_layout_template` INTEGER UNSIGNED NOT NULL, + `pos_x` INTEGER UNSIGNED NOT NULL default 0, + `pos_y` INTEGER UNSIGNED NOT NULL default 0, + `height` INTEGER UNSIGNED NOT NULL default 0, + `width` INTEGER UNSIGNED NOT NULL default 0, + `label` TEXT, + `image` varchar(200) DEFAULT "", + `type` tinyint(1) UNSIGNED NOT NULL default 0, + `period` INTEGER UNSIGNED NOT NULL default 3600, + `module_name` text NOT NULL, + `agent_name` varchar(600) BINARY NOT NULL default '', + `id_layout_linked` INTEGER unsigned NOT NULL default '0', + `parent_item` INTEGER UNSIGNED NOT NULL default 0, + `enable_link` tinyint(1) UNSIGNED NOT NULL default 1, + `id_metaconsole` int(10) NOT NULL default 0, + `id_group` INTEGER UNSIGNED NOT NULL default 0, + `id_custom_graph` INTEGER UNSIGNED NOT NULL default 0, + `border_width` INTEGER UNSIGNED NOT NULL default 0, + `type_graph` varchar(50) NOT NULL default 'area', + `label_position` varchar(50) NOT NULL default 'down', + `border_color` varchar(200) DEFAULT "", + `fill_color` varchar(200) DEFAULT "", + `show_statistics` tinyint(2) NOT NULL default '0', + `id_layout_linked_weight` int(10) NOT NULL default '0', + `element_group` int(10) NOT NULL default '0', + `show_on_top` tinyint(1) NOT NULL default '0', + `clock_animation` varchar(60) NOT NULL default "analogic_1", + `time_format` varchar(60) NOT NULL default "time", + `timezone` varchar(60) NOT NULL default "Europe/Madrid", + PRIMARY KEY(`id`), + FOREIGN KEY (`id_layout_template`) REFERENCES tlayout_template(`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE = InnoDB DEFAULT CHARSET=utf8; + +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 4516010753..ecb53717a3 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 @@ -1175,13 +1175,13 @@ ALTER TABLE titem MODIFY `source_data` int(10) unsigned; INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30'); -INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 18); +INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 19); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_docs_logo', 'default_docs.png'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_support_logo', 'default_support.png'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_logo_white_bg_preview', 'pandora_logo_head_white_bg.png'); UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager'; DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise'; -INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '724'); +INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '726'); -- --------------------------------------------------------------------- -- Table `tconfig_os` @@ -1712,4 +1712,55 @@ CREATE TABLE IF NOT EXISTS `tautoconfig_actions` ( CONSTRAINT `tautoconfig_action_ibfk_1` FOREIGN KEY (`id_autoconfig`) REFERENCES `tautoconfig` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +-- --------------------------------------------------------------------- +-- Table `tlayout_template` +-- --------------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `tlayout_template` ( + `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL, + `id_group` INTEGER UNSIGNED NOT NULL, + `background` varchar(200) NOT NULL, + `height` INTEGER UNSIGNED NOT NULL default 0, + `width` INTEGER UNSIGNED NOT NULL default 0, + `background_color` varchar(50) NOT NULL default '#FFF', + `is_favourite` INTEGER UNSIGNED NOT NULL default 0, + PRIMARY KEY(`id`) +) ENGINE = InnoDB DEFAULT CHARSET=utf8; +-- --------------------------------------------------------------------- +-- Table `tlayout_template_data` +-- --------------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `tlayout_template_data` ( + `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, + `id_layout_template` INTEGER UNSIGNED NOT NULL, + `pos_x` INTEGER UNSIGNED NOT NULL default 0, + `pos_y` INTEGER UNSIGNED NOT NULL default 0, + `height` INTEGER UNSIGNED NOT NULL default 0, + `width` INTEGER UNSIGNED NOT NULL default 0, + `label` TEXT, + `image` varchar(200) DEFAULT "", + `type` tinyint(1) UNSIGNED NOT NULL default 0, + `period` INTEGER UNSIGNED NOT NULL default 3600, + `module_name` text NOT NULL, + `agent_name` varchar(600) BINARY NOT NULL default '', + `id_layout_linked` INTEGER unsigned NOT NULL default '0', + `parent_item` INTEGER UNSIGNED NOT NULL default 0, + `enable_link` tinyint(1) UNSIGNED NOT NULL default 1, + `id_metaconsole` int(10) NOT NULL default 0, + `id_group` INTEGER UNSIGNED NOT NULL default 0, + `id_custom_graph` INTEGER UNSIGNED NOT NULL default 0, + `border_width` INTEGER UNSIGNED NOT NULL default 0, + `type_graph` varchar(50) NOT NULL default 'area', + `label_position` varchar(50) NOT NULL default 'down', + `border_color` varchar(200) DEFAULT "", + `fill_color` varchar(200) DEFAULT "", + `show_statistics` tinyint(2) NOT NULL default '0', + `id_layout_linked_weight` int(10) NOT NULL default '0', + `element_group` int(10) NOT NULL default '0', + `show_on_top` tinyint(1) NOT NULL default '0', + `clock_animation` varchar(60) NOT NULL default "analogic_1", + `time_format` varchar(60) NOT NULL default "time", + `timezone` varchar(60) NOT NULL default "Europe/Madrid", + PRIMARY KEY(`id`), + FOREIGN KEY (`id_layout_template`) REFERENCES tlayout_template(`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE = InnoDB DEFAULT CHARSET=utf8; diff --git a/pandora_console/godmode/reporting/map_builder.php b/pandora_console/godmode/reporting/map_builder.php index b21ec23f3d..03e49e2769 100644 --- a/pandora_console/godmode/reporting/map_builder.php +++ b/pandora_console/godmode/reporting/map_builder.php @@ -22,6 +22,9 @@ $vconsoles_read = check_acl ($config['id_user'], 0, "VR"); $vconsoles_write = check_acl ($config['id_user'], 0, "VW"); $vconsoles_manage = check_acl ($config['id_user'], 0, "VM"); +$is_enterprise = enterprise_include_once('include/functions_policies.php'); +$is_metaconsole = is_metaconsole(); + if (!$vconsoles_read && !$vconsoles_write && !$vconsoles_manage) { db_pandora_audit("ACL Violation", "Trying to access map builder"); @@ -29,19 +32,64 @@ if (!$vconsoles_read && !$vconsoles_write && !$vconsoles_manage) { exit; } +if(!$is_metaconsole){ + $url_visual_console = 'index.php?sec=network&sec2=godmode/reporting/map_builder'; + $url_visual_console_favorite = 'index.php?sec=network&sec2=godmode/reporting/visual_console_favorite'; + $url_visual_console_template = 'index.php?sec=network&sec2=enterprise/godmode/reporting/visual_console_template'; + $url_visual_console_template_wizard = 'index.php?sec=network&sec2=enterprise/godmode/reporting/visual_console_template_wizard'; +} +else{ + $url_visual_console = 'index.php?sec=screen&sec2=screens/screens&action=visualmap'; + $url_visual_console_favorite = 'index.php?sec=screen&sec2=screens/screens&action=visualmap_favorite'; + $url_visual_console_template = 'index.php?sec=screen&sec2=screens/screens&action=visualmap_template'; + $url_visual_console_template_wizard = 'index.php?sec=screen&sec2=screens/screens&action=visualmap_wizard'; +} + $pure = (int)get_parameter('pure', 0); $hack_metaconsole = ''; if (defined('METACONSOLE')) $hack_metaconsole = '../../'; -$buttons['visual_console_favorite'] = array('active' => false, - 'text' => '' . - html_print_image ("images/list.png", true, array ("title" => __('Visual Favourite Console'))) .''); +$buttons['visual_console'] = array( + 'active' => true, + 'text' => '' . + html_print_image ("images/visual_console.png", true, array ("title" => __('Visual Console List'))) .'' +); -if (!defined('METACONSOLE')) { +$buttons['visual_console_favorite'] = array( + 'active' => false, + 'text' => '' . + html_print_image ("images/list.png", true, array ("title" => __('Visual Favourite Console'))) .'' +); + +if($is_enterprise){ + $buttons['visual_console_template'] = array( + 'active' => false, + 'text' => '' . + html_print_image ("images/templates.png", true, array ("title" => __('Visual Console Template'))) .'' + ); + + $buttons['visual_console_template_wizard'] = array( + 'active' => false, + 'text' => '' . + html_print_image ("images/wand.png", true, array ("title" => __('Visual Console Template Wizard'))) .'' + ); +} + +if (!$is_metaconsole) { ui_print_page_header( __('Reporting') .' » ' . __('Visual Console'), - "images/op_reporting.png", false, "map_builder", false, $buttons); + "images/op_reporting.png", + false, + "map_builder", + false, + $buttons + ); +} +else{ + ui_meta_print_header( + __('Visual console') . " » " . $visualConsoleName, "", + $buttons); } $id_layout = (int) get_parameter ('id_layout'); @@ -62,7 +110,7 @@ if ($delete_layout || $copy_layout) { require ("general/noaccess.php"); exit; } - + $group_id = db_get_value("id_group", "tlayout", "id", $id_layout); if ($group_id === false) { db_pandora_audit("ACL Violation", diff --git a/pandora_console/godmode/reporting/visual_console_favorite.php b/pandora_console/godmode/reporting/visual_console_favorite.php index d8f58da452..b04d06b028 100644 --- a/pandora_console/godmode/reporting/visual_console_favorite.php +++ b/pandora_console/godmode/reporting/visual_console_favorite.php @@ -17,10 +17,13 @@ global $config; require_once ($config['homedir'] . '/include/functions_visual_map.php'); // ACL for the general permission -$vconsoles_read = check_acl ($config['id_user'], 0, "VR"); -$vconsoles_write = check_acl ($config['id_user'], 0, "VW"); +$vconsoles_read = check_acl ($config['id_user'], 0, "VR"); +$vconsoles_write = check_acl ($config['id_user'], 0, "VW"); $vconsoles_manage = check_acl ($config['id_user'], 0, "VM"); +$is_enterprise = enterprise_include_once('include/functions_policies.php'); +$is_metaconsole = is_metaconsole(); + if (!$vconsoles_read && !$vconsoles_write && !$vconsoles_manage) { db_pandora_audit("ACL Violation", "Trying to access map builder"); @@ -28,15 +31,55 @@ if (!$vconsoles_read && !$vconsoles_write && !$vconsoles_manage) { exit; } -$buttons['map_builder'] = array('active' => false, - 'text' => '' . - html_print_image ("images/visual_console.png", true, array ("title" => __('Visual Console'))) .''); +if(!$is_metaconsole){ + $url_visual_console = 'index.php?sec=network&sec2=godmode/reporting/map_builder'; + $url_visual_console_favorite = 'index.php?sec=network&sec2=godmode/reporting/visual_console_favorite'; + $url_visual_console_template = 'index.php?sec=network&sec2=enterprise/godmode/reporting/visual_console_template'; + $url_visual_console_template_wizard = 'index.php?sec=network&sec2=enterprise/godmode/reporting/visual_console_template_wizard'; +} +else{ + $url_visual_console = 'index.php?sec=screen&sec2=screens/screens&action=visualmap'; + $url_visual_console_favorite = 'index.php?sec=screen&sec2=screens/screens&action=visualmap_favorite'; + $url_visual_console_template = 'index.php?sec=screen&sec2=screens/screens&action=visualmap_template'; + $url_visual_console_template_wizard = 'index.php?sec=screen&sec2=screens/screens&action=visualmap_wizard'; +} -if (!defined('METACONSOLE')) { +$buttons['visual_console'] = array( + 'active' => false, + 'text' => '' . + html_print_image ("images/visual_console.png", true, array ("title" => __('Visual Console List'))) .'' +); + +$buttons['visual_console_favorite'] = array( + 'active' => true, + 'text' => '' . + html_print_image ("images/list.png", true, array ("title" => __('Visual Favourite Console'))) .'' +); + +if($is_enterprise){ + $buttons['visual_console_template'] = array( + 'active' => false, + 'text' => '' . + html_print_image ("images/templates.png", true, array ("title" => __('Visual Console Template'))) .'' + ); + + $buttons['visual_console_template_wizard'] = array( + 'active' => false, + 'text' => '' . + html_print_image ("images/wand.png", true, array ("title" => __('Visual Console Template Wizard'))) .'' + ); +} + +if (!$is_metaconsole) { ui_print_page_header( __('Reporting') .' » ' . __('Visual Favourite Console'), "images/op_reporting.png", false, "map_builder", false, $buttons); } +else{ + ui_meta_print_header( + __('Visual console') . " » " . $visualConsoleName, "", + $buttons); +} $search = (string) get_parameter("search",""); $ag_group = (int) get_parameter("ag_group",0); @@ -48,7 +91,7 @@ if(!is_metaconsole()){ action='index.php?sec=network&sec2=godmode/reporting/visual_console_favorite'>"; } else { echo "
"; + action='index.php?sec=screen&sec2=screens/screens&action=visualmap_favorite'>"; } echo ""; echo "
"; @@ -103,12 +146,17 @@ echo "
"; } else{ echo "