From 594610cfe36dc7491c00b2626e9f075bb4905333 Mon Sep 17 00:00:00 2001 From: vgilc Date: Wed, 4 Jun 2014 07:36:28 +0000 Subject: [PATCH] 2014-06-04 Vanessa Gil * godmode/agentes/planned_downtime.editor.php: Check creation date in scheduled downtime. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10102 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 +++++ pandora_console/godmode/agentes/planned_downtime.editor.php | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 5bc2015aba..26b0fac2ce 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2014-06-04 Vanessa Gil + + * godmode/agentes/planned_downtime.editor.php: Check + creation date in scheduled downtime. + 2014-06-04 Sergio Martin * extras/pandoradb_migrate_5.0.x_to_5.1.postgreSQL.sql diff --git a/pandora_console/godmode/agentes/planned_downtime.editor.php b/pandora_console/godmode/agentes/planned_downtime.editor.php index a04e8c1488..9e83884663 100755 --- a/pandora_console/godmode/agentes/planned_downtime.editor.php +++ b/pandora_console/godmode/agentes/planned_downtime.editor.php @@ -152,8 +152,12 @@ if ($create_downtime || $update_downtime) { $datetime_from = strtotime ($once_date_from . ' ' . $once_time_from); $datetime_to = strtotime ($once_date_to . ' ' . $once_time_to); + $now = strtotime(date(DATE_FORMAT). ' ' . date(TIME_FORMAT)); - if ($datetime_from >= $datetime_to) { + if ($datetime_from < $now) { + ui_print_error_message(__('Not created. Error inserting data. Start time must be higher than the current time' )); + } + else if ($datetime_from >= $datetime_to) { ui_print_error_message(__('Not created. Error inserting data' ). ': START >= END'); }