From ef2ff495046c135045d9eb0dbe4288ac8435f42f Mon Sep 17 00:00:00 2001 From: daniel Date: Thu, 2 Aug 2018 11:03:13 +0200 Subject: [PATCH] mv enterprise visual console template --- .../reporting/visual_console_template.php | 196 ------ .../visual_console_template_wizard.php | 665 ------------------ 2 files changed, 861 deletions(-) delete mode 100644 pandora_console/godmode/reporting/visual_console_template.php delete mode 100644 pandora_console/godmode/reporting/visual_console_template_wizard.php diff --git a/pandora_console/godmode/reporting/visual_console_template.php b/pandora_console/godmode/reporting/visual_console_template.php deleted file mode 100644 index 77f2693bf4..0000000000 --- a/pandora_console/godmode/reporting/visual_console_template.php +++ /dev/null @@ -1,196 +0,0 @@ - false, - 'text' => '' . - html_print_image ("images/visual_console.png", true, array ("title" => __('Visual Console List'))) .'' -); - -$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' => true, - '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 (!defined('METACONSOLE')) { - ui_print_page_header( - __('Visual Console') .' » ' . __('Template'), - "images/op_reporting.png", - false, - "map_builder", - false, - $buttons - ); -} - -$id_layout = (int) get_parameter ('id_layout', 0); -$name_template = (string) get_parameter ('name_template', ''); -$group = (int) get_parameter ('group', 0); -$action = (string) get_parameter ('action', ''); - -if($action == "create_template"){ - if(!$id_layout){ - ui_print_error_message(__('visual console has not been selected')); - } - - $result = visual_map_create_template($id_layout, $name_template, $group); - - if(!$result){ - ui_print_error_message(__('Error. Error created template')); - } - else{ - ui_print_success_message(__('Successfully created template')); - } -} - -if($action == "delete_template"){ - if(!$id_layout){ - ui_print_error_message(__('visual console has not been selected')); - } - - $result = visual_map_delete_template($id_layout); - - if(!$result){ - ui_print_error_message(__('Error. Error delete template')); - } - else{ - ui_print_success_message(__('Successfully 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 = '
'; -$table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; -$table .= "
"; - $table .= "" . __("Create From") . ":"; - $table .= ""; - $table .= html_print_select($visual_console_array, 'id_layout', $id_layout, '', __('none'), 0, true); - $table .= "
"; - $table .= "" . __("Name") . ":"; - $table .= ""; - $table .= html_print_input_text ('name_template', $name_template, '', 50, 255, true); - $table .= "
"; - $table .= '' . __("Group") . ':'; - $table .= ""; - $table .= html_print_select_groups(false, "AR", $return_all_group, "group", $group, 'this.form.submit();', '', 0, true, false, true, '', false); - $table .= "
"; - -if (check_acl ($config['id_user'], 0, "RW")) { - $table .= '
'; - $table .= html_print_input_hidden('action', 'create_template', true); - $table .= html_print_submit_button (__('Create template'), 'apply', false, 'class="sub next"', true); - $table .= '
'; -} -$table .= '
'; - -echo ui_toggle($table, __('Create New Template'), '', false, true); - -$array_template_visual_console = visual_map_get_user_layout_templates($config['id_user']); - -if($array_template_visual_console && is_array($array_template_visual_console)){ - $table = new stdClass(); - $table->width = '100%'; - $table->class = 'databox data'; - $table->data = array (); - $table->head = array (); - $table->head[0] = __('Name'); - $table->head[1] = __('Group'); - $table->head[2] = __('Fovourite'); - $table->head[3] = __('Delete'); - $table->size[3] = "6%"; - - $table->align = array (); - $table->align[0] = 'left'; - $table->align[1] = 'left'; - $table->align[2] = 'left'; - $table->align[3] = 'left'; - - foreach ($array_template_visual_console as $key => $value) { - $data = array (); - $data[0] = $value['name']; - $data[1] = $value['id_group']; - $data[2] = $value['is_favourite']; - $data[3] = ''.html_print_image ("images/cross.png", true).''; - array_push ($table->data, $data); - } - - html_print_table ($table); -} -else{ - ui_print_info_message(__('No data to show')); -} - - -?> \ 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 deleted file mode 100644 index 6351f4525d..0000000000 --- a/pandora_console/godmode/reporting/visual_console_template_wizard.php +++ /dev/null @@ -1,665 +0,0 @@ - false, - 'text' => '' . - html_print_image ("images/visual_console.png", true, array ("title" => __('Visual Console List'))) .'' -); - -$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' => true, - 'text' => '' . - html_print_image ("images/wand.png", true, array ("title" => __('Visual Console Template Wizard'))) .'' - ); -} - -if (!defined('METACONSOLE')) { - ui_print_page_header( - __('Visual Console') .' » ' . __('Wizard'), - "images/op_reporting.png", - false, - "map_builder", - false, - $buttons - ); -} - -$action = get_parameter ('action', ''); - -if ($action == 'apply') { - $agents_selected = (array) get_parameter('id_agents2'); - $id_layout_template = get_parameter('templates'); - $name = get_parameter('template_report_name', ''); - $group = get_parameter('template_report_group'); - - if (empty($agents_selected) || empty($id_layout_template)) - $result = false; - else { - if($agents_selected && is_array($agents_selected)){ - foreach ($agents_selected as $key => $value) { - $result = visual_map_instanciate_template( - $id_layout_template, - $name, - $value - ); - } - } - } - - if ($result){ - ui_print_success_message(__('Sucessfully applied')); - } - else{ - ui_print_error_message(__('Could not be applied')); - } -} - -$templates = visual_map_get_user_layout_templates($config['id_user'], true); - -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 = '
'; -$table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; -$table .= "
"; - $table .= "" . __('Templates') . ":"; - $table .= ""; - $table .= html_print_select($templates, 'templates', $id_layout_template, '', __('None'), '0', true, false, true, '', false, 'width:180px;'); - $table .= ""; - $table .= "" . __('Report name') . " " . - ui_print_help_tip(__('Left in blank if you want to use default name: Template name - agents (num agents) - Date'), true) . ":"; - $table .= ""; - $table .= html_print_input_text ('template_report_name', '', '', 80, 150, true); - $table .= "
"; - $table .= '' . __('Filter group') . ':'; - $table .= ""; - $table .= html_print_select_groups( - false, "RR", users_can_manage_group_all("RR"), - 'group', '', '', '', 0, true, false, false, - '', false, false, false, false, $keys_field - ); - $table .= ""; - $table .= "" . __('Target group') . ":"; - $table .= ""; - $table .= html_print_select_groups( - false, "RR", users_can_manage_group_all("RR"), - 'template_report_group', '', '', '', 0, true, - false, false, '', false, false, false, false, - $keys_field - ); - $table .= "
"; - $table .= '' . __('Filter agent') . ':'; - $table .= ""; - $table .= html_print_input_text ('agent_filter', $agent_filter, '', 20, 150, true); - $table .= ""; - $table .= ''; - $table .= ""; - $table .= ''; - $table .= "
"; - $table .= "" . __('Agents available')."  " . - html_print_image ('images/tick.png', true, $attr_available, false, true); - $table .= ""; - $table .= "" . __('Agents to apply')."  " . - html_print_image ('images/tick.png', true, $attr_apply, false, true); - $table .= "
"; - $option_style = array(); - $template_agents_in = array(); - $template_agents_all = array(); - $template_agents_out = array(); - $template_agents_out = array_diff_key($template_agents_all, $template_agents_in); - $template_agents_in_keys = array_keys($template_agents_in); - $template_agents_out_keys = array_keys($template_agents_out); - - $table .= html_print_select ($template_agents_out, 'id_agents[]', 0, false, '', '', true, true, true, '', false, 'width: 100%;', $option_style); - $table .= ""; - $table .= html_print_image ('images/darrowright.png', true, array ('id' => 'right', 'title' => __('Add agents to template'))); - $table .= html_print_image ('images/darrowleft.png', true, array ('id' => 'left', 'title' => __('Undo agents to template'))); - $table .= ""; - $table .= $option_style = array(); - //Agents applied to the template - $table .= html_print_select ($template_agents_in, 'id_agents2[]', 0, false, '', '', true, true, true, '', false, 'width: 100%;', $option_style); - $table .= "
"; - -html_print_input_hidden('separator', $separator); -html_print_input_hidden('agents_in', implode($separator, $template_agents_in)); -html_print_input_hidden('agents_in_keys', implode($separator, $template_agents_in_keys)); -html_print_input_hidden('agents_out', implode($separator, $template_agents_out)); -html_print_input_hidden('agents_out_keys', implode($separator, $template_agents_out_keys)); - -if (check_acl ($config['id_user'], 0, "RW")) { - $table .= '
'; - $table .= html_print_input_hidden('action', 'apply', true); - $table .= html_print_submit_button (__('Apply template'), 'apply', false, 'class="sub next"', true); - $table .= '
'; -} -$table .= '
'; - -echo $table; - -?> - \ No newline at end of file