From 09b43fb34a9eeaa9196b6215e27d879886445630 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Wed, 16 Sep 2009 15:38:44 +0000 Subject: [PATCH] 2009-09-16 Miguel de Dios * operation/agentes/estado_agente.php, godmode/alerts/alert_list.php: fix bug when there aren't not defined or attach action in template alert. Before it was showing the loading ajax gif, now it show the select box with none. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1950 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 6 +++++ pandora_console/godmode/alerts/alert_list.php | 23 +++++++++++-------- .../operation/agentes/estado_agente.php | 7 +++--- 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 046eb7f8d1..a2607e812a 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2009-09-16 Miguel de Dios + + * operation/agentes/estado_agente.php, godmode/alerts/alert_list.php: fix + bug when there aren't not defined or attach action in template alert. Before + it was showing the loading ajax gif, now it show the select box with none. + 2009-09-16 Miguel de Dios * include/functions_reporting.php, include/functions_agents.php: cleanup diff --git a/pandora_console/godmode/alerts/alert_list.php b/pandora_console/godmode/alerts/alert_list.php index f04123cfa5..9428a44cef 100644 --- a/pandora_console/godmode/alerts/alert_list.php +++ b/pandora_console/godmode/alerts/alert_list.php @@ -724,22 +724,27 @@ $(document).ready (function () { "id_template" : this.value }, function (data, status) { - if (data != '') { - jQuery.each (data, function (i, val) { - option = $("") - .attr ("value", val["id"]) - .append (val["name"]); - $("#action_select").append (option); - }); - } option = $("") .attr ("value", '0') .append (''); $("#action_select").append (option); + if (data == false) { + //There aren't any action + } + else { + if (data != '') { + jQuery.each (data, function (i, val) { + option = $("") + .attr ("value", val["id"]) + .append (val["name"]); + $("#action_select").append (option); + }); + } + $('#advanced_action').show(); + } $("#action_loading").hide (); $("#action_select").show(); - $('#advanced_action').show(); }, "json" ); diff --git a/pandora_console/operation/agentes/estado_agente.php b/pandora_console/operation/agentes/estado_agente.php index 9b4e640e3e..aa6f3a0848 100644 --- a/pandora_console/operation/agentes/estado_agente.php +++ b/pandora_console/operation/agentes/estado_agente.php @@ -42,9 +42,10 @@ if (is_ajax ()) { ORDER BY sort_order DESC"); - if ($rows !== false) { - echo json_encode($rows); - } + if ($rows !== false) + echo json_encode($rows); + else + echo "false"; return; }