From e4251a348de1d725b7c61f754d41a6a3f72193b8 Mon Sep 17 00:00:00 2001 From: alexhigh Date: Tue, 17 Jun 2014 17:04:59 +0000 Subject: [PATCH] 2014-06-17 Alejandro Gallardo * godmode/reporting/visual_console_builder.editor.js: Modified the function "loadFieldsFromDB" to fix the graph type selection. * include/functions_visual_map_editor.php: Visual changes on the form created by the function "visual_map_editor_print_item_palette". git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10223 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 10 +++++++ .../visual_console_builder.editor.js | 26 +++++++++++-------- .../include/functions_visual_map_editor.php | 13 +++++----- 3 files changed, 31 insertions(+), 18 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 157a9f8403..2ca3e53de9 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,13 @@ +2014-06-17 Alejandro Gallardo + + * godmode/reporting/visual_console_builder.editor.js: + Modified the function "loadFieldsFromDB" to fix the graph + type selection. + + * include/functions_visual_map_editor.php: Visual changes + on the form created by the function + "visual_map_editor_print_item_palette". + 2014-06-17 Sergio Martin * include/graphs/functions_flot.php: Fix height of the diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index 164d701543..0bc749db0f 100644 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -585,14 +585,6 @@ function loadFieldsFromDB(item) { } - if (key == 'id_custom_graph') { - $("input[name='radio_choice'][value='custom_graph']") - .prop('checked', true); - $("input[name='radio_choice']").trigger('change'); - $("#custom_graph option[value=" + val + "]") - .prop("selected", true); - } - if (metaconsole != 0) { if (key == 'id_agent') { $("#hidden-agent").val(val); @@ -602,13 +594,25 @@ function loadFieldsFromDB(item) { } } }); + + if (data.type == 1) { + if (data.id_custom_graph > 0) { + $("input[name='radio_choice'][value='custom_graph']") + .prop('checked', true); + $("input[name='radio_choice']").trigger('change'); + $("#custom_graph option[value=" + data.id_custom_graph + "]") + .prop("selected", true); + } + else { + $("input[name='radio_choice'][value='module_graph']") + .prop('checked', true); + $("input[name='radio_choice']").trigger('change'); + } + } if (typeof(enterprise_loadFieldsFromDB) == 'function') { enterprise_loadFieldsFromDB(data); } - - - } }); } diff --git a/pandora_console/include/functions_visual_map_editor.php b/pandora_console/include/functions_visual_map_editor.php index d30be72aa8..971c24dcb9 100644 --- a/pandora_console/include/functions_visual_map_editor.php +++ b/pandora_console/include/functions_visual_map_editor.php @@ -146,13 +146,12 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { 'datos'); $form_items['radio_choice_graph']['html'] = ' - ' . - html_print_radio_button('radio_choice', - 'module_graph', __('Module graph'), 'module_graph', - true) . - html_print_radio_button('radio_choice', - 'custom_graph', __('Custom graph'), 'module_graph', - true) . + ' + . __('Module graph') . "  " . + html_print_radio_button('radio_choice', 'module_graph', '', 'module_graph', true) + . "    " + . __('Custom graph') . "  " . + html_print_radio_button('radio_choice', 'custom_graph', '', 'module_graph', true) . '';