From 7414748d737efa51b67fa05c91df183658a16aff Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Tue, 29 Jun 2010 12:58:54 +0000 Subject: [PATCH] 2010-06-29 Sergio Martin * godmode/reporting/visual_console_builder.editor.js godmode/reporting/visual_console_builder.editor.php: Fixed storing of width and height of the background of the visual map git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2933 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 6 ++++++ .../reporting/visual_console_builder.editor.js | 4 ++++ .../reporting/visual_console_builder.editor.php | 11 +++++------ 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index f42d7fe53a..2aa4229c47 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2010-06-29 Sergio Martin + + * godmode/reporting/visual_console_builder.editor.js + godmode/reporting/visual_console_builder.editor.php: Fixed + storing of width and height of the background of the visual map + 2010-06-29 Sergio Martin * include/Image/image_functions.php: Reverted an diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index 30dca8f7b0..1599dab23d 100644 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -171,6 +171,10 @@ function readFields() { values['period'] = $("select[name=period]").val(); values['width'] = $("input[name=width]").val(); values['height'] = $("input[name=height]").val(); + if(values['width'] == 0 && values['height'] == 0) { + values['width'] = $("#hidden-background_original_width").val(); + values['height'] = $("#hidden-background_original_height").val(); + } values['parent'] = $("select[name=parent]").val(); values['map_linked'] = $("select[name=map_linked]").val(); values['label_color'] = $("input[name=label_color]").val(); diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.php b/pandora_console/godmode/reporting/visual_console_builder.editor.php index 68cb1c67ca..45b2bc8e8f 100644 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.php +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.php @@ -63,12 +63,6 @@ $background = $visualConsole['background']; $widthBackground = $visualConsole['width']; $heightBackground = $visualConsole['height']; -if (($widthBackground == 0) && ($heightBackground == 0)) { - $backgroundSizes = getimagesize('images/console/background/' . $background); - $widthBackground = $backgroundSizes[0]; - $heightBackground = $backgroundSizes[1]; -} - $layoutDatas = get_db_all_rows_field_filter ('tlayout_data', 'id_layout', $idVisualConsole); if ($layoutDatas === false) $layoutDatas = array(); @@ -235,6 +229,11 @@ echo ''; print_input_hidden('background_width', $widthBackground); print_input_hidden('background_height', $heightBackground); + +$backgroundSizes = getimagesize('images/console/background/' . $background); + +print_input_hidden('background_original_width', $backgroundSizes[0]); +print_input_hidden('background_original_height', $backgroundSizes[1]); echo ""; //Hack to translate messages in javascript