2012-01-25 Junichi Satoh <junichi@rworks.jp>
* godmode/menu.php, godmode/alerts/alert_special_days.php,
godmode/alerts/configure_alert_special_days.php,
godmode/alerts/configure_alert_template.php,
extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql,
pandoradb.oracle.sql, pandoradb.postgreSQL.sql, pandoradb.sql,
include/functions_alerts.php: Added special days feature. It allows
to define special days (holidays and special working days) for
alert templates.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5421 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-01-25 07:13:43 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
// Pandora FMS - http://pandorafms.com
|
|
|
|
// ==================================================
|
|
|
|
// Copyright (c) 2005-2010 Artica Soluciones Tecnologicas
|
2013-04-02 08:29:38 +02:00
|
|
|
// Copyright (c) 2012-2013 Junichi Satoh
|
2012-01-25 Junichi Satoh <junichi@rworks.jp>
* godmode/menu.php, godmode/alerts/alert_special_days.php,
godmode/alerts/configure_alert_special_days.php,
godmode/alerts/configure_alert_template.php,
extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql,
pandoradb.oracle.sql, pandoradb.postgreSQL.sql, pandoradb.sql,
include/functions_alerts.php: Added special days feature. It allows
to define special days (holidays and special working days) for
alert templates.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5421 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-01-25 07:13:43 +01:00
|
|
|
// Please see http://pandorafms.org for full contribution list
|
|
|
|
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License
|
|
|
|
// as published by the Free Software Foundation for version 2.
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
|
|
// Load global vars
|
|
|
|
global $config;
|
|
|
|
|
|
|
|
require_once ("include/functions_alerts.php");
|
|
|
|
|
|
|
|
check_login ();
|
|
|
|
|
|
|
|
if (! check_acl ($config['id_user'], 0, "LM")) {
|
|
|
|
db_pandora_audit("ACL Violation",
|
|
|
|
"Trying to access Alert Management");
|
|
|
|
require ("general/noaccess.php");
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (is_ajax ()) {
|
|
|
|
$get_alert_command = (bool) get_parameter ('get_alert_command');
|
|
|
|
if ($get_alert_command) {
|
|
|
|
$id = (int) get_parameter ('id');
|
|
|
|
$command = alerts_get_alert_command ($id);
|
|
|
|
echo json_encode ($command);
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Header
|
2013-04-10 09:57:54 +02:00
|
|
|
ui_print_page_header (__('Alerts').' » '.__('Special days list'), "images/gm_alerts.png", false, "alert_special_days", true);
|
2012-01-25 Junichi Satoh <junichi@rworks.jp>
* godmode/menu.php, godmode/alerts/alert_special_days.php,
godmode/alerts/configure_alert_special_days.php,
godmode/alerts/configure_alert_template.php,
extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql,
pandoradb.oracle.sql, pandoradb.postgreSQL.sql, pandoradb.sql,
include/functions_alerts.php: Added special days feature. It allows
to define special days (holidays and special working days) for
alert templates.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5421 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-01-25 07:13:43 +01:00
|
|
|
|
|
|
|
$update_special_day = (bool) get_parameter ('update_special_day');
|
|
|
|
$create_special_day = (bool) get_parameter ('create_special_day');
|
|
|
|
$delete_special_day = (bool) get_parameter ('delete_special_day');
|
|
|
|
|
|
|
|
if ($create_special_day) {
|
|
|
|
$date = (string) get_parameter ('date');
|
|
|
|
$same_day = (string) get_parameter ('same_day');
|
2013-04-02 08:29:38 +02:00
|
|
|
$values = array();
|
|
|
|
$values['id_group'] = (string) get_parameter ('id_group');
|
|
|
|
$values['description'] = (string) get_parameter ('description');
|
2012-07-10 Miguel de Dios <miguel.dedios@artica.es>
* install.php, operation/reporting/reporting_xml.php,
operation/netflow/nf_live_view.php, operation/netflow/nf_view.php,
operation/tree.php, operation/agentes/gis_view.php,
operation/agentes/estado_monitores.php,
operation/agentes/networkmap.php,
operation/agentes/datos_agente.php,
operation/agentes/alerts_status.php, operation/menu.php,
operation/snmpconsole/snmp_view.php, operation/users/user_edit.php,
godmode/groups/configure_group.php,
godmode/groups/configure_modu_group.php,
godmode/agentes/module_manager_editor_prediction.php,
godmode/servers/manage_recontask.php,
godmode/alerts/alert_compounds.php,
godmode/alerts/configure_alert_template.php,
godmode/alerts/alert_special_days.php, godmode/setup/links.php,
godmode/setup/os.php, godmode/users/configure_profile.php,
godmode/events/events.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_edit_modules.php,
godmode/massive/massive_standby_alerts.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_operations.php,
godmode/massive/massive_delete_profiles.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_nc_groups.php,
godmode/reporting/graph_builder.php,
godmode/reporting/reporting_builder.item_editor.php,
include/functions_menu.php, include/functions_visual_map.php,
include/functions_db.php: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6759 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-07-10 12:38:02 +02:00
|
|
|
|
2012-01-25 Junichi Satoh <junichi@rworks.jp>
* godmode/menu.php, godmode/alerts/alert_special_days.php,
godmode/alerts/configure_alert_special_days.php,
godmode/alerts/configure_alert_template.php,
extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql,
pandoradb.oracle.sql, pandoradb.postgreSQL.sql, pandoradb.sql,
include/functions_alerts.php: Added special days feature. It allows
to define special days (holidays and special working days) for
alert templates.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5421 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-01-25 07:13:43 +01:00
|
|
|
list($year, $month, $day) = explode("-", $date);
|
2012-07-10 Miguel de Dios <miguel.dedios@artica.es>
* install.php, operation/reporting/reporting_xml.php,
operation/netflow/nf_live_view.php, operation/netflow/nf_view.php,
operation/tree.php, operation/agentes/gis_view.php,
operation/agentes/estado_monitores.php,
operation/agentes/networkmap.php,
operation/agentes/datos_agente.php,
operation/agentes/alerts_status.php, operation/menu.php,
operation/snmpconsole/snmp_view.php, operation/users/user_edit.php,
godmode/groups/configure_group.php,
godmode/groups/configure_modu_group.php,
godmode/agentes/module_manager_editor_prediction.php,
godmode/servers/manage_recontask.php,
godmode/alerts/alert_compounds.php,
godmode/alerts/configure_alert_template.php,
godmode/alerts/alert_special_days.php, godmode/setup/links.php,
godmode/setup/os.php, godmode/users/configure_profile.php,
godmode/events/events.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_edit_modules.php,
godmode/massive/massive_standby_alerts.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_operations.php,
godmode/massive/massive_delete_profiles.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_nc_groups.php,
godmode/reporting/graph_builder.php,
godmode/reporting/reporting_builder.item_editor.php,
include/functions_menu.php, include/functions_visual_map.php,
include/functions_db.php: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6759 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-07-10 12:38:02 +02:00
|
|
|
if ($year == '*') {
|
2012-01-25 Junichi Satoh <junichi@rworks.jp>
* godmode/menu.php, godmode/alerts/alert_special_days.php,
godmode/alerts/configure_alert_special_days.php,
godmode/alerts/configure_alert_template.php,
extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql,
pandoradb.oracle.sql, pandoradb.postgreSQL.sql, pandoradb.sql,
include/functions_alerts.php: Added special days feature. It allows
to define special days (holidays and special working days) for
alert templates.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5421 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-01-25 07:13:43 +01:00
|
|
|
# '0001' means every year.
|
2012-07-10 Miguel de Dios <miguel.dedios@artica.es>
* install.php, operation/reporting/reporting_xml.php,
operation/netflow/nf_live_view.php, operation/netflow/nf_view.php,
operation/tree.php, operation/agentes/gis_view.php,
operation/agentes/estado_monitores.php,
operation/agentes/networkmap.php,
operation/agentes/datos_agente.php,
operation/agentes/alerts_status.php, operation/menu.php,
operation/snmpconsole/snmp_view.php, operation/users/user_edit.php,
godmode/groups/configure_group.php,
godmode/groups/configure_modu_group.php,
godmode/agentes/module_manager_editor_prediction.php,
godmode/servers/manage_recontask.php,
godmode/alerts/alert_compounds.php,
godmode/alerts/configure_alert_template.php,
godmode/alerts/alert_special_days.php, godmode/setup/links.php,
godmode/setup/os.php, godmode/users/configure_profile.php,
godmode/events/events.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_edit_modules.php,
godmode/massive/massive_standby_alerts.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_operations.php,
godmode/massive/massive_delete_profiles.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_nc_groups.php,
godmode/reporting/graph_builder.php,
godmode/reporting/reporting_builder.item_editor.php,
include/functions_menu.php, include/functions_visual_map.php,
include/functions_db.php: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6759 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-07-10 12:38:02 +02:00
|
|
|
$year = '0001';
|
|
|
|
$date = $year . '-' . $month . '-' . $day;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!checkdate ($month, $day, $year)) {
|
2012-01-25 Junichi Satoh <junichi@rworks.jp>
* godmode/menu.php, godmode/alerts/alert_special_days.php,
godmode/alerts/configure_alert_special_days.php,
godmode/alerts/configure_alert_template.php,
extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql,
pandoradb.oracle.sql, pandoradb.postgreSQL.sql, pandoradb.sql,
include/functions_alerts.php: Added special days feature. It allows
to define special days (holidays and special working days) for
alert templates.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5421 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-01-25 07:13:43 +01:00
|
|
|
$result = '';
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$date_check = db_get_value ('date', 'talert_special_days', 'date
|
2012-07-10 Miguel de Dios <miguel.dedios@artica.es>
* install.php, operation/reporting/reporting_xml.php,
operation/netflow/nf_live_view.php, operation/netflow/nf_view.php,
operation/tree.php, operation/agentes/gis_view.php,
operation/agentes/estado_monitores.php,
operation/agentes/networkmap.php,
operation/agentes/datos_agente.php,
operation/agentes/alerts_status.php, operation/menu.php,
operation/snmpconsole/snmp_view.php, operation/users/user_edit.php,
godmode/groups/configure_group.php,
godmode/groups/configure_modu_group.php,
godmode/agentes/module_manager_editor_prediction.php,
godmode/servers/manage_recontask.php,
godmode/alerts/alert_compounds.php,
godmode/alerts/configure_alert_template.php,
godmode/alerts/alert_special_days.php, godmode/setup/links.php,
godmode/setup/os.php, godmode/users/configure_profile.php,
godmode/events/events.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_edit_modules.php,
godmode/massive/massive_standby_alerts.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_operations.php,
godmode/massive/massive_delete_profiles.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_nc_groups.php,
godmode/reporting/graph_builder.php,
godmode/reporting/reporting_builder.item_editor.php,
include/functions_menu.php, include/functions_visual_map.php,
include/functions_db.php: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6759 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-07-10 12:38:02 +02:00
|
|
|
', $date);
|
|
|
|
if ($date_check == $date) {
|
|
|
|
$result = '';
|
|
|
|
}
|
2012-01-25 Junichi Satoh <junichi@rworks.jp>
* godmode/menu.php, godmode/alerts/alert_special_days.php,
godmode/alerts/configure_alert_special_days.php,
godmode/alerts/configure_alert_template.php,
extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql,
pandoradb.oracle.sql, pandoradb.postgreSQL.sql, pandoradb.sql,
include/functions_alerts.php: Added special days feature. It allows
to define special days (holidays and special working days) for
alert templates.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5421 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-01-25 07:13:43 +01:00
|
|
|
else {
|
2013-04-02 08:29:38 +02:00
|
|
|
$result = alerts_create_alert_special_day ($date, $same_day, $values);
|
|
|
|
$info = 'Date: ' . $date . ' Same day of the week: ' . $same_day . ' Description: ' . $values['description'];
|
2012-01-25 Junichi Satoh <junichi@rworks.jp>
* godmode/menu.php, godmode/alerts/alert_special_days.php,
godmode/alerts/configure_alert_special_days.php,
godmode/alerts/configure_alert_template.php,
extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql,
pandoradb.oracle.sql, pandoradb.postgreSQL.sql, pandoradb.sql,
include/functions_alerts.php: Added special days feature. It allows
to define special days (holidays and special working days) for
alert templates.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5421 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-01-25 07:13:43 +01:00
|
|
|
}
|
|
|
|
}
|
2012-07-10 Miguel de Dios <miguel.dedios@artica.es>
* install.php, operation/reporting/reporting_xml.php,
operation/netflow/nf_live_view.php, operation/netflow/nf_view.php,
operation/tree.php, operation/agentes/gis_view.php,
operation/agentes/estado_monitores.php,
operation/agentes/networkmap.php,
operation/agentes/datos_agente.php,
operation/agentes/alerts_status.php, operation/menu.php,
operation/snmpconsole/snmp_view.php, operation/users/user_edit.php,
godmode/groups/configure_group.php,
godmode/groups/configure_modu_group.php,
godmode/agentes/module_manager_editor_prediction.php,
godmode/servers/manage_recontask.php,
godmode/alerts/alert_compounds.php,
godmode/alerts/configure_alert_template.php,
godmode/alerts/alert_special_days.php, godmode/setup/links.php,
godmode/setup/os.php, godmode/users/configure_profile.php,
godmode/events/events.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_edit_modules.php,
godmode/massive/massive_standby_alerts.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_operations.php,
godmode/massive/massive_delete_profiles.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_nc_groups.php,
godmode/reporting/graph_builder.php,
godmode/reporting/reporting_builder.item_editor.php,
include/functions_menu.php, include/functions_visual_map.php,
include/functions_db.php: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6759 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-07-10 12:38:02 +02:00
|
|
|
|
2012-01-25 Junichi Satoh <junichi@rworks.jp>
* godmode/menu.php, godmode/alerts/alert_special_days.php,
godmode/alerts/configure_alert_special_days.php,
godmode/alerts/configure_alert_template.php,
extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql,
pandoradb.oracle.sql, pandoradb.postgreSQL.sql, pandoradb.sql,
include/functions_alerts.php: Added special days feature. It allows
to define special days (holidays and special working days) for
alert templates.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5421 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-01-25 07:13:43 +01:00
|
|
|
if ($result) {
|
|
|
|
db_pandora_audit("Command management", "Create special day " . $result, false, false, $info);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
db_pandora_audit("Command management", "Fail try to create special day", false, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
ui_print_result_message ($result,
|
|
|
|
__('Successfully created'),
|
|
|
|
__('Could not be created'));
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($update_special_day) {
|
|
|
|
$id = (int) get_parameter ('id');
|
|
|
|
$alert = alerts_get_alert_special_day ($id);
|
|
|
|
$date = (string) get_parameter ('date');
|
|
|
|
$same_day = (string) get_parameter ('same_day');
|
|
|
|
$description = (string) get_parameter ('description');
|
2013-04-02 08:29:38 +02:00
|
|
|
$id_group = (string) get_parameter ('id_group');
|
2012-07-10 Miguel de Dios <miguel.dedios@artica.es>
* install.php, operation/reporting/reporting_xml.php,
operation/netflow/nf_live_view.php, operation/netflow/nf_view.php,
operation/tree.php, operation/agentes/gis_view.php,
operation/agentes/estado_monitores.php,
operation/agentes/networkmap.php,
operation/agentes/datos_agente.php,
operation/agentes/alerts_status.php, operation/menu.php,
operation/snmpconsole/snmp_view.php, operation/users/user_edit.php,
godmode/groups/configure_group.php,
godmode/groups/configure_modu_group.php,
godmode/agentes/module_manager_editor_prediction.php,
godmode/servers/manage_recontask.php,
godmode/alerts/alert_compounds.php,
godmode/alerts/configure_alert_template.php,
godmode/alerts/alert_special_days.php, godmode/setup/links.php,
godmode/setup/os.php, godmode/users/configure_profile.php,
godmode/events/events.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_edit_modules.php,
godmode/massive/massive_standby_alerts.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_operations.php,
godmode/massive/massive_delete_profiles.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_nc_groups.php,
godmode/reporting/graph_builder.php,
godmode/reporting/reporting_builder.item_editor.php,
include/functions_menu.php, include/functions_visual_map.php,
include/functions_db.php: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6759 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-07-10 12:38:02 +02:00
|
|
|
|
2012-01-25 Junichi Satoh <junichi@rworks.jp>
* godmode/menu.php, godmode/alerts/alert_special_days.php,
godmode/alerts/configure_alert_special_days.php,
godmode/alerts/configure_alert_template.php,
extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql,
pandoradb.oracle.sql, pandoradb.postgreSQL.sql, pandoradb.sql,
include/functions_alerts.php: Added special days feature. It allows
to define special days (holidays and special working days) for
alert templates.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5421 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-01-25 07:13:43 +01:00
|
|
|
list($year, $month, $day) = explode("-", $date);
|
|
|
|
if ($year == '*') {
|
|
|
|
# '0001' means every year.
|
|
|
|
$year = '0001';
|
|
|
|
$date = $year . '-' . $month . '-' . $day;
|
|
|
|
}
|
|
|
|
|
|
|
|
$values = array ();
|
|
|
|
$values['date'] = $date;
|
2013-04-02 08:29:38 +02:00
|
|
|
$values['id_group'] = $id_group;
|
2012-01-25 Junichi Satoh <junichi@rworks.jp>
* godmode/menu.php, godmode/alerts/alert_special_days.php,
godmode/alerts/configure_alert_special_days.php,
godmode/alerts/configure_alert_template.php,
extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql,
pandoradb.oracle.sql, pandoradb.postgreSQL.sql, pandoradb.sql,
include/functions_alerts.php: Added special days feature. It allows
to define special days (holidays and special working days) for
alert templates.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5421 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-01-25 07:13:43 +01:00
|
|
|
$values['same_day'] = $same_day;
|
|
|
|
$values['description'] = $description;
|
2012-07-10 Miguel de Dios <miguel.dedios@artica.es>
* install.php, operation/reporting/reporting_xml.php,
operation/netflow/nf_live_view.php, operation/netflow/nf_view.php,
operation/tree.php, operation/agentes/gis_view.php,
operation/agentes/estado_monitores.php,
operation/agentes/networkmap.php,
operation/agentes/datos_agente.php,
operation/agentes/alerts_status.php, operation/menu.php,
operation/snmpconsole/snmp_view.php, operation/users/user_edit.php,
godmode/groups/configure_group.php,
godmode/groups/configure_modu_group.php,
godmode/agentes/module_manager_editor_prediction.php,
godmode/servers/manage_recontask.php,
godmode/alerts/alert_compounds.php,
godmode/alerts/configure_alert_template.php,
godmode/alerts/alert_special_days.php, godmode/setup/links.php,
godmode/setup/os.php, godmode/users/configure_profile.php,
godmode/events/events.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_edit_modules.php,
godmode/massive/massive_standby_alerts.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_operations.php,
godmode/massive/massive_delete_profiles.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_nc_groups.php,
godmode/reporting/graph_builder.php,
godmode/reporting/reporting_builder.item_editor.php,
include/functions_menu.php, include/functions_visual_map.php,
include/functions_db.php: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6759 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-07-10 12:38:02 +02:00
|
|
|
|
2012-01-25 Junichi Satoh <junichi@rworks.jp>
* godmode/menu.php, godmode/alerts/alert_special_days.php,
godmode/alerts/configure_alert_special_days.php,
godmode/alerts/configure_alert_template.php,
extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql,
pandoradb.oracle.sql, pandoradb.postgreSQL.sql, pandoradb.sql,
include/functions_alerts.php: Added special days feature. It allows
to define special days (holidays and special working days) for
alert templates.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5421 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-01-25 07:13:43 +01:00
|
|
|
if (!checkdate ($month, $day, $year)) {
|
|
|
|
$result = '';
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$result = alerts_update_alert_special_day ($id, $values);
|
|
|
|
$info = 'Date: ' . $date . ' Same day of the week: ' . $same_day . ' Description: ' . $description;
|
|
|
|
}
|
2012-07-10 Miguel de Dios <miguel.dedios@artica.es>
* install.php, operation/reporting/reporting_xml.php,
operation/netflow/nf_live_view.php, operation/netflow/nf_view.php,
operation/tree.php, operation/agentes/gis_view.php,
operation/agentes/estado_monitores.php,
operation/agentes/networkmap.php,
operation/agentes/datos_agente.php,
operation/agentes/alerts_status.php, operation/menu.php,
operation/snmpconsole/snmp_view.php, operation/users/user_edit.php,
godmode/groups/configure_group.php,
godmode/groups/configure_modu_group.php,
godmode/agentes/module_manager_editor_prediction.php,
godmode/servers/manage_recontask.php,
godmode/alerts/alert_compounds.php,
godmode/alerts/configure_alert_template.php,
godmode/alerts/alert_special_days.php, godmode/setup/links.php,
godmode/setup/os.php, godmode/users/configure_profile.php,
godmode/events/events.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_edit_modules.php,
godmode/massive/massive_standby_alerts.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_operations.php,
godmode/massive/massive_delete_profiles.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_nc_groups.php,
godmode/reporting/graph_builder.php,
godmode/reporting/reporting_builder.item_editor.php,
include/functions_menu.php, include/functions_visual_map.php,
include/functions_db.php: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6759 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-07-10 12:38:02 +02:00
|
|
|
|
2012-01-25 Junichi Satoh <junichi@rworks.jp>
* godmode/menu.php, godmode/alerts/alert_special_days.php,
godmode/alerts/configure_alert_special_days.php,
godmode/alerts/configure_alert_template.php,
extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql,
pandoradb.oracle.sql, pandoradb.postgreSQL.sql, pandoradb.sql,
include/functions_alerts.php: Added special days feature. It allows
to define special days (holidays and special working days) for
alert templates.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5421 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-01-25 07:13:43 +01:00
|
|
|
if ($result) {
|
|
|
|
db_pandora_audit("Command management", "Update special day " . $id, false, false, $info);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
db_pandora_audit("Command management", "Fail to update special day " . $id, false, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
ui_print_result_message ($result,
|
|
|
|
__('Successfully updated'),
|
|
|
|
__('Could not be updated'));
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($delete_special_day) {
|
|
|
|
$id = (int) get_parameter ('id');
|
|
|
|
|
|
|
|
$result = alerts_delete_alert_special_day ($id);
|
|
|
|
|
|
|
|
if ($result) {
|
|
|
|
db_pandora_audit("Command management", "Delete special day " . $id);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
db_pandora_audit("Command management", "Fail to delete special day " . $id);
|
|
|
|
}
|
|
|
|
|
|
|
|
ui_print_result_message ($result,
|
|
|
|
__('Successfully deleted'),
|
|
|
|
__('Could not be deleted'));
|
|
|
|
}
|
|
|
|
|
|
|
|
$table->width = '98%';
|
|
|
|
$table->data = array ();
|
|
|
|
$table->head = array ();
|
|
|
|
$table->head[0] = __('Date');
|
|
|
|
$table->head[1] = __('Same day of the week');
|
|
|
|
$table->head[2] = __('Description');
|
2013-04-02 08:29:38 +02:00
|
|
|
$table->head[3] = __('Group');
|
|
|
|
$table->head[4] = __('Delete');
|
2012-01-25 Junichi Satoh <junichi@rworks.jp>
* godmode/menu.php, godmode/alerts/alert_special_days.php,
godmode/alerts/configure_alert_special_days.php,
godmode/alerts/configure_alert_template.php,
extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql,
pandoradb.oracle.sql, pandoradb.postgreSQL.sql, pandoradb.sql,
include/functions_alerts.php: Added special days feature. It allows
to define special days (holidays and special working days) for
alert templates.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5421 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-01-25 07:13:43 +01:00
|
|
|
$table->style = array ();
|
|
|
|
$table->style[0] = 'font-weight: bold';
|
|
|
|
$table->size = array ();
|
|
|
|
$table->size[0] = '20%';
|
|
|
|
$table->size[1] = '15%';
|
2013-04-02 08:29:38 +02:00
|
|
|
$table->size[2] = '55%';
|
2012-01-25 Junichi Satoh <junichi@rworks.jp>
* godmode/menu.php, godmode/alerts/alert_special_days.php,
godmode/alerts/configure_alert_special_days.php,
godmode/alerts/configure_alert_template.php,
extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql,
pandoradb.oracle.sql, pandoradb.postgreSQL.sql, pandoradb.sql,
include/functions_alerts.php: Added special days feature. It allows
to define special days (holidays and special working days) for
alert templates.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5421 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-01-25 07:13:43 +01:00
|
|
|
$table->size[3] = '5%';
|
2013-04-02 08:29:38 +02:00
|
|
|
$table->size[4] = '5%';
|
2012-01-25 Junichi Satoh <junichi@rworks.jp>
* godmode/menu.php, godmode/alerts/alert_special_days.php,
godmode/alerts/configure_alert_special_days.php,
godmode/alerts/configure_alert_template.php,
extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql,
pandoradb.oracle.sql, pandoradb.postgreSQL.sql, pandoradb.sql,
include/functions_alerts.php: Added special days feature. It allows
to define special days (holidays and special working days) for
alert templates.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5421 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-01-25 07:13:43 +01:00
|
|
|
$table->align = array ();
|
|
|
|
$table->align[3] = 'center';
|
2013-04-02 08:29:38 +02:00
|
|
|
$table->align[4] = 'center';
|
|
|
|
|
|
|
|
$filter = array();
|
|
|
|
if (!is_user_admin($config['id_user']))
|
|
|
|
$filter['id_group'] = array_keys(users_get_groups(false, "LM"));
|
2012-01-25 Junichi Satoh <junichi@rworks.jp>
* godmode/menu.php, godmode/alerts/alert_special_days.php,
godmode/alerts/configure_alert_special_days.php,
godmode/alerts/configure_alert_template.php,
extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql,
pandoradb.oracle.sql, pandoradb.postgreSQL.sql, pandoradb.sql,
include/functions_alerts.php: Added special days feature. It allows
to define special days (holidays and special working days) for
alert templates.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5421 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-01-25 07:13:43 +01:00
|
|
|
|
2013-04-02 08:29:38 +02:00
|
|
|
$special_days = db_get_all_rows_filter ('talert_special_days', $filter);
|
2012-01-25 Junichi Satoh <junichi@rworks.jp>
* godmode/menu.php, godmode/alerts/alert_special_days.php,
godmode/alerts/configure_alert_special_days.php,
godmode/alerts/configure_alert_template.php,
extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql,
pandoradb.oracle.sql, pandoradb.postgreSQL.sql, pandoradb.sql,
include/functions_alerts.php: Added special days feature. It allows
to define special days (holidays and special working days) for
alert templates.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5421 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-01-25 07:13:43 +01:00
|
|
|
if ($special_days === false)
|
|
|
|
$special_days = array ();
|
|
|
|
|
|
|
|
foreach ($special_days as $special_day) {
|
|
|
|
$data = array ();
|
|
|
|
|
|
|
|
$data[0] = '<span style="font-size: 7.5pt">';
|
|
|
|
# '0001' means every year.
|
|
|
|
$data[0] .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_special_days&id='.$special_day['id'].'">'.
|
2012-07-10 Miguel de Dios <miguel.dedios@artica.es>
* install.php, operation/reporting/reporting_xml.php,
operation/netflow/nf_live_view.php, operation/netflow/nf_view.php,
operation/tree.php, operation/agentes/gis_view.php,
operation/agentes/estado_monitores.php,
operation/agentes/networkmap.php,
operation/agentes/datos_agente.php,
operation/agentes/alerts_status.php, operation/menu.php,
operation/snmpconsole/snmp_view.php, operation/users/user_edit.php,
godmode/groups/configure_group.php,
godmode/groups/configure_modu_group.php,
godmode/agentes/module_manager_editor_prediction.php,
godmode/servers/manage_recontask.php,
godmode/alerts/alert_compounds.php,
godmode/alerts/configure_alert_template.php,
godmode/alerts/alert_special_days.php, godmode/setup/links.php,
godmode/setup/os.php, godmode/users/configure_profile.php,
godmode/events/events.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_edit_modules.php,
godmode/massive/massive_standby_alerts.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_operations.php,
godmode/massive/massive_delete_profiles.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_nc_groups.php,
godmode/reporting/graph_builder.php,
godmode/reporting/reporting_builder.item_editor.php,
include/functions_menu.php, include/functions_visual_map.php,
include/functions_db.php: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6759 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-07-10 12:38:02 +02:00
|
|
|
str_replace('0001', '*', $special_day['date']) . '</a>';
|
2012-01-25 Junichi Satoh <junichi@rworks.jp>
* godmode/menu.php, godmode/alerts/alert_special_days.php,
godmode/alerts/configure_alert_special_days.php,
godmode/alerts/configure_alert_template.php,
extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql,
pandoradb.oracle.sql, pandoradb.postgreSQL.sql, pandoradb.sql,
include/functions_alerts.php: Added special days feature. It allows
to define special days (holidays and special working days) for
alert templates.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5421 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-01-25 07:13:43 +01:00
|
|
|
$data[0] .= '</span>';
|
|
|
|
switch ($special_day['same_day']) {
|
|
|
|
case 'monday':
|
|
|
|
$data[1] = __('Monday');
|
|
|
|
break;
|
|
|
|
case 'tuesday':
|
|
|
|
$data[1] = __('Tuesday');
|
|
|
|
break;
|
|
|
|
case 'wednesday':
|
|
|
|
$data[1] = __('Wednesday');
|
|
|
|
break;
|
|
|
|
case 'thursday':
|
|
|
|
$data[1] = __('Thursday');
|
|
|
|
break;
|
|
|
|
case 'friday':
|
|
|
|
$data[1] = __('Friday');
|
|
|
|
break;
|
|
|
|
case 'saturday':
|
|
|
|
$data[1] = __('Saturday');
|
|
|
|
break;
|
|
|
|
case 'sunday':
|
|
|
|
$data[1] = __('Sunday');
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
$data[2] = $special_day['description'];
|
2013-04-02 08:29:38 +02:00
|
|
|
$data[3] = ui_print_group_icon ($special_day["id_group"], true);
|
|
|
|
$data[4] = '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_special_days&delete_special_day=1&id='.$special_day['id'].'"
|
2012-01-25 Junichi Satoh <junichi@rworks.jp>
* godmode/menu.php, godmode/alerts/alert_special_days.php,
godmode/alerts/configure_alert_special_days.php,
godmode/alerts/configure_alert_template.php,
extras/pandoradb_migrate_4.0.x_to_4.1.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_4.1.postgreSQL.sql,
pandoradb.oracle.sql, pandoradb.postgreSQL.sql, pandoradb.sql,
include/functions_alerts.php: Added special days feature. It allows
to define special days (holidays and special working days) for
alert templates.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5421 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-01-25 07:13:43 +01:00
|
|
|
onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.
|
|
|
|
html_print_image("images/cross.png", true) . '</a>';
|
|
|
|
|
|
|
|
array_push ($table->data, $data);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(isset($data)) {
|
|
|
|
html_print_table ($table);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
echo "<div class='nf'>".__('No special days configured')."</div>";
|
|
|
|
}
|
|
|
|
|
|
|
|
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
|
|
|
echo '<form method="post" action="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_special_days">';
|
|
|
|
html_print_submit_button (__('Create'), 'create', false, 'class="sub next"');
|
|
|
|
html_print_input_hidden ('create_special_day', 1);
|
|
|
|
echo '</form>';
|
|
|
|
echo '</div>';
|
|
|
|
?>
|