From d15a6bfe3013766393ef6810c6e97f742607cdd8 Mon Sep 17 00:00:00 2001
From: mdtrooper <tres.14159@gmail.com>
Date: Tue, 28 Feb 2012 16:08:30 +0000
Subject: [PATCH] 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
---
 pandora_console/ChangeLog                     | 11 ++++++++++
 pandora_console/godmode/reporting/graphs.php  |  2 +-
 .../godmode/reporting/reporting_builder.php   |  2 +-
 .../include/functions_networkmap.php          | 21 +++++++++++--------
 .../include/functions_reporting.php           |  2 +-
 .../mobile/operation/agents/view_agents.php   |  4 ++--
 .../operation/agentes/datos_agente.php        |  4 ++--
 .../operation/incidents/incident_detail.php   | 10 +++++----
 .../operation/reporting/reporting_viewer.php  |  4 ++--
 9 files changed, 38 insertions(+), 22 deletions(-)

diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog
index 58a9effce8..3144b42134 100644
--- a/pandora_console/ChangeLog
+++ b/pandora_console/ChangeLog
@@ -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>
 
 	* operation/events/events.php, operation/agentes/datos_agente.php,
diff --git a/pandora_console/godmode/reporting/graphs.php b/pandora_console/godmode/reporting/graphs.php
index 325393748b..f19cb9910d 100644
--- a/pandora_console/godmode/reporting/graphs.php
+++ b/pandora_console/godmode/reporting/graphs.php
@@ -183,7 +183,7 @@ if (! empty ($graphs)) {
 else {
 	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 '<div class="action-buttons" style="width: 98%;">';
 html_print_submit_button (__('Create graph'), 'create', false, 'class="sub next"');
diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php
index 8c6e81c3e7..53f297fcd6 100644
--- a/pandora_console/godmode/reporting/reporting_builder.php
+++ b/pandora_console/godmode/reporting/reporting_builder.php
@@ -639,7 +639,7 @@ switch ($action) {
 		}
 		break;
 	// Added for report templates
-	default: 
+	default:
 		if ($enterpriseEnable){
 			$buttons = array(
 				'list_reports' => array('active' => false,
diff --git a/pandora_console/include/functions_networkmap.php b/pandora_console/include/functions_networkmap.php
index 847f55860b..0c809d3f02 100644
--- a/pandora_console/include/functions_networkmap.php
+++ b/pandora_console/include/functions_networkmap.php
@@ -89,7 +89,8 @@ function networkmap_generate_dot ($pandora_name, $group = 0, $simple = 0, $font_
 		// Save node parent information to define edges later
 		if ($agent['id_parent'] != "0") {
 			$parents[$node_count] = $node_ref[$agent['id_parent']];
-		} else {
+		}
+		else {
 			$orphans[$node_count] = 1;
 		}
 		
@@ -100,7 +101,7 @@ function networkmap_generate_dot ($pandora_name, $group = 0, $simple = 0, $font_
 		// Add node
 		$nodes[$node_count] = $agent;
 		
-		if($show_snmp_modules) {
+		if ($show_snmp_modules) {
 			// 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);
 			// Parse modules
@@ -142,7 +143,7 @@ function networkmap_generate_dot ($pandora_name, $group = 0, $simple = 0, $font_
 				break;
 		}
 	}
-
+	
 	// Define edges
 	foreach ($parents as $node => $parent_id) {
 		// 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;
 		}
 	}
-
+	
 	// Create a central node if orphan nodes exist
 	if (count ($orphans) || empty ($nodes)) {
 		$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
 		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);
-		} else {
+		}
+		else {
 			$img_node = '-';
 		}
-
+		
 		if (strlen(groups_get_name($group['id_grupo'])) > 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>>,
 		 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'].'"];';
-	} 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'].'"];';
 	}
 	return $node;
@@ -438,8 +441,7 @@ function networkmap_create_agent_node ($agent, $simple = 0, $font_size = 10, $cu
 	if ($simple == 0){
 		// Set node icon
 		$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>
 		 <TR><TD>'.$name.'</TD></TR></TABLE>>,
 		 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 {
 		$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;
 }
 
diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php
index cb8e815612..a89b11f180 100644
--- a/pandora_console/include/functions_reporting.php
+++ b/pandora_console/include/functions_reporting.php
@@ -4637,7 +4637,7 @@ function reporting_get_agentmodule_ttr ($id_agent_module, $period, $date = 0) {
 	return $critical_period;
 }
 
-/*
+/**
  * Get all the template graphs a user can see.
  *
  * @param $id_user User id to check.
diff --git a/pandora_console/mobile/operation/agents/view_agents.php b/pandora_console/mobile/operation/agents/view_agents.php
index dee699326b..bf1afb712f 100644
--- a/pandora_console/mobile/operation/agents/view_agents.php
+++ b/pandora_console/mobile/operation/agents/view_agents.php
@@ -296,7 +296,7 @@ class ViewAgent {
 				$salida = "<span style='$style'>$salida</span>";
 			}
 			else {
-				if (is_numeric($module["datos"])){
+				if (is_numeric($module["datos"])) {
 					$salida = format_numeric($module["datos"]);
 				}
 				else {
@@ -517,7 +517,7 @@ class viewGraph {
 			
 			$data = array ();
 		
-			foreach($columns as $col => $attr){
+			foreach($columns as $col => $attr) {
 				$data[] = $attr[1] ($row[$attr[0]]);
 			}
 		
diff --git a/pandora_console/operation/agentes/datos_agente.php b/pandora_console/operation/agentes/datos_agente.php
index 7fbc50ec44..0451e764b9 100644
--- a/pandora_console/operation/agentes/datos_agente.php
+++ b/pandora_console/operation/agentes/datos_agente.php
@@ -189,7 +189,7 @@ $table->width = '98%';
 
 //
 $index = 0;
-foreach($columns as $col => $attr){
+foreach($columns as $col => $attr) {
 	$table->head[$index] = $col;
 	
 	if (isset($attr["align"]))
@@ -204,7 +204,7 @@ foreach($columns as $col => $attr){
 foreach ($result as $row) {
 	$data = array ();
 
-	foreach($columns as $col => $attr){
+	foreach($columns as $col => $attr) {
 		$data[] = $attr[1] ($row[$attr[0]]);
 	}
 
diff --git a/pandora_console/operation/incidents/incident_detail.php b/pandora_console/operation/incidents/incident_detail.php
index cad617d6da..bd18c67a25 100755
--- a/pandora_console/operation/incidents/incident_detail.php
+++ b/pandora_console/operation/incidents/incident_detail.php
@@ -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"])) {
 	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);
 }
 
@@ -304,11 +305,11 @@ if (empty ($id_creator)) {
 
 $agents_incidents = agents_get_agents(false, array('id_agente', 'nombre'));
 
-if ($agents_incidents === false){
+if ($agents_incidents === false) {
 	$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'];
 }
 
@@ -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"])) {
 	html_print_textarea ("descripcion", 15, 80, $texto, 'style="height:200px;"');
-} else {
+}
+else {
 	html_print_textarea ("descripcion", 15, 80, $texto, 'style="height:200px;" disabled');
 }
 
diff --git a/pandora_console/operation/reporting/reporting_viewer.php b/pandora_console/operation/reporting/reporting_viewer.php
index 7244c91785..fba26b9073 100644
--- a/pandora_console/operation/reporting/reporting_viewer.php
+++ b/pandora_console/operation/reporting/reporting_viewer.php
@@ -207,7 +207,6 @@ foreach ($contents as $content) {
 ?>
 
 <script language="javascript" type="text/javascript">
-
 $(document).ready (function () {	
 	$("#loading").slideUp ();
 	$("#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-4").css("display", "");
 			$("#table1-1-5").css("display", "none");
-		}else{
+		}
+		else {
 			$("#table1-1-3").css("display", "none");
 			$("#table1-1-4").css("display", "none");
 			$("#table1-1-5").css("display", "");