From 75d56d8d2bbc2011fa863f884e669304c6f94e13 Mon Sep 17 00:00:00 2001
From: mdtrooper <tres.14159@gmail.com>
Date: Mon, 16 Nov 2009 19:02:49 +0000
Subject: [PATCH] 2009-11-16  Miguel de Dios <miguel.dedios@artica.es>

	* godmode/reporting/reporting_builder.php,
	godmode/reporting/graph_builder.php, godmode/alerts/alert_list.php: fix the
	bug that show the modules "pending delete" in more select box in some forms.
	Fixes: 2894921



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2109 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
---
 pandora_console/ChangeLog                     |  7 +++++++
 pandora_console/godmode/alerts/alert_list.php | 21 +++----------------
 .../godmode/reporting/graph_builder.php       |  2 ++
 .../godmode/reporting/reporting_builder.php   |  1 +
 4 files changed, 13 insertions(+), 18 deletions(-)

diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog
index c03f433c61..063d99a935 100644
--- a/pandora_console/ChangeLog
+++ b/pandora_console/ChangeLog
@@ -1,3 +1,10 @@
+2009-11-16  Miguel de Dios <miguel.dedios@artica.es>
+
+	* godmode/reporting/reporting_builder.php,
+	godmode/reporting/graph_builder.php, godmode/alerts/alert_list.php: fix the
+	bug that show the modules "pending delete" in more select box in some forms.
+	Fixes: 2894921
+
 2009-11-12  Miguel de Dios <miguel.dedios@artica.es>
 
 	* godmode/db/db_sanity.php: fix typo error there was one "zero" more in
diff --git a/pandora_console/godmode/alerts/alert_list.php b/pandora_console/godmode/alerts/alert_list.php
index 8d9298b7ea..b92de45c05 100644
--- a/pandora_console/godmode/alerts/alert_list.php
+++ b/pandora_console/godmode/alerts/alert_list.php
@@ -494,7 +494,8 @@ if (! $id_agente) {
 $table->data[0][0] = __('Module');
 $modules = array ();
 if ($id_agente)
-	$modules = get_agent_modules ($id_agente);
+	$modules = get_agent_modules ($id_agente, false, array("delete_pending" => 0));
+
 $table->data[0][1] = print_select ($modules, 'id_agent_module', 0, true,
 	__('Select'), 0, true, false, true, '', ($id_agente == 0));
 $table->data[0][1] .= ' <span id="latest_value" class="invisible">'.__('Latest value').': ';
@@ -510,23 +511,6 @@ $table->data[1][1] .= ' <a class="template_details invisible" href="#">
 	<img class="img_help" src="images/zoom.png" /></a>';
 
 $table->data[2][0] = __('Actions');
-//$actions = get_alert_actions ();
-//if (empty ($actions))
-//	$actions = array ();
-
-//foreach ($actions as $action_id => $action_name) {
-//	$id = 'actions['.$action_id.']';
-//	$table->data[2][1] .= print_checkbox ($id, $action_id, false, true);
-//	$table->data[2][1] .= print_label ($action_name, 'checkbox-'.$id, true);
-//	$table->data[2][1] .= ' <span id="advanced_'.$action_id.'" class="advanced_actions invisible">';
-//	$table->data[2][1] .=  __('From').' ';
-//	$table->data[2][1] .= print_input_text ('fires_min['.$action_id.']', -1, '', 4, 10, true);
-//	$table->data[2][1] .=  ' '.__('to').' ';
-//	$table->data[2][1] .= print_input_text ('fires_max['.$action_id.']', -1, '', 4, 10, true);
-//	$table->data[2][1] .= ' '.__('matches of the alert');
-//	$table->data[2][1] .= '</span>';
-//	$table->data[2][1] .= '<br />';
-//}
 
 $actions = array ('0' => __('None'));
 
@@ -615,6 +599,7 @@ $(document).ready (function () {
 					$('#id_agent_module').empty ();
 					var inputs = [];
 					inputs.push ("agent_name=" + agent_name);
+					inputs.push ('filter=delete_pending = 0');
 					inputs.push ("get_agent_modules_json=1");
 					inputs.push ("page=operation/agentes/ver_agente");
 					jQuery.ajax ({
diff --git a/pandora_console/godmode/reporting/graph_builder.php b/pandora_console/godmode/reporting/graph_builder.php
index ba3301b7fd..3f16d0d3b8 100644
--- a/pandora_console/godmode/reporting/graph_builder.php
+++ b/pandora_console/godmode/reporting/graph_builder.php
@@ -665,6 +665,7 @@ function agent_changed () {
 		$('#id_module').empty ();
 		var inputs = [];
 		inputs.push ("id_agent=" + id_agent);
+		inputs.push ('filter=delete_pending = 0');
 		inputs.push ("get_agent_modules_json=1");
 		inputs.push ("page=operation/agentes/ver_agente");
 		jQuery.ajax ({
@@ -721,6 +722,7 @@ $(document).ready (function () {
 					$('#id_module').empty ();
 					var inputs = [];
 					inputs.push ("agent_name=" + agent_name);
+					inputs.push ('filter=delete_pending = 0');
 					inputs.push ("get_agent_modules_json=1");
 					inputs.push ("page=operation/agentes/ver_agente");
 					jQuery.ajax ({
diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php
index e1cbe51475..efd4d94750 100644
--- a/pandora_console/godmode/reporting/reporting_builder.php
+++ b/pandora_console/godmode/reporting/reporting_builder.php
@@ -679,6 +679,7 @@ $(document).ready (function () {
 						$('#id_module').empty ();
 						var inputs = [];
 						inputs.push ("agent_name=" + agent_name);
+						inputs.push ('filter=delete_pending = 0');
 						inputs.push ("get_agent_modules_json=1");
 						inputs.push ("page=operation/agentes/ver_agente");
 						jQuery.ajax ({