From c7bb400a333728a82633d59f8bd60ce4e70fa07e Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Thu, 29 Apr 2010 11:20:51 +0000 Subject: [PATCH] 2010-04-29 Sergio Martin * godmode/reporting/visual_console_builder.php: Fixed that was allowed to create a visual map without name and without background. Bug: 2993503 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2636 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 6 ++++++ .../reporting/visual_console_builder.php | 17 ++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 636745f726..70b87ec7d0 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2010-04-29 Sergio Martin + + * godmode/reporting/visual_console_builder.php: Fixed that + was allowed to create a visual map without name and without + background. Bug: 2993503 + 2010-04-29 Sergio Martin * include/functions_visual_map.php: Fixed the critical render diff --git a/pandora_console/godmode/reporting/visual_console_builder.php b/pandora_console/godmode/reporting/visual_console_builder.php index 508b886c4e..1329dd5723 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.php +++ b/pandora_console/godmode/reporting/visual_console_builder.php @@ -58,7 +58,11 @@ switch ($activeTab) { } break; case 'save': - $idVisualConsole = process_sql_insert('tlayout', $values); + if($values['name'] != "" && $values['background']) + $idVisualConsole = process_sql_insert('tlayout', $values); + else + $idVisualConsole = false; + if ($idVisualConsole !== false) { $action = 'edit'; $statusProcessInDB = array('flag' => true, 'message' => '

'.__('Successfully created.').'

'); @@ -175,8 +179,15 @@ $buttons = array( 'text' => '' . print_image ("images/eye.png", true, array ("title" => __('Preview'))) .''),); -if ($action == 'new') $buttons = array('data' => $buttons['data']); //Show only the data tab +if ($action == 'new' || $idVisualConsole === false){ + $buttons = array('data' => $buttons['data']); //Show only the data tab + // If it is a fail try, reset the values + $action = 'new'; + $visualConsoleName = ""; +} + $buttons[$activeTab]['active'] = true; + print_page_header(__('Visual console builder') . " " . $visualConsoleName, "", false, "visual_console_editor_" . $activeTab . "_tab", true, $buttons); //The source code for PAINT THE PAGE @@ -201,4 +212,4 @@ switch ($activeTab) { require_once('godmode/reporting/visual_console_builder.preview.php'); break; } -?> \ No newline at end of file +?>