From 1c411483906dc141eb18e8a8ab0d284ded2fca9c Mon Sep 17 00:00:00 2001
From: Calvo <luis.calvo@pandorafms.com>
Date: Thu, 13 Jul 2023 14:54:32 +0200
Subject: [PATCH 1/2] Fix cron and periodically module planned downtimes

---
 pandora_server/lib/PandoraFMS/Core.pm | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm
index c6e87003f7..011c9cfb57 100644
--- a/pandora_server/lib/PandoraFMS/Core.pm
+++ b/pandora_server/lib/PandoraFMS/Core.pm
@@ -2385,7 +2385,8 @@ sub pandora_planned_downtime_cron_start($$) {
 				$dbh, $downtime->{'id'});
 			}
 			elsif (($downtime->{'type_downtime'} eq "disable_agents")
-				|| ($downtime->{'type_downtime'} eq "disable_agents_alerts")) {
+				|| ($downtime->{'type_downtime'} eq "disable_agents_alerts")
+				|| ($downtime->{'type_downtime'} eq "disable_agent_modules")) {
 				pandora_planned_downtime_set_disabled_elements($pa_config,
 				$dbh, $downtime);
 			}
@@ -2436,7 +2437,8 @@ sub pandora_planned_downtime_cron_stop($$) {
 					$dbh, $downtime->{'id'});
 			}
 			elsif (($downtime->{'type_downtime'} eq "disable_agents")
-				|| ($downtime->{'type_downtime'} eq "disable_agents_alerts")) {
+				|| ($downtime->{'type_downtime'} eq "disable_agents_alerts")
+				|| ($downtime->{'type_downtime'} eq "disable_agent_modules")) {
 					pandora_planned_downtime_unset_disabled_elements($pa_config,
 						$dbh, $downtime);
 			}
@@ -2828,7 +2830,8 @@ sub pandora_planned_downtime_monthly_start($$) {
 			pandora_planned_downtime_set_quiet_elements($pa_config, $dbh, $downtime->{'id'});
 		}
 		elsif (($downtime->{'type_downtime'} eq "disable_agents")
-			|| ($downtime->{'type_downtime'} eq "disable_agents_alerts")) {
+			|| ($downtime->{'type_downtime'} eq "disable_agents_alerts")
+			|| ($downtime->{'type_downtime'} eq "disable_agent_modules")) {
 				
 			pandora_planned_downtime_set_disabled_elements($pa_config, $dbh, $downtime);
 		}
@@ -2906,7 +2909,8 @@ sub pandora_planned_downtime_monthly_stop($$) {
 				$dbh, $downtime->{'id'});
 		}
 		elsif (($downtime->{'type_downtime'} eq "disable_agents")
-			|| ($downtime->{'type_downtime'} eq "disable_agents_alerts")) {
+			|| ($downtime->{'type_downtime'} eq "disable_agents_alerts")
+			|| ($downtime->{'type_downtime'} eq "disable_agent_modules")) {
 				
 			pandora_planned_downtime_unset_disabled_elements($pa_config,
 				$dbh, $downtime);
@@ -3016,7 +3020,8 @@ sub pandora_planned_downtime_weekly_start($$) {
 				$dbh, $downtime->{'id'});
 			}
 			elsif (($downtime->{'type_downtime'} eq "disable_agents")
-				|| ($downtime->{'type_downtime'} eq "disable_agents_alerts")) {
+				|| ($downtime->{'type_downtime'} eq "disable_agents_alerts")
+				|| ($downtime->{'type_downtime'} eq "disable_agent_modules")) {
 				pandora_planned_downtime_set_disabled_elements($pa_config,
 				$dbh, $downtime);
 			}
@@ -3131,7 +3136,8 @@ sub pandora_planned_downtime_weekly_stop($$) {
 					$dbh, $downtime->{'id'});
 			}
 			elsif (($downtime->{'type_downtime'} eq "disable_agents")
-				|| ($downtime->{'type_downtime'} eq "disable_agents_alerts")) {
+				|| ($downtime->{'type_downtime'} eq "disable_agents_alerts")
+				|| ($downtime->{'type_downtime'} eq "disable_agent_modules")) {
 					pandora_planned_downtime_unset_disabled_elements($pa_config,
 						$dbh, $downtime);
 			}

From 32d67361b4848da5482e21d762866d9722d025fc Mon Sep 17 00:00:00 2001
From: Calvo <luis.calvo@pandorafms.com>
Date: Mon, 28 Aug 2023 10:43:06 +0200
Subject: [PATCH 2/2] Fix planned downtime string

---
 pandora_console/godmode/agentes/planned_downtime.list.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pandora_console/godmode/agentes/planned_downtime.list.php b/pandora_console/godmode/agentes/planned_downtime.list.php
index 959db70ed6..6ee46ff7f1 100755
--- a/pandora_console/godmode/agentes/planned_downtime.list.php
+++ b/pandora_console/godmode/agentes/planned_downtime.list.php
@@ -89,7 +89,7 @@ if (is_ajax() === true) {
             [
                 'id'                  => 'agent_modules_affected_planned_downtime',
                 'class'               => 'info_table',
-                'style'               => 'width: 100%',
+                'style'               => 'width: 99%',
                 'columns'             => $columns,
                 'column_names'        => $column_names,
                 'ajax_url'            => 'godmode/agentes/planned_downtime.list',
@@ -730,7 +730,7 @@ if ($downtimes === false && $filter_performed === false) {
     $table->cellstyle = [];
 
     $table->head = [];
-    $table->head['name'] = __('Name #Ag.');
+    $table->head['name'] = __('Name (Ag.)');
     $table->head['description'] = __('Description');
     $table->head['group'] = __('Group');
     $table->head['type'] = __('Type');