From 0ffc6220aafdab2c2fbe78308f06d1ea0b59b59b Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Wed, 8 Oct 2014 14:55:59 +0200 Subject: [PATCH] Added a check to know if exist malformed planned downtimes and an option to solve the problem --- .../godmode/agentes/planned_downtime.list.php | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/pandora_console/godmode/agentes/planned_downtime.list.php b/pandora_console/godmode/agentes/planned_downtime.list.php index 675efc44a6..e87879c0a1 100755 --- a/pandora_console/godmode/agentes/planned_downtime.list.php +++ b/pandora_console/godmode/agentes/planned_downtime.list.php @@ -27,6 +27,27 @@ if (! check_acl ($config['id_user'], 0, "AW")) { require_once ('include/functions_users.php'); require_once ('include/functions_events.php'); +require_once ('include/functions_planned_downtimes.php'); + +$malformed_downtimes_exist = false; +$migrate_malformed = (bool) get_parameter("migrate_malformed"); + +if ($migrate_malformed) { + $migration_result = planned_downtimes_migrate_malformed_downtimes(); + + if ($migration_result['status'] == false) { + ui_print_error_message(__('An error occurred while migrating the malformed planned downtimes') . ". " + . __('Please run the migration again or contact with the administrator')); + echo "
"; + } +} +else { + $malformed_downtimes = planned_downtimes_get_malformed(); + + if (!empty($malformed_downtimes)) { + $malformed_downtimes_exist = true; + } +} // Header ui_print_page_header( @@ -522,6 +543,12 @@ $(document).ready (function () { e.preventDefault(); } }); + + if () { + if (confirm("")) { + window.location.href = "index.php?sec=estado&sec2=godmode/agentes/planned_downtime.list&migrate_malformed=1"; + } + } }); \ No newline at end of file