From 8f1232f9e7db9bf3fb5566069e4c1c801b0f6c0f Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Wed, 31 Jul 2013 17:18:11 +0000 Subject: [PATCH] 2013-07-31 Miguel de Dios * godmode/reporting/visual_console_builder.php: change the code to show the tabs in metaconsole after create a new visualmap. * include/functions_ui.php: fixed into the function "ui_print_agent_autocomplete_input" the parameter "input_id_server_name" for metaconsole. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8608 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 9 ++++ .../reporting/visual_console_builder.php | 47 ++++++++++++------- pandora_console/include/functions_ui.php | 4 +- 3 files changed, 40 insertions(+), 20 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 264d839551..2bf2018663 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,12 @@ +2013-07-31 Miguel de Dios + + * godmode/reporting/visual_console_builder.php: change the code + to show the tabs in metaconsole after create a new visualmap. + + * include/functions_ui.php: fixed into the function + "ui_print_agent_autocomplete_input" the parameter + "input_id_server_name" for metaconsole. + 2013-07-31 Miguel de Dios * include/functions_ui.php: reduced the char lenght of title in diff --git a/pandora_console/godmode/reporting/visual_console_builder.php b/pandora_console/godmode/reporting/visual_console_builder.php index 76f7556709..f7a317d906 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.php +++ b/pandora_console/godmode/reporting/visual_console_builder.php @@ -14,6 +14,7 @@ // Login check global $config; +global $statusProcessInDB; check_login (); @@ -52,7 +53,9 @@ $refr = (int) get_parameter ('refr', $config['vc_refr']); //Save/Update data in DB -$statusProcessInDB = null; +global $statusProcessInDB; +if (empty($statusProcessInDB)) + $statusProcessInDB = null; switch ($activeTab) { case 'data': switch ($action) { @@ -68,10 +71,12 @@ switch ($activeTab) { $background = get_parameter('background'); $visualConsoleName = get_parameter('name'); - $values = array('name' => $visualConsoleName, 'id_group' => $idGroup, 'background' => $background); + $values = array('name' => $visualConsoleName, + 'id_group' => $idGroup, 'background' => $background); // If the background is changed the size is reseted - $visualConsole = db_get_row_filter('tlayout', array('id' => $idVisualConsole)); + $visualConsole = db_get_row_filter('tlayout', + array('id' => $idVisualConsole)); $background_now = $visualConsole['background']; if ($background_now != $background && $background) { $sizeBackground = getimagesize($config['homedir'] . '/images/console/background/' . $background); @@ -96,27 +101,33 @@ switch ($activeTab) { break; case 'save': - if ($values['name'] != "" && $values['background']) - $idVisualConsole = db_process_sql_insert('tlayout', $values); - else - $idVisualConsole = false; - - if ($idVisualConsole !== false) { - db_pandora_audit( "Visual console builder", "Create visual console #$idVisualConsole"); - $action = 'edit'; - $statusProcessInDB = array('flag' => true, 'message' => ui_print_success_message(__('Successfully created.'), '', true)); - } - else { - db_pandora_audit( "Visual console builder", "Fail try to create visual console"); - $statusProcessInDB = array('flag' => false, 'message' => ui_print_error_message(__('Could not be created.'), '', true)); + if (!defined('METACONSOLE')) { + if ($values['name'] != "" && $values['background']) + $idVisualConsole = db_process_sql_insert('tlayout', $values); + else + $idVisualConsole = false; + + if ($idVisualConsole !== false) { + db_pandora_audit( "Visual console builder", "Create visual console #$idVisualConsole"); + $action = 'edit'; + $statusProcessInDB = array('flag' => true, + 'message' => ui_print_success_message(__('Successfully created.'), '', true)); + } + else { + db_pandora_audit( "Visual console builder", "Fail try to create visual console"); + $statusProcessInDB = array('flag' => false, + 'message' => ui_print_error_message(__('Could not be created.'), '', true)); + } } break; } - $visualConsole = db_get_row_filter('tlayout', array('id' => $idVisualConsole)); + $visualConsole = db_get_row_filter('tlayout', + array('id' => $idVisualConsole)); break; case 'edit': - $visualConsole = db_get_row_filter('tlayout', array('id' => $idVisualConsole)); + $visualConsole = db_get_row_filter('tlayout', + array('id' => $idVisualConsole)); $visualConsoleName = $visualConsole['name']; $idGroup = $visualConsole['id_group']; $background = $visualConsole['background']; diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 1aa1a10b32..c4ca4f035b 100644 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -2615,8 +2615,8 @@ function ui_print_agent_autocomplete_input($parameters) { $input_id_server_name = uniqid('server_'); //Default value - if (isset($parameters['input_id_server_id'])) { - $input_id_server_id = $parameters['input_id_server_id']; + if (isset($parameters['input_id_server_name'])) { + $input_id_server_name = $parameters['input_id_server_name']; }