2012-04-24 Miguel de Dios <miguel.dedios@artica.es>
* 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 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6134 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
0b01ae6fc6
commit
a380cb1f90
|
@ -1,3 +1,23 @@
|
|||
2012-04-24 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* 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 <miguel.dedios@artica.es>
|
||||
|
||||
* 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 <juanmanuel.ramon@artica.es>
|
||||
|
|
|
@ -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 "<img title='" . $title . "' alt='" . $title . "'" .
|
||||
" src='include/graphs/fgraph.php?homeurl=../../&graph_type=progressbar" .
|
||||
" src='" . $config['homeurl'] . "/include/graphs/fgraph.php?homeurl=../../&graph_type=progressbar" .
|
||||
"&width=".$width."&height=".$height."&progress=".$progress.
|
||||
"&mode=" . $mode . "&out_of_lim_str=".$out_of_lim_str .
|
||||
"&title=".$title."&font=".$config['fontpath']."&value_text=". $value_text .
|
||||
|
@ -997,7 +996,7 @@ function progress_bubble($progress, $width, $height, $title = '', $mode = 1, $va
|
|||
include_graphs_dependencies($config['homedir'].'/');
|
||||
|
||||
return "<img title='" . $title . "' alt='" . $title . "'" .
|
||||
" src='include/graphs/fgraph.php?homeurl=../../&graph_type=progressbubble" .
|
||||
" src='" . $config['homeurl'] . "/include/graphs/fgraph.php?homeurl=../../&graph_type=progressbubble" .
|
||||
"&width=".$width."&height=".$height."&progress=".$progress.
|
||||
"&mode=" . $mode . "&out_of_lim_str=".$out_of_lim_str .
|
||||
"&title=".$title."&font=".$config['fontpath']."&value_text=". $value_text .
|
||||
|
@ -1006,10 +1005,10 @@ function progress_bubble($progress, $width, $height, $title = '', $mode = 1, $va
|
|||
|
||||
function graph_sla_slicebar ($id, $period, $sla_min, $sla_max, $date, $daysWeek = null, $time_from = null, $time_to = null, $width, $height, $home_url) {
|
||||
global $config;
|
||||
|
||||
|
||||
$data = reporting_get_agentmodule_sla_array ($id, $period, $sla_min, $sla_max, $date, $daysWeek, $time_from, $time_to);
|
||||
$colors = array(1 => '#38B800', 2 => '#FFFF00', 3 => '#FF0000', 4 => '#C3C3C3');
|
||||
|
||||
|
||||
return slicesbar_graph($data, $period, $width, $height, $colors, $config['fontpath'],
|
||||
$config['round_corner'], $home_url);
|
||||
}
|
||||
|
@ -1036,16 +1035,16 @@ function grafico_db_agentes_purge ($id_agent, $width = 380, $height = 300) {
|
|||
|
||||
// All data (now)
|
||||
$time["all"] = get_system_time ();
|
||||
|
||||
|
||||
// 1 day ago
|
||||
$time["1day"] = $time["all"] - 86400;
|
||||
|
||||
|
||||
// 1 week ago
|
||||
$time["1week"] = $time["all"] - 604800;
|
||||
|
||||
|
||||
// 1 month ago
|
||||
$time["1month"] = $time["all"] - 2592000;
|
||||
|
||||
|
||||
// Three months ago
|
||||
$time["3month"] = $time["all"] - 7776000;
|
||||
|
||||
|
@ -1060,13 +1059,13 @@ function grafico_db_agentes_purge ($id_agent, $width = 380, $height = 300) {
|
|||
$data["1 ".__("Month")] += db_get_sql (sprintf ("SELECT COUNT(*) FROM tagente_datos_string WHERE utimestamp > %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'];
|
||||
}
|
||||
|
||||
|
|
|
@ -1038,7 +1038,7 @@ function ui_process_page_head ($string, $bitfield) {
|
|||
<link rel="icon" href="images/pandora.ico" type="image/ico" />
|
||||
<link rel="shortcut icon" href="images/pandora.ico" type="image/x-icon" />
|
||||
<link rel="alternate" href="operation/events/events_rss.php" title="Pandora RSS Feed" type="application/rss+xml" />';
|
||||
|
||||
|
||||
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 .= '</style>';
|
||||
} else {
|
||||
$output .= '<link rel="stylesheet" href="'.$filename.'" type="text/css" />'."\n\t";
|
||||
}
|
||||
else {
|
||||
$output .= '<link rel="stylesheet" href="' . $config['homeurl'] . '/' .$filename.'" type="text/css" />'."\n\t";
|
||||
}
|
||||
}
|
||||
//End load CSS
|
||||
|
@ -1151,11 +1152,11 @@ function ui_process_page_head ($string, $bitfield) {
|
|||
$output .= "\n".'/* ]]> */</script>';
|
||||
}
|
||||
else {
|
||||
$output .= '<script type="text/javascript" src="'.$filename.'"></script>'."\n\t";
|
||||
$output .= '<script type="text/javascript" src="'. $config['homeurl'] . '/' .$filename.'"></script>'."\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 .= '<!--[if gte IE 6]>
|
||||
<link rel="stylesheet" href="include/styles/ie.css" type="text/css"/>
|
||||
<![endif]-->';
|
||||
|
||||
|
||||
$output .= $string;
|
||||
|
||||
|
||||
if (!empty ($config["compact_header"])) {
|
||||
$output = str_replace(array("\r\n", "\r", "\n", "\t", ' ', ' ', ' '), '', $output);
|
||||
}
|
||||
|
|
|
@ -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 '<div style="width: 95%; background: white; margin: 20px auto 20px auto; box-shadow: 10px 10px 5px #000;">';
|
||||
echo "<h1>". $layout_name. "</h1>";
|
||||
|
||||
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 '<div style="height:30px"> </div>';
|
||||
|
@ -114,6 +115,7 @@ html_print_input_hidden ('pure', $config["pure"]);
|
|||
html_print_input_hidden ('id', $id_layout);
|
||||
html_print_table ($table);
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
|
||||
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());
|
||||
});
|
||||
});
|
||||
|
||||
<?php if ($config["pure"] && $config["refr"] > 0): ?>
|
||||
t = new Date();
|
||||
|
|
Loading…
Reference in New Issue