diff --git a/pandora_console/godmode/reporting/visual_console_template.php b/pandora_console/godmode/reporting/visual_console_template.php index 2a0c5952c7..074a8648b7 100644 --- a/pandora_console/godmode/reporting/visual_console_template.php +++ b/pandora_console/godmode/reporting/visual_console_template.php @@ -18,8 +18,8 @@ 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"); if (!$vconsoles_read && !$vconsoles_write && !$vconsoles_manage) { @@ -69,5 +69,65 @@ if (!defined('METACONSOLE')) { ); } +$id_layout = (int) get_parameter ('id_layout', 0); +$name_template = (string) get_parameter ('name_template', ''); +$group = (int) get_parameter ('group'); +$action = (string) get_parameter ('action', ''); + +if($action == "create_template"){ + +} + +if($action == "delete_template"){ + +} + +$visual_console_array = visual_map_get_user_layouts($config['id_user'], true); + +if (!check_acl ($config['id_user'], 0, "VR")){ + $return_all_group = false; +} +else{ + $return_all_group = true; +} + +$table = '
'; + +echo ui_toggle($table, __('Create New Template'), '', false, true); + ?> \ No newline at end of file diff --git a/pandora_console/godmode/reporting/visual_console_template_wizard.php b/pandora_console/godmode/reporting/visual_console_template_wizard.php index bcedbabd0b..76ac71b03d 100644 --- a/pandora_console/godmode/reporting/visual_console_template_wizard.php +++ b/pandora_console/godmode/reporting/visual_console_template_wizard.php @@ -68,4 +68,138 @@ if (!defined('METACONSOLE')) { $buttons ); } + + +$templates = reporting_enterprise_get_template_reports(array ('order' => 'id_group, name'), array('id_report', 'name'), true); + +$template_select = array(); +if ($templates === false) + $template_select = array(); +else { + $groups = array(__('All') => 0); + foreach ($templates as $template) { + $id_group = $template['id_group']; + $group_name = ''; + + if (!isset($groups[$id_group])) + $groups[$id_group] = groups_get_name($id_group, true); + + if (!empty($groups[$id_group])) + $group_name = $groups[$id_group]; + + $template_select[$template['id_report']] = array('optgroup' => $group_name, 'name' => $template['name']); + } +} + +if (is_metaconsole()) { + $keys_field = 'nombre'; +} +else { + $keys_field = 'id_grupo'; +} + +$attr_available = array('id' => 'image-select_all_available', 'title' => __('Select all'), 'style' => 'cursor: pointer;'); +$attr_apply = array('id' => 'image-select_all_apply', 'title' => __('Select all'), 'style' => 'cursor: pointer;'); + +$table = ''; + +echo $table; + ?> \ No newline at end of file