diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 8cef414be6..5ec18fa2e1 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,23 @@ +2012-04-24 Miguel de Dios + + * install.php: cleaned source code style. + + * include/functions_graph.php: added into the src attribute the + $config['homeurl'] in the functions "progress_bar" and + "progress_bubble" to show the images in other paths that usually + path. + + * include/functions_ui.php: fixed into the function + "ui_process_page_head" when try to use in others paths that usually + path (like as homeurl) and this bug have been for js and css. + + * operation/visual_console/public_console.php: fixed and re-design + the page. + + Fixes: #3520670 + + MERGED FROM 4.0.2 + 2012-04-24 Miguel de Dios * include/Image/image_functions.php: fixed into the function @@ -7,6 +27,8 @@ * include/config_process.php: disabled warning message of PHP5 about the timezone. + Fixes: #3520657 + MERGED FROM 4.0.2 2012-04-24 Juan Manuel Ramon diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index e970e59ce2..abf0aee0bc 100755 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -493,13 +493,12 @@ function graphic_combined_module ($module_list, $weight_list, $period, $width, $ } // Added support for projection graphs (normal_module + 1(prediction data)) - if ($projection !== false) { + if ($projection !== false){ $module_number = count ($module_list) + 1; - } - else { + }else{ $module_number = count ($module_list); } - + // interval - This is the number of "rows" we are divided the time to fill data. // more interval, more resolution, and slower. // periodo - Gap of time, in seconds. This is now to (now-periodo) secs @@ -970,7 +969,7 @@ function progress_bar($progress, $width, $height, $title = '', $mode = 1, $value include_graphs_dependencies($config['homedir'].'/'); return "" . $title . " %d %s", $time["1month"], $query), 0, true); $data["3 ".__("Months")] += db_get_sql (sprintf ("SELECT COUNT(*) FROM tagente_datos_string WHERE utimestamp > %d %s", $time["3month"], $query), 0, true); $data[__("Older")] += db_get_sql (sprintf ("SELECT COUNT(*) FROM tagente_datos_string WHERE 1=1 %s", $query), 0, true); - + $data[__("Today")] += db_get_sql (sprintf ("SELECT COUNT(*) FROM tagente_datos_log4x WHERE utimestamp > %d %s", $time["1day"], $query), 0, true); $data["1 ".__("Week")] += db_get_sql (sprintf ("SELECT COUNT(*) FROM tagente_datos_log4x WHERE utimestamp > %d %s", $time["1week"], $query), 0, true); $data["1 ".__("Month")] += db_get_sql (sprintf ("SELECT COUNT(*) FROM tagente_datos_log4x WHERE utimestamp > %d %s", $time["1month"], $query), 0, true); $data["3 ".__("Months")] += db_get_sql (sprintf ("SELECT COUNT(*) FROM tagente_datos_log4x WHERE utimestamp > %d %s", $time["3month"], $query), 0, true); $data[__("Older")] += db_get_sql (sprintf ("SELECT COUNT(*) FROM tagente_datos_log4x WHERE 1=1 %s", $query), 0, true); - + $data[__("Older")] = $data[__("Older")] - $data["3 ".__("Months")]; if ($data[__("Today")] == 0 && $data["1 ".__("Week")] == 0 && @@ -1216,7 +1215,7 @@ function graphic_user_activity ($width = 350, $height = 230) { function grafico_incidente_prioridad () { global $config; global $graphic_type; - + $data_tmp = array (0, 0, 0, 0, 0, 0); $sql = 'SELECT COUNT(id_incidencia) n_incidents, prioridad FROM tincidencia @@ -1286,7 +1285,7 @@ function graph_incidents_status () { function graphic_incident_group () { global $config; global $graphic_type; - + $data = array (); $max_items = 5; $sql = sprintf ('SELECT COUNT(id_incidencia) n_incidents, nombre @@ -1329,7 +1328,7 @@ function graphic_incident_group () { function graphic_incident_user () { global $config; global $graphic_type; - + $data = array (); $max_items = 5; $sql = sprintf ('SELECT COUNT(id_incidencia) n_incidents, id_usuario @@ -1348,7 +1347,7 @@ function graphic_incident_user () { else { $name = $incident['id_usuario']; } - + $data[$name] = $incident['n_incidents']; } diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index cfcb7c5d36..f2bd2d994b 100644 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -1038,7 +1038,7 @@ function ui_process_page_head ($string, $bitfield) { '; - + if ($config["language"] != "en") { //Load translated strings - load them last so they overload all the objects ui_require_javascript_file ("time_".$config["language"]); @@ -1051,7 +1051,7 @@ function ui_process_page_head ($string, $bitfield) { if (empty ($config['css'])) { $config['css'] = array (); } - + $login_ok = true; if (! isset ($config['id_user']) && isset ($_GET["login"])) { if (isset($_POST['nick']) and isset($_POST['pass'])) { @@ -1059,7 +1059,7 @@ function ui_process_page_head ($string, $bitfield) { $pass = get_parameter_post ("pass"); //This is the variable with the password $nick = db_escape_string_sql($nick); $pass = db_escape_string_sql($pass); - + // process_user_login is a virtual function which should be defined in each auth file. // It accepts username and password. The rest should be internal to the auth file. // The auth file can set $config["auth_error"] to an informative error output or reference their internal error messages to it @@ -1071,7 +1071,7 @@ function ui_process_page_head ($string, $bitfield) { } } } - + //First, if user has assigned a skin then try to use css files of skin subdirectory $isFunctionSkins = enterprise_include_once ('include/functions_skins.php'); if (!$login_ok) { @@ -1079,7 +1079,7 @@ function ui_process_page_head ($string, $bitfield) { enterprise_hook('skins_cleanup'); } } - + $exists_css = false; if ($login_ok and $isFunctionSkins !== ENTERPRISE_NOT_HOOK) { //Checks if user's skin is available @@ -1088,28 +1088,28 @@ function ui_process_page_head ($string, $bitfield) { $skin_path = enterprise_hook('skins_get_skin_path'); $skin_styles = themes_get_css ($skin_path . 'include/styles/'); $exists_css = !empty($skin_styles); - } + } } //If skin's css files exists then add them - if ($exists_css){ + if ($exists_css) { foreach ($skin_styles as $filename => $name){ $style = substr ($filename, 0, strlen ($filename) - 4); $config['css'][$style] = $skin_path . 'include/styles/' . $filename; } } //Otherwise assign default and user's css - else{ + else { //User style should go last so it can rewrite common styles $config['css'] = array_merge (array ( "common" => "include/styles/common.css", "menu" => "include/styles/menu.css", "tip", "include/styles/tip.css", $config['style'] => "include/styles/".$config['style'].".css"), $config['css']); - } + } //We can't load empty and we loaded (conditionally) ie $loaded = array ('', 'ie'); - + foreach ($config['css'] as $name => $filename) { if (in_array ($name, $loaded)) continue; @@ -1123,8 +1123,9 @@ function ui_process_page_head ($string, $bitfield) { //Remove comments $output .= preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $style); $output .= ''; - } else { - $output .= ''."\n\t"; + } + else { + $output .= ''."\n\t"; } } //End load CSS @@ -1151,11 +1152,11 @@ function ui_process_page_head ($string, $bitfield) { $output .= "\n".'/* ]]> */'; } else { - $output .= ''."\n\t"; + $output .= ''."\n\t"; } } //End load JS - + //Load jQuery if (empty ($config['jquery'])) { $config['jquery'] = array (); //If it's empty, false or not init set array to empty just in case @@ -1207,9 +1208,9 @@ function ui_process_page_head ($string, $bitfield) { $output .= ''; - + $output .= $string; - + if (!empty ($config["compact_header"])) { $output = str_replace(array("\r\n", "\r", "\n", "\t", ' ', ' ', ' '), '', $output); } diff --git a/pandora_console/operation/visual_console/public_console.php b/pandora_console/operation/visual_console/public_console.php index 2df09315da..4f25295138 100644 --- a/pandora_console/operation/visual_console/public_console.php +++ b/pandora_console/operation/visual_console/public_console.php @@ -64,11 +64,12 @@ $background = $layout["background"]; $bwidth = $layout["width"]; $bheight = $layout["height"]; -$pure_url = "&pure=".$config["pure"]; +if (!isset($config['pure'])) + $config['pure'] = 0; // Render map $options = array(); - +echo '
'; echo "

". $layout_name. "

"; visual_map_print_visual_map ($id_layout, true, true, null, null, '../../'); @@ -98,7 +99,7 @@ $table->data[0][2] = html_print_submit_button (__('Refresh'), '', false, 'class= $table->data[0][2] .= html_print_input_hidden ('vc_refr', $config["vc_refr"], true); if ($vc_refr){ - $config["vc_refr"] = 0; + $config["vc_refr"] = 0; } echo '
 
'; @@ -114,6 +115,7 @@ html_print_input_hidden ('pure', $config["pure"]); html_print_input_hidden ('id', $id_layout); html_print_table ($table); echo ''; +echo '
'; if ($config["pure"] && $config["refr"] != 0) { ui_require_jquery_file ('countdown'); @@ -127,7 +129,7 @@ ui_require_javascript_file ('pandora_visual_console'); $(document).ready (function () { $("#refr").change(function () { $("#hidden-vc_refr").val($("#refr option:selected").val()); - }); + }); 0): ?> t = new Date();