diff --git a/pandora_console/godmode/agentes/planned_downtime.editor.php b/pandora_console/godmode/agentes/planned_downtime.editor.php
index 5ed25e4e2a..9f56a63897 100644
--- a/pandora_console/godmode/agentes/planned_downtime.editor.php
+++ b/pandora_console/godmode/agentes/planned_downtime.editor.php
@@ -47,6 +47,10 @@ ui_print_page_header(
true,
$buttons);
+//recursion group filter
+$recursion = get_parameter('recursion', $_POST['recursion']);
+
+
//Initialize data
$id_group = (int) get_parameter ('id_group');
$name = (string) get_parameter ('name');
@@ -628,7 +632,7 @@ echo '';
if ($id_downtime > 0) {
- echo "
";
+ echo " | ";
// Show available agents to include into downtime
echo '' . __('Available agents') . ':';
@@ -643,8 +647,31 @@ if ($id_downtime > 0) {
}
$filter_cond = '';
- if ($filter_group > 0)
- $filter_cond = " AND id_grupo = $filter_group ";
+ if ($filter_group > 0){
+ if($recursion){
+ $rg = groups_get_id_recursive($filter_group, true);
+ $filter_cond .= " AND id_grupo IN (";
+
+ $i = 0;
+ $len = count($rg);
+
+ foreach ($rg as $key) {
+
+ if ($i == $len - 1) {
+ $filter_cond .= $key.")";
+ }else{
+ $i++;
+ $filter_cond .= $key.",";
+ }
+ }
+
+ }
+ else{
+ $filter_cond = " AND id_grupo = $filter_group ";
+ }
+
+ }
+
$sql = sprintf("SELECT tagente.id_agente, tagente.nombre
FROM tagente
WHERE tagente.id_agente NOT IN (
@@ -671,17 +698,19 @@ if ($id_downtime > 0) {
$disabled_add_button = true;
}
+
echo "";
echo " |