mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 16:55:05 +02:00
2012-02-28 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_networkmap.php: fixed into the function "networkmap_create_agent_node" the creation of url link for the node. * godmode/reporting/graphs.php, godmode/reporting/reporting_builder.php, include/functions_graph.php, include/functions_reporting.php, mobile/operation/agents/view_agents.php, operation/agentes/datos_agente.php, operation/incidents/incident_detail.php, operation/reporting/reporting_viewer.php: cleaned source code style. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5666 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
9bf73f9357
commit
a0230c430c
@ -1,3 +1,14 @@
|
|||||||
|
2012-02-28 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
|
* include/functions_networkmap.php: fixed into the function
|
||||||
|
"networkmap_create_agent_node" the creation of url link for the node.
|
||||||
|
|
||||||
|
* godmode/reporting/graphs.php, godmode/reporting/reporting_builder.php,
|
||||||
|
include/functions_graph.php, include/functions_reporting.php,
|
||||||
|
mobile/operation/agents/view_agents.php, operation/agentes/datos_agente.php,
|
||||||
|
operation/incidents/incident_detail.php,
|
||||||
|
operation/reporting/reporting_viewer.php: cleaned source code style.
|
||||||
|
|
||||||
2012-02-28 Miguel de Dios <miguel.dedios@artica.es>
|
2012-02-28 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
* operation/events/events.php, operation/agentes/datos_agente.php,
|
* operation/events/events.php, operation/agentes/datos_agente.php,
|
||||||
|
@ -183,7 +183,7 @@ if (! empty ($graphs)) {
|
|||||||
else {
|
else {
|
||||||
echo "<div class='nf'>".__('There are no defined reportings')."</div>";
|
echo "<div class='nf'>".__('There are no defined reportings')."</div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '<form method="post" action="index.php?sec=greporting&sec2=godmode/reporting/graph_builder">';
|
echo '<form method="post" action="index.php?sec=greporting&sec2=godmode/reporting/graph_builder">';
|
||||||
echo '<div class="action-buttons" style="width: 98%;">';
|
echo '<div class="action-buttons" style="width: 98%;">';
|
||||||
html_print_submit_button (__('Create graph'), 'create', false, 'class="sub next"');
|
html_print_submit_button (__('Create graph'), 'create', false, 'class="sub next"');
|
||||||
|
@ -639,7 +639,7 @@ switch ($action) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
// Added for report templates
|
// Added for report templates
|
||||||
default:
|
default:
|
||||||
if ($enterpriseEnable){
|
if ($enterpriseEnable){
|
||||||
$buttons = array(
|
$buttons = array(
|
||||||
'list_reports' => array('active' => false,
|
'list_reports' => array('active' => false,
|
||||||
|
@ -89,7 +89,8 @@ function networkmap_generate_dot ($pandora_name, $group = 0, $simple = 0, $font_
|
|||||||
// Save node parent information to define edges later
|
// Save node parent information to define edges later
|
||||||
if ($agent['id_parent'] != "0") {
|
if ($agent['id_parent'] != "0") {
|
||||||
$parents[$node_count] = $node_ref[$agent['id_parent']];
|
$parents[$node_count] = $node_ref[$agent['id_parent']];
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
$orphans[$node_count] = 1;
|
$orphans[$node_count] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -100,7 +101,7 @@ function networkmap_generate_dot ($pandora_name, $group = 0, $simple = 0, $font_
|
|||||||
// Add node
|
// Add node
|
||||||
$nodes[$node_count] = $agent;
|
$nodes[$node_count] = $agent;
|
||||||
|
|
||||||
if($show_snmp_modules) {
|
if ($show_snmp_modules) {
|
||||||
// Get agent modules data of snmp_proc type
|
// Get agent modules data of snmp_proc type
|
||||||
$modules = agents_get_modules ($agent['id_agente'], false, array('disabled' => 0, 'id_tipo_modulo' => 18), true, false);
|
$modules = agents_get_modules ($agent['id_agente'], false, array('disabled' => 0, 'id_tipo_modulo' => 18), true, false);
|
||||||
// Parse modules
|
// Parse modules
|
||||||
@ -142,7 +143,7 @@ function networkmap_generate_dot ($pandora_name, $group = 0, $simple = 0, $font_
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Define edges
|
// Define edges
|
||||||
foreach ($parents as $node => $parent_id) {
|
foreach ($parents as $node => $parent_id) {
|
||||||
// Verify that the parent is in the graph
|
// Verify that the parent is in the graph
|
||||||
@ -152,7 +153,7 @@ function networkmap_generate_dot ($pandora_name, $group = 0, $simple = 0, $font_
|
|||||||
$orphans[$node] = 1;
|
$orphans[$node] = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create a central node if orphan nodes exist
|
// Create a central node if orphan nodes exist
|
||||||
if (count ($orphans) || empty ($nodes)) {
|
if (count ($orphans) || empty ($nodes)) {
|
||||||
$graph .= networkmap_create_pandora_node ($pandora_name, $font_size, $simple);
|
$graph .= networkmap_create_pandora_node ($pandora_name, $font_size, $simple);
|
||||||
@ -383,10 +384,11 @@ function networkmap_create_group_node ($group, $simple = 0, $font_size = 10) {
|
|||||||
// Set node icon
|
// Set node icon
|
||||||
if (file_exists (html_print_image("images/groups_small/" . $icon . ".png", true, false, true, true))) {
|
if (file_exists (html_print_image("images/groups_small/" . $icon . ".png", true, false, true, true))) {
|
||||||
$img_node = html_print_image("images/groups_small/" . $icon . ".png", true, false, false, true);
|
$img_node = html_print_image("images/groups_small/" . $icon . ".png", true, false, false, true);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
$img_node = '-';
|
$img_node = '-';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strlen(groups_get_name($group['id_grupo'])) > 40){
|
if (strlen(groups_get_name($group['id_grupo'])) > 40){
|
||||||
$name = substr(groups_get_name($group['id_grupo']), 0, 40) . '...';
|
$name = substr(groups_get_name($group['id_grupo']), 0, 40) . '...';
|
||||||
}
|
}
|
||||||
@ -398,7 +400,8 @@ function networkmap_create_group_node ($group, $simple = 0, $font_size = 10) {
|
|||||||
<TR><TD>'.$name.'</TD></TR></TABLE>>,
|
<TR><TD>'.$name.'</TD></TR></TABLE>>,
|
||||||
shape="invtrapezium", URL="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=60&group_id='.$group['id_grupo'].'",
|
shape="invtrapezium", URL="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=60&group_id='.$group['id_grupo'].'",
|
||||||
tooltip="ajax.php?page=operation/agentes/ver_agente&get_group_status_tooltip=1&id_group='.$group['id_grupo'].'"];';
|
tooltip="ajax.php?page=operation/agentes/ver_agente&get_group_status_tooltip=1&id_group='.$group['id_grupo'].'"];';
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
$node = $group['id_node'] . ' [ color="'.$status_color.'", fontsize='.$font_size.', shape="invtrapezium", URL="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=60&group_id='.$group['id_grupo'].'", style="filled", fixedsize=true, width=0.20, height=0.20, label="", tooltip="ajax.php?page=operation/agentes/ver_agente&get_group_status_tooltip=1&id_group='.$group['id_grupo'].'"];';
|
$node = $group['id_node'] . ' [ color="'.$status_color.'", fontsize='.$font_size.', shape="invtrapezium", URL="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=60&group_id='.$group['id_grupo'].'", style="filled", fixedsize=true, width=0.20, height=0.20, label="", tooltip="ajax.php?page=operation/agentes/ver_agente&get_group_status_tooltip=1&id_group='.$group['id_grupo'].'"];';
|
||||||
}
|
}
|
||||||
return $node;
|
return $node;
|
||||||
@ -438,8 +441,7 @@ function networkmap_create_agent_node ($agent, $simple = 0, $font_size = 10, $cu
|
|||||||
if ($simple == 0){
|
if ($simple == 0){
|
||||||
// Set node icon
|
// Set node icon
|
||||||
$img_node = ui_print_os_icon ($agent['id_os'], false, true, true, true, true);
|
$img_node = ui_print_os_icon ($agent['id_os'], false, true, true, true, true);
|
||||||
$img_node = str_replace($config['homeurl'] . '/', '', $img_node);
|
|
||||||
|
|
||||||
$node = $agent['id_node'].' [ color="'.$status_color.'", fontsize='.$font_size.', style="filled", fixedsize=true, width=0.40, height=0.40, label=<<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0"><TR><TD>' . html_print_image($img_node, true, false, false, true) . '</TD></TR>
|
$node = $agent['id_node'].' [ color="'.$status_color.'", fontsize='.$font_size.', style="filled", fixedsize=true, width=0.40, height=0.40, label=<<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0"><TR><TD>' . html_print_image($img_node, true, false, false, true) . '</TD></TR>
|
||||||
<TR><TD>'.$name.'</TD></TR></TABLE>>,
|
<TR><TD>'.$name.'</TD></TR></TABLE>>,
|
||||||
shape="doublecircle", URL="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$agent['id_agente'].'",
|
shape="doublecircle", URL="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$agent['id_agente'].'",
|
||||||
@ -448,6 +450,7 @@ function networkmap_create_agent_node ($agent, $simple = 0, $font_size = 10, $cu
|
|||||||
else {
|
else {
|
||||||
$node = $agent['id_node'] . ' [ color="' . $status_color . '", fontsize='.$font_size.', shape="doublecircle", URL="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$agent['id_agente'].'",style="filled", fixedsize=true, width=0.20, height=0.20, label="", tooltip="ajax.php?page=operation/agentes/ver_agente&get_agent_status_tooltip=1&id_agent='.$agent['id_agente'].'"];';
|
$node = $agent['id_node'] . ' [ color="' . $status_color . '", fontsize='.$font_size.', shape="doublecircle", URL="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$agent['id_agente'].'",style="filled", fixedsize=true, width=0.20, height=0.20, label="", tooltip="ajax.php?page=operation/agentes/ver_agente&get_agent_status_tooltip=1&id_agent='.$agent['id_agente'].'"];';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $node;
|
return $node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4637,7 +4637,7 @@ function reporting_get_agentmodule_ttr ($id_agent_module, $period, $date = 0) {
|
|||||||
return $critical_period;
|
return $critical_period;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Get all the template graphs a user can see.
|
* Get all the template graphs a user can see.
|
||||||
*
|
*
|
||||||
* @param $id_user User id to check.
|
* @param $id_user User id to check.
|
||||||
|
@ -296,7 +296,7 @@ class ViewAgent {
|
|||||||
$salida = "<span style='$style'>$salida</span>";
|
$salida = "<span style='$style'>$salida</span>";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (is_numeric($module["datos"])){
|
if (is_numeric($module["datos"])) {
|
||||||
$salida = format_numeric($module["datos"]);
|
$salida = format_numeric($module["datos"]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -517,7 +517,7 @@ class viewGraph {
|
|||||||
|
|
||||||
$data = array ();
|
$data = array ();
|
||||||
|
|
||||||
foreach($columns as $col => $attr){
|
foreach($columns as $col => $attr) {
|
||||||
$data[] = $attr[1] ($row[$attr[0]]);
|
$data[] = $attr[1] ($row[$attr[0]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -189,7 +189,7 @@ $table->width = '98%';
|
|||||||
|
|
||||||
//
|
//
|
||||||
$index = 0;
|
$index = 0;
|
||||||
foreach($columns as $col => $attr){
|
foreach($columns as $col => $attr) {
|
||||||
$table->head[$index] = $col;
|
$table->head[$index] = $col;
|
||||||
|
|
||||||
if (isset($attr["align"]))
|
if (isset($attr["align"]))
|
||||||
@ -204,7 +204,7 @@ foreach($columns as $col => $attr){
|
|||||||
foreach ($result as $row) {
|
foreach ($result as $row) {
|
||||||
$data = array ();
|
$data = array ();
|
||||||
|
|
||||||
foreach($columns as $col => $attr){
|
foreach($columns as $col => $attr) {
|
||||||
$data[] = $attr[1] ($row[$attr[0]]);
|
$data[] = $attr[1] ($row[$attr[0]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -291,7 +291,8 @@ echo '</td></tr><tr><td class="datos"><b>'.__('Priority').'</b></td><td class="d
|
|||||||
|
|
||||||
if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
|
if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
|
||||||
html_print_select (incidents_get_priorities (), "prioridad_form", $prioridad, '', '', '', false, false, false, 'w135');
|
html_print_select (incidents_get_priorities (), "prioridad_form", $prioridad, '', '', '', false, false, false, 'w135');
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
html_print_select (incidents_get_priorities (), "prioridad_form", $prioridad, '', '', '', false, false, false, 'w135', true);
|
html_print_select (incidents_get_priorities (), "prioridad_form", $prioridad, '', '', '', false, false, false, 'w135', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -304,11 +305,11 @@ if (empty ($id_creator)) {
|
|||||||
|
|
||||||
$agents_incidents = agents_get_agents(false, array('id_agente', 'nombre'));
|
$agents_incidents = agents_get_agents(false, array('id_agente', 'nombre'));
|
||||||
|
|
||||||
if ($agents_incidents === false){
|
if ($agents_incidents === false) {
|
||||||
$agents_incidents = array();
|
$agents_incidents = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($agents_incidents as $agent_incident){
|
foreach ($agents_incidents as $agent_incident) {
|
||||||
$result_agent_incidents[$agent_incident['id_agente']] = $agent_incident['nombre'];
|
$result_agent_incidents[$agent_incident['id_agente']] = $agent_incident['nombre'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -324,7 +325,8 @@ echo '</td></tr><tr><td class="datos2" colspan="4">';
|
|||||||
|
|
||||||
if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
|
if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
|
||||||
html_print_textarea ("descripcion", 15, 80, $texto, 'style="height:200px;"');
|
html_print_textarea ("descripcion", 15, 80, $texto, 'style="height:200px;"');
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
html_print_textarea ("descripcion", 15, 80, $texto, 'style="height:200px;" disabled');
|
html_print_textarea ("descripcion", 15, 80, $texto, 'style="height:200px;" disabled');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -207,7 +207,6 @@ foreach ($contents as $content) {
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<script language="javascript" type="text/javascript">
|
<script language="javascript" type="text/javascript">
|
||||||
|
|
||||||
$(document).ready (function () {
|
$(document).ready (function () {
|
||||||
$("#loading").slideUp ();
|
$("#loading").slideUp ();
|
||||||
$("#text-time").timeEntry ({spinnerImage: 'images/time-entry.png', spinnerSize: [20, 20, 0]});
|
$("#text-time").timeEntry ({spinnerImage: 'images/time-entry.png', spinnerSize: [20, 20, 0]});
|
||||||
@ -225,7 +224,8 @@ $(document).ready (function () {
|
|||||||
$("#table1-1-3").css("display", "");
|
$("#table1-1-3").css("display", "");
|
||||||
$("#table1-1-4").css("display", "");
|
$("#table1-1-4").css("display", "");
|
||||||
$("#table1-1-5").css("display", "none");
|
$("#table1-1-5").css("display", "none");
|
||||||
}else{
|
}
|
||||||
|
else {
|
||||||
$("#table1-1-3").css("display", "none");
|
$("#table1-1-3").css("display", "none");
|
||||||
$("#table1-1-4").css("display", "none");
|
$("#table1-1-4").css("display", "none");
|
||||||
$("#table1-1-5").css("display", "");
|
$("#table1-1-5").css("display", "");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user