2012-08-23 16:24:43 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
// Pandora FMS - http://pandorafms.com
|
|
|
|
// ==================================================
|
|
|
|
// Copyright (c) 2005-2010 Artica Soluciones Tecnologicas
|
|
|
|
// 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;
|
|
|
|
|
|
|
|
check_login();
|
|
|
|
|
|
|
|
if (! check_acl ($config['id_user'], 0, "AW")) {
|
|
|
|
db_pandora_audit("ACL Violation",
|
|
|
|
"Trying to access downtime scheduler");
|
|
|
|
require ("general/noaccess.php");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
require_once ('include/functions_users.php');
|
|
|
|
|
|
|
|
// Header
|
|
|
|
ui_print_page_header(
|
2013-04-24 14:57:46 +02:00
|
|
|
__("Planned Downtime"),
|
2013-04-10 09:57:54 +02:00
|
|
|
"images/gm_monitoring.png",
|
2012-08-23 16:24:43 +02:00
|
|
|
false,
|
2013-04-24 14:57:46 +02:00
|
|
|
"planned_downtime",
|
2012-08-23 16:24:43 +02:00
|
|
|
true,
|
|
|
|
"");
|
|
|
|
|
|
|
|
// Load global vars
|
|
|
|
global $config;
|
|
|
|
|
|
|
|
check_login();
|
|
|
|
|
|
|
|
//Initialize data
|
|
|
|
$id_agent = get_parameter ("id_agent");
|
|
|
|
$id_group = (int) get_parameter ("id_group", 0);
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
$name = (string) get_parameter ('name', '');
|
|
|
|
$description = (string) get_parameter ('description', '');
|
2013-06-11 Miguel de Dios <miguel.dedios@artica.es>
* extensions/insert_data.php,
godmode/alerts/configure_alert_template.php,
godmode/reporting/reporting_builder.item_editor.php,
godmode/agentes/planned_downtime.editor.php,
include/ajax/module.php, include/constants.php, operation/tree.php,
operation/netflow/nf_live_view.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
operation/agentes/datos_agente.php: fixed the date and time format
and set a help tip to say the Pandora's format.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8287 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-06-11 15:14:48 +02:00
|
|
|
$once_date_from = (string) get_parameter ('once_date_from', date(DATE_FORMAT));
|
|
|
|
$once_time_from = (string) get_parameter ('once_time_from', date(TIME_FORMAT));
|
|
|
|
$once_date_to = (string) get_parameter ('once_date_to', date(DATE_FORMAT));
|
|
|
|
$once_time_to = (string) get_parameter ('once_time_to', date(TIME_FORMAT));
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
$periodically_day_from = (int) get_parameter ('periodically_day_from', 1);
|
|
|
|
$periodically_day_to = (int) get_parameter ('periodically_day_to', 31);
|
2013-06-11 Miguel de Dios <miguel.dedios@artica.es>
* extensions/insert_data.php,
godmode/alerts/configure_alert_template.php,
godmode/reporting/reporting_builder.item_editor.php,
godmode/agentes/planned_downtime.editor.php,
include/ajax/module.php, include/constants.php, operation/tree.php,
operation/netflow/nf_live_view.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
operation/agentes/datos_agente.php: fixed the date and time format
and set a help tip to say the Pandora's format.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8287 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-06-11 15:14:48 +02:00
|
|
|
$periodically_time_from = (string) get_parameter ('periodically_time_from', date(TIME_FORMAT));
|
|
|
|
$periodically_time_to = (string) get_parameter ('periodically_time_to', date(TIME_FORMAT));
|
2012-08-23 16:24:43 +02:00
|
|
|
|
|
|
|
$first_create = (int) get_parameter ('first_create', 0);
|
|
|
|
|
|
|
|
$create_downtime = (int) get_parameter ('create_downtime');
|
|
|
|
|
2013-02-12 19:25:34 +01:00
|
|
|
|
2012-08-23 16:24:43 +02:00
|
|
|
$edit_downtime = (int) get_parameter ('edit_downtime');
|
|
|
|
$update_downtime = (int) get_parameter ('update_downtime');
|
|
|
|
$id_downtime = (int) get_parameter ('id_downtime',0);
|
|
|
|
|
|
|
|
$insert_downtime_agent = (int) get_parameter ("insert_downtime_agent", 0);
|
|
|
|
$delete_downtime_agent = (int) get_parameter ("delete_downtime_agent", 0);
|
|
|
|
|
|
|
|
$groups = users_get_groups ();
|
|
|
|
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
$type_downtime = get_parameter('type_downtime', 'quiet');
|
|
|
|
$type_execution = get_parameter('type_execution', 'once');
|
|
|
|
$type_periodicity = get_parameter('type_periodicity', 'weekly');
|
|
|
|
|
|
|
|
$monday = (bool) get_parameter ('monday');
|
|
|
|
$tuesday = (bool) get_parameter ('tuesday');
|
|
|
|
$wednesday = (bool) get_parameter ('wednesday');
|
|
|
|
$thursday = (bool) get_parameter ('thursday');
|
|
|
|
$friday = (bool) get_parameter ('friday');
|
|
|
|
$saturday = (bool) get_parameter ('saturday');
|
|
|
|
$sunday = (bool) get_parameter ('sunday');
|
2012-08-23 16:24:43 +02:00
|
|
|
|
2013-02-12 19:25:34 +01:00
|
|
|
|
2012-08-23 16:24:43 +02:00
|
|
|
|
|
|
|
// INSERT A NEW DOWNTIME_AGENT ASSOCIATION
|
|
|
|
if ($insert_downtime_agent == 1) {
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
$agents = (array)get_parameter("id_agents", array());
|
|
|
|
$module_names = (array)get_parameter("module", array());
|
|
|
|
$all_modules = false;
|
2013-06-11 Miguel de Dios <miguel.dedios@artica.es>
* extensions/insert_data.php,
godmode/alerts/configure_alert_template.php,
godmode/reporting/reporting_builder.item_editor.php,
godmode/agentes/planned_downtime.editor.php,
include/ajax/module.php, include/constants.php, operation/tree.php,
operation/netflow/nf_live_view.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
operation/agentes/datos_agente.php: fixed the date and time format
and set a help tip to say the Pandora's format.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8287 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-06-11 15:14:48 +02:00
|
|
|
if (empty($module_names)) {
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
$all_modules = true;
|
2013-06-11 Miguel de Dios <miguel.dedios@artica.es>
* extensions/insert_data.php,
godmode/alerts/configure_alert_template.php,
godmode/reporting/reporting_builder.item_editor.php,
godmode/agentes/planned_downtime.editor.php,
include/ajax/module.php, include/constants.php, operation/tree.php,
operation/netflow/nf_live_view.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
operation/agentes/datos_agente.php: fixed the date and time format
and set a help tip to say the Pandora's format.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8287 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-06-11 15:14:48 +02:00
|
|
|
}
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
else {
|
|
|
|
//It is empty.
|
2012-08-30 18:27:03 +02:00
|
|
|
if ($module_names[0] == "0")
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
$all_modules = true;
|
|
|
|
}
|
|
|
|
|
2013-02-12 19:25:34 +01:00
|
|
|
for ($a=0; $a < count($agents); $a++) {
|
2012-08-23 16:24:43 +02:00
|
|
|
$id_agente_dt = $agents[$a];
|
|
|
|
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
|
2012-08-23 16:24:43 +02:00
|
|
|
$values = array(
|
|
|
|
'id_downtime' => $id_downtime,
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
'id_agent' => $id_agente_dt,
|
|
|
|
'all_modules' => $all_modules);
|
|
|
|
|
2012-08-23 16:24:43 +02:00
|
|
|
$result = db_process_sql_insert('tplanned_downtime_agents', $values);
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
if ($result && !$all_modules) {
|
|
|
|
foreach ($module_names as $module_name) {
|
|
|
|
$module =
|
|
|
|
modules_get_agentmodule_id($module_name, $id_agente_dt);
|
|
|
|
$values = array(
|
|
|
|
'id_downtime' => $id_downtime,
|
|
|
|
'id_agent' => $id_agente_dt,
|
|
|
|
'id_agent_module' => $module["id_agente_modulo"]);
|
|
|
|
$result = db_process_sql_insert('tplanned_downtime_modules', $values);
|
2013-03-07 18:20:41 +01:00
|
|
|
|
|
|
|
if ($result) {
|
|
|
|
$values = array('id_user' => $config['id_user']);
|
|
|
|
$result = db_process_sql_update('tplanned_downtime',
|
|
|
|
$values, array('id' => $id_downtime));
|
|
|
|
}
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
}
|
|
|
|
}
|
2012-08-23 16:24:43 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// DELETE A DOWNTIME_AGENT ASSOCIATION
|
|
|
|
if ($delete_downtime_agent == 1) {
|
|
|
|
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
$id_da = (int)get_parameter ("id_downtime_agent", 0);
|
|
|
|
$id_agent_delete = (int)get_parameter('id_agent', 0);
|
2012-08-23 16:24:43 +02:00
|
|
|
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
$row_to_delete = db_get_row('tplanned_downtime_agents', 'id', $id_da);
|
|
|
|
|
|
|
|
$result = db_process_sql_delete('tplanned_downtime_agents',
|
|
|
|
array('id' => $id_da));
|
|
|
|
|
|
|
|
if ($result) {
|
|
|
|
//Delete modules in downtime
|
|
|
|
db_process_sql_delete('tplanned_downtime_modules',
|
|
|
|
array('id_downtime' => $row_to_delete['id_downtime'],
|
|
|
|
'id_agent' => $id_agent_delete));
|
|
|
|
}
|
2012-08-23 16:24:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// UPDATE OR CREATE A DOWNTIME (MAIN DATA, NOT AGENT ASSOCIATION)
|
|
|
|
if ($create_downtime || $update_downtime) {
|
|
|
|
$check = db_get_value ('name', 'tplanned_downtime', 'name', $name);
|
|
|
|
|
2013-02-12 19:25:34 +01:00
|
|
|
$datetime_from = strtotime ($once_date_from . ' ' . $once_time_from);
|
|
|
|
$datetime_to = strtotime ($once_date_to . ' ' . $once_time_to);
|
2014-06-04 09:36:28 +02:00
|
|
|
$now = strtotime(date(DATE_FORMAT). ' ' . date(TIME_FORMAT));
|
2014-05-19 12:52:33 +02:00
|
|
|
|
2014-06-04 09:36:28 +02:00
|
|
|
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) {
|
2013-02-12 19:25:34 +01:00
|
|
|
ui_print_error_message(__('Not created. Error inserting data' ).
|
|
|
|
': START >= END');
|
2012-08-23 16:24:43 +02:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
$sql = '';
|
|
|
|
if ($create_downtime) {
|
|
|
|
if (trim(io_safe_output($name)) != '') {
|
|
|
|
if (!$check) {
|
|
|
|
$values = array(
|
|
|
|
'name' => $name,
|
|
|
|
'description' => $description,
|
|
|
|
'date_from' => $datetime_from,
|
|
|
|
'date_to' => $datetime_to,
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
'executed' => 0,
|
2012-08-23 16:24:43 +02:00
|
|
|
'id_group' => $id_group,
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
'only_alerts' => 0,
|
|
|
|
'monday' => $monday,
|
|
|
|
'tuesday' => $tuesday,
|
|
|
|
'wednesday' => $wednesday,
|
|
|
|
'thursday' => $thursday,
|
|
|
|
'friday' => $friday,
|
|
|
|
'saturday' => $saturday,
|
|
|
|
'sunday' => $sunday,
|
|
|
|
'periodically_time_from' => $periodically_time_from,
|
|
|
|
'periodically_time_to' => $periodically_time_to,
|
|
|
|
'periodically_day_from' => $periodically_day_from,
|
|
|
|
'periodically_day_to' => $periodically_day_to,
|
|
|
|
'type_downtime' => $type_downtime,
|
|
|
|
'type_execution' => $type_execution,
|
2013-03-07 18:20:41 +01:00
|
|
|
'type_periodicity' => $type_periodicity,
|
|
|
|
'id_user' => $config['id_user']
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
);
|
|
|
|
$result = db_process_sql_insert(
|
|
|
|
'tplanned_downtime', $values);
|
2012-08-23 16:24:43 +02:00
|
|
|
}
|
|
|
|
else {
|
2013-02-12 19:25:34 +01:00
|
|
|
ui_print_error_message(
|
|
|
|
__('Each planned downtime must have a different name'));
|
2012-08-23 16:24:43 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
2013-02-12 19:25:34 +01:00
|
|
|
ui_print_error_message(
|
|
|
|
__('Planned downtime must have a name'));
|
2012-08-23 16:24:43 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ($update_downtime) {
|
|
|
|
if (trim(io_safe_output($name)) != '') {
|
|
|
|
$values = array(
|
|
|
|
'name' => $name,
|
|
|
|
'description' => $description,
|
|
|
|
'date_from' => $datetime_from,
|
|
|
|
'date_to' => $datetime_to,
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
'executed' => 0,
|
2012-08-23 16:24:43 +02:00
|
|
|
'id_group' => $id_group,
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
'only_alerts' => 0,
|
|
|
|
'monday' => $monday,
|
|
|
|
'tuesday' => $tuesday,
|
|
|
|
'wednesday' => $wednesday,
|
|
|
|
'thursday' => $thursday,
|
|
|
|
'friday' => $friday,
|
|
|
|
'saturday' => $saturday,
|
|
|
|
'sunday' => $sunday,
|
|
|
|
'periodically_time_from' => $periodically_time_from,
|
|
|
|
'periodically_time_to' => $periodically_time_to,
|
|
|
|
'periodically_day_from' => $periodically_day_from,
|
|
|
|
'periodically_day_to' => $periodically_day_to,
|
|
|
|
'type_downtime' => $type_downtime,
|
|
|
|
'type_execution' => $type_execution,
|
2013-03-07 18:20:41 +01:00
|
|
|
'type_periodicity' => $type_periodicity,
|
|
|
|
'id_user' => $config['id_user']
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
);
|
2012-08-23 16:24:43 +02:00
|
|
|
$result = db_process_sql_update('tplanned_downtime', $values, array('id' => $id_downtime));
|
|
|
|
}
|
|
|
|
else {
|
2013-02-12 19:25:34 +01:00
|
|
|
ui_print_error_message(
|
|
|
|
__('Planned downtime must have a name'));
|
2012-08-23 16:24:43 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($result === false) {
|
|
|
|
if ($create_downtime) {
|
2013-02-12 19:25:34 +01:00
|
|
|
ui_print_error_message(__('Could not be created'));
|
2012-08-23 16:24:43 +02:00
|
|
|
}
|
|
|
|
else {
|
2013-02-12 19:25:34 +01:00
|
|
|
ui_print_error_message(__('Could not be updated'));
|
2012-08-23 16:24:43 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if ($create_downtime && $name && !$check) {
|
|
|
|
$id_downtime = $result;
|
2013-02-12 19:25:34 +01:00
|
|
|
ui_print_success_message(__('Successfully created'));
|
2012-08-23 16:24:43 +02:00
|
|
|
}
|
|
|
|
else if ($update_downtime && $name) {
|
2013-02-12 19:25:34 +01:00
|
|
|
ui_print_success_message(__('Successfully updated'));
|
2012-08-23 16:24:43 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Have any data to show ?
|
|
|
|
if ($id_downtime > 0) {
|
|
|
|
switch ($config["dbtype"]) {
|
|
|
|
case "mysql":
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
$sql = sprintf ("SELECT *
|
2013-06-11 Miguel de Dios <miguel.dedios@artica.es>
* extensions/insert_data.php,
godmode/alerts/configure_alert_template.php,
godmode/reporting/reporting_builder.item_editor.php,
godmode/agentes/planned_downtime.editor.php,
include/ajax/module.php, include/constants.php, operation/tree.php,
operation/netflow/nf_live_view.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
operation/agentes/datos_agente.php: fixed the date and time format
and set a help tip to say the Pandora's format.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8287 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-06-11 15:14:48 +02:00
|
|
|
FROM `tplanned_downtime`
|
|
|
|
WHERE `id` = %d",
|
2012-08-23 16:24:43 +02:00
|
|
|
$id_downtime);
|
|
|
|
break;
|
|
|
|
case "postgresql":
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
$sql = sprintf ("SELECT *
|
2013-06-11 Miguel de Dios <miguel.dedios@artica.es>
* extensions/insert_data.php,
godmode/alerts/configure_alert_template.php,
godmode/reporting/reporting_builder.item_editor.php,
godmode/agentes/planned_downtime.editor.php,
include/ajax/module.php, include/constants.php, operation/tree.php,
operation/netflow/nf_live_view.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
operation/agentes/datos_agente.php: fixed the date and time format
and set a help tip to say the Pandora's format.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8287 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-06-11 15:14:48 +02:00
|
|
|
FROM \"tplanned_downtime\"
|
|
|
|
WHERE \"id\" = %d",
|
2012-08-23 16:24:43 +02:00
|
|
|
$id_downtime);
|
|
|
|
break;
|
|
|
|
case "oracle":
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
$sql = sprintf ("SELECT *
|
2013-06-11 Miguel de Dios <miguel.dedios@artica.es>
* extensions/insert_data.php,
godmode/alerts/configure_alert_template.php,
godmode/reporting/reporting_builder.item_editor.php,
godmode/agentes/planned_downtime.editor.php,
include/ajax/module.php, include/constants.php, operation/tree.php,
operation/netflow/nf_live_view.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
operation/agentes/datos_agente.php: fixed the date and time format
and set a help tip to say the Pandora's format.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8287 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-06-11 15:14:48 +02:00
|
|
|
FROM tplanned_downtime
|
|
|
|
WHERE id = %d",
|
2012-08-23 16:24:43 +02:00
|
|
|
$id_downtime);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
$result = db_get_row_sql ($sql);
|
|
|
|
$name = $result["name"];
|
|
|
|
$description = $result["description"];
|
2013-06-11 Miguel de Dios <miguel.dedios@artica.es>
* extensions/insert_data.php,
godmode/alerts/configure_alert_template.php,
godmode/reporting/reporting_builder.item_editor.php,
godmode/agentes/planned_downtime.editor.php,
include/ajax/module.php, include/constants.php, operation/tree.php,
operation/netflow/nf_live_view.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
operation/agentes/datos_agente.php: fixed the date and time format
and set a help tip to say the Pandora's format.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8287 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-06-11 15:14:48 +02:00
|
|
|
$once_date_from = date(DATE_FORMAT, $result["date_from"]);
|
|
|
|
$once_date_to = date(DATE_FORMAT, $result["date_to"]);
|
|
|
|
$once_time_from = date(TIME_FORMAT, $result["date_from"]);
|
|
|
|
$once_time_to = date(TIME_FORMAT, $result["date_to"]);
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
$monday = $result['monday'];
|
|
|
|
$tuesday = $result['tuesday'];
|
|
|
|
$wednesday = $result['wednesday'];
|
|
|
|
$thursday = $result['thursday'];
|
|
|
|
$friday = $result['friday'];
|
|
|
|
$saturday = $result['saturday'];
|
|
|
|
$sunday = $result['sunday'];
|
|
|
|
$periodically_time_from = $result['periodically_time_from'];
|
|
|
|
$periodically_time_to = $result['periodically_time_to'];
|
|
|
|
$periodically_day_from = $result['periodically_day_from'];
|
|
|
|
$periodically_day_to = $result['periodically_day_to'];
|
|
|
|
$type_downtime = $result['type_downtime'];
|
|
|
|
$type_execution = $result['type_execution'];
|
|
|
|
$type_periodicity = $result['type_periodicity'];
|
2012-08-23 16:24:43 +02:00
|
|
|
|
|
|
|
if ($id_group == 0)
|
|
|
|
$id_group = $result['id_group'];
|
|
|
|
}
|
|
|
|
|
|
|
|
$table->class = 'databox_color';
|
|
|
|
$table->width = '98%';
|
|
|
|
$table->data = array ();
|
|
|
|
$table->data[0][0] = __('Name');
|
|
|
|
$table->data[0][1] = html_print_input_text ('name', $name, '', 25, 40, true);
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
$table->data[1][0] = __('Group');
|
2013-07-17 10:15:22 +02:00
|
|
|
$table->data[1][1] = html_print_select_groups(false, "AW", true, 'id_group', $id_group, '', '', 0, true);
|
2012-08-23 16:24:43 +02:00
|
|
|
$table->data[2][0] = __('Description');
|
|
|
|
$table->data[2][1] = html_print_textarea ('description', 3, 35, $description, '', true);
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
|
2014-04-02 13:11:06 +02:00
|
|
|
$table->data[3][0] = __('Type').ui_print_help_tip(__("Quiet: Disable modules that we indicate below.").'<br>'.
|
|
|
|
__("Disable Agents: Disables the selected agents.").'<br>'.
|
|
|
|
__("Disable Alerts: Disable alerts for the selected agents."), true);
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
$table->data[3][1] = html_print_select(array('quiet' => __('Quiet'),
|
|
|
|
'disable_agents' => __('Disabled Agents'),
|
2012-08-30 18:27:03 +02:00
|
|
|
'disable_agents_alerts' => __('Disabled only Alerts')),
|
2013-02-12 19:25:34 +01:00
|
|
|
'type_downtime', $type_downtime, 'change_type_downtime()', '', 0, true, false, true,
|
2012-11-19 07:23:24 +01:00
|
|
|
'');
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
$table->data[4][0] = __('Execution');
|
|
|
|
$table->data[4][1] = html_print_select(array('once' => __('once'),
|
|
|
|
'periodically' => __('Periodically')),
|
|
|
|
'type_execution', $type_execution, 'change_type_execution();', '', 0, true);
|
|
|
|
|
|
|
|
$days = array_combine(range(1, 31), range(1, 31));
|
|
|
|
$table->data[5][0] = __('Configure the time');
|
|
|
|
$table->data[5][1] = "
|
|
|
|
<div id='once_time' style='display: none;'>
|
|
|
|
<table>
|
|
|
|
<tr>
|
2013-06-11 15:39:03 +02:00
|
|
|
<td>" .
|
|
|
|
__('From:') .
|
|
|
|
ui_print_help_tip(__('Date format in Pandora is year/month/day'), true) .
|
|
|
|
ui_print_help_tip(__('Time format in Pandora is hours(24h):minutes:seconds'), true) .
|
|
|
|
"</td>
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
<td>".
|
|
|
|
html_print_input_text ('once_date_from', $once_date_from, '', 10, 10, true) .
|
2014-05-07 16:14:23 +02:00
|
|
|
html_print_input_text ('once_time_from', $once_time_from, '', 7, 8, true) .
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
"</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
2013-06-11 15:39:03 +02:00
|
|
|
<td>" .
|
|
|
|
__('To:') .
|
|
|
|
ui_print_help_tip(__('Date format in Pandora is year/month/day'), true) .
|
|
|
|
ui_print_help_tip(__('Time format in Pandora is hours(24h):minutes:seconds'), true) .
|
|
|
|
"</td>
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
<td>".
|
|
|
|
html_print_input_text ('once_date_to', $once_date_to, '', 10, 10, true) .
|
2014-05-07 16:14:23 +02:00
|
|
|
html_print_input_text ('once_time_to', $once_time_to, '', 7, 8, true) .
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
"</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<div id='periodically_time' style='display: none;'>
|
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<td>" . __('Type Periodicity:') . "</td>
|
|
|
|
<td>".
|
|
|
|
html_print_select(array(
|
2013-06-11 Miguel de Dios <miguel.dedios@artica.es>
* extensions/insert_data.php,
godmode/alerts/configure_alert_template.php,
godmode/reporting/reporting_builder.item_editor.php,
godmode/agentes/planned_downtime.editor.php,
include/ajax/module.php, include/constants.php, operation/tree.php,
operation/netflow/nf_live_view.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
operation/agentes/datos_agente.php: fixed the date and time format
and set a help tip to say the Pandora's format.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8287 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-06-11 15:14:48 +02:00
|
|
|
'weekly' => __('Weekly'),
|
|
|
|
'monthly' => __('Monthly')),
|
|
|
|
'type_periodicity', $type_periodicity,
|
|
|
|
'change_type_periodicity();', '', 0, true) .
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
"</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td colspan='2'>
|
|
|
|
<table id='weekly_item' style='display: none;'>
|
|
|
|
<tr>
|
|
|
|
<td>" . __('Mon') .
|
|
|
|
html_print_checkbox ('monday', 1, $monday, true) .
|
|
|
|
"</td>
|
|
|
|
<td>" . __('Tue') .
|
|
|
|
html_print_checkbox ('tuesday', 1, $tuesday, true) .
|
|
|
|
"</td>
|
|
|
|
<td>" . __('Wed') .
|
|
|
|
html_print_checkbox ('wednesday', 1, $wednesday, true) .
|
|
|
|
"</td>
|
|
|
|
<td>" . __('Thu') .
|
|
|
|
html_print_checkbox ('thursday', 1, $thursday, true) .
|
|
|
|
"</td>
|
|
|
|
<td>" . __('Fri') .
|
|
|
|
html_print_checkbox ('friday', 1, $friday, true) .
|
|
|
|
"</td>
|
|
|
|
<td>" . __('Sat') .
|
|
|
|
html_print_checkbox ('saturday', 1, $saturday, true) .
|
|
|
|
"</td>
|
|
|
|
<td>" . __('Sun') .
|
|
|
|
html_print_checkbox ('sunday', 1, $sunday, true) .
|
|
|
|
"</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<table id='monthly_item' style='display: none;'>
|
|
|
|
<tr>
|
|
|
|
<td>" . __('From day:') . "</td>
|
|
|
|
<td>".
|
|
|
|
html_print_select($days,
|
2013-02-12 19:25:34 +01:00
|
|
|
'periodically_day_from', $periodically_day_from, '', '', 0, true) .
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
"</td>
|
|
|
|
<td>" . __('To day:') . "</td>
|
|
|
|
<td>".
|
|
|
|
html_print_select($days,
|
2013-02-12 19:25:34 +01:00
|
|
|
'periodically_day_to', $periodically_day_to, '', '', 0, true) .
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
"</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<td>" . __('From hour:') . "</td>
|
|
|
|
<td>".
|
|
|
|
html_print_input_text (
|
|
|
|
'periodically_time_from',
|
|
|
|
$periodically_time_from, '', 7, 7, true) .
|
|
|
|
"</td>
|
|
|
|
<td>" . __('To hour:') . "</td>
|
|
|
|
<td>".
|
|
|
|
html_print_input_text (
|
|
|
|
'periodically_time_to',
|
|
|
|
$periodically_time_to, '', 7, 7, true) .
|
|
|
|
"</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</div>";
|
|
|
|
|
2012-08-23 16:24:43 +02:00
|
|
|
echo '<form method="POST" action="index.php?sec=gagente&sec2=godmode/agentes/planned_downtime.editor">';
|
|
|
|
|
|
|
|
if ($id_downtime > 0) {
|
|
|
|
echo "<table width=100% border=0 cellpadding=4 >";
|
|
|
|
echo "<tr><td width=75% valign='top'>";
|
|
|
|
}
|
|
|
|
|
|
|
|
//Editor form
|
|
|
|
html_print_table ($table);
|
|
|
|
|
|
|
|
html_print_input_hidden ('id_agent', $id_agent);
|
|
|
|
echo '<div class="action-buttons" style="width: 90%">';
|
|
|
|
if ($id_downtime) {
|
|
|
|
html_print_input_hidden ('update_downtime', 1);
|
|
|
|
html_print_input_hidden ('id_downtime', $id_downtime);
|
|
|
|
html_print_submit_button (__('Update'), 'updbutton', false, 'class="sub upd"');
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
html_print_input_hidden ('create_downtime', 1);
|
|
|
|
html_print_submit_button (__('Add'), 'crtbutton', false, 'class="sub wand"');
|
|
|
|
}
|
|
|
|
echo '</div>';
|
|
|
|
echo '</form>';
|
|
|
|
|
|
|
|
if ($id_downtime > 0) {
|
|
|
|
|
|
|
|
echo "<td valign=top>";
|
|
|
|
// Show available agents to include into downtime
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
echo '<h4>' . __('Available agents') . ':</h4>';
|
2012-08-23 16:24:43 +02:00
|
|
|
|
|
|
|
$filter_group = get_parameter("filter_group", 0);
|
|
|
|
|
|
|
|
$filter_cond = '';
|
|
|
|
if($filter_group > 0)
|
|
|
|
$filter_cond = " AND id_grupo = $filter_group ";
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
$sql = sprintf ("SELECT tagente.id_agente, tagente.nombre,
|
|
|
|
tagente.id_grupo
|
2012-08-23 16:24:43 +02:00
|
|
|
FROM tagente
|
|
|
|
WHERE tagente.id_agente NOT IN (
|
|
|
|
SELECT tagente.id_agente
|
|
|
|
FROM tagente, tplanned_downtime_agents
|
|
|
|
WHERE tplanned_downtime_agents.id_agent = tagente.id_agente
|
|
|
|
AND tplanned_downtime_agents.id_downtime = %d
|
|
|
|
) AND disabled = 0 $filter_cond
|
|
|
|
ORDER by tagente.nombre", $id_downtime);
|
|
|
|
$downtimes = db_get_all_rows_sql ($sql);
|
|
|
|
$data = array ();
|
|
|
|
if ($downtimes) {
|
|
|
|
foreach ($downtimes as $downtime) {
|
2013-07-17 10:15:22 +02:00
|
|
|
if (check_acl ($config["id_user"], $downtime['id_grupo'], "AW")) {
|
2012-08-23 16:24:43 +02:00
|
|
|
$data[$downtime['id_agente']] = $downtime['nombre'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$disabled_add_button = false;
|
|
|
|
if (empty($data)) {
|
|
|
|
$disabled_add_button = true;
|
|
|
|
}
|
|
|
|
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
echo "<form method=post action='index.php?sec=gagente&sec2=godmode/agentes/planned_downtime.editor&id_downtime=$id_downtime'>";
|
2012-08-23 16:24:43 +02:00
|
|
|
|
2013-07-17 10:15:22 +02:00
|
|
|
html_print_select_groups(false, "AW", true, 'filter_group', $filter_group, '', '', '', false, false, true, '', false, 'width:180px');
|
2012-08-23 16:24:43 +02:00
|
|
|
|
|
|
|
echo "<br /><br />";
|
|
|
|
html_print_submit_button (__('Filter by group'), '', false, 'class="sub next"',false);
|
|
|
|
echo "</form>";
|
|
|
|
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
echo "<form method=post action='index.php?sec=gagente&sec2=godmode/agentes/planned_downtime.editor&insert_downtime_agent=1&id_downtime=$id_downtime'>";
|
|
|
|
|
|
|
|
echo html_print_select ($data, "id_agents[]", '', '', '', 0, false, true, true, '', false, 'width: 180px;');
|
|
|
|
echo '<h4>' . __('Available modules:') .
|
|
|
|
ui_print_help_tip (__('Only for type Quiet for downtimes.'), true) . '</h4>';
|
2012-08-23 16:24:43 +02:00
|
|
|
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
if ($type_downtime != 'quiet')
|
2013-02-12 19:25:34 +01:00
|
|
|
echo '<div id="available_modules" style="display: none;">';
|
|
|
|
else
|
|
|
|
echo '<div id="available_modules" style="">';
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
echo html_print_select (array(), "module[]", '', '', '', 0, false, true, true, '', false, 'width: 180px;');
|
|
|
|
echo "</div>";
|
2012-08-23 16:24:43 +02:00
|
|
|
echo "<br /><br /><br />";
|
|
|
|
html_print_submit_button (__('Add'), '', $disabled_add_button, 'class="sub next"',false);
|
|
|
|
echo "</form>";
|
|
|
|
echo "</table>";
|
|
|
|
|
|
|
|
//Start Overview of existing planned downtime
|
|
|
|
echo '<h4>'.__('Agents planned for this downtime').':</h4>';
|
|
|
|
|
|
|
|
$sql = sprintf ("SELECT tagente.nombre, tplanned_downtime_agents.id,
|
|
|
|
tagente.id_os, tagente.id_agente, tagente.id_grupo,
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
tagente.ultimo_contacto, tplanned_downtime_agents.all_modules
|
2012-08-23 16:24:43 +02:00
|
|
|
FROM tagente, tplanned_downtime_agents
|
|
|
|
WHERE tplanned_downtime_agents.id_agent = tagente.id_agente
|
2013-02-12 19:25:34 +01:00
|
|
|
AND tplanned_downtime_agents.id_downtime = %d ", $id_downtime);
|
2012-08-23 16:24:43 +02:00
|
|
|
|
|
|
|
$downtimes = db_get_all_rows_sql ($sql);
|
|
|
|
if ($downtimes === false) {
|
2013-06-11 Miguel de Dios <miguel.dedios@artica.es>
* extensions/insert_data.php,
godmode/alerts/configure_alert_template.php,
godmode/reporting/reporting_builder.item_editor.php,
godmode/agentes/planned_downtime.editor.php,
include/ajax/module.php, include/constants.php, operation/tree.php,
operation/netflow/nf_live_view.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
operation/agentes/datos_agente.php: fixed the date and time format
and set a help tip to say the Pandora's format.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8287 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-06-11 15:14:48 +02:00
|
|
|
echo '<div class="nf">' .
|
|
|
|
__('There are no scheduled downtimes') . '</div>';
|
2012-08-23 16:24:43 +02:00
|
|
|
}
|
|
|
|
else {
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
$table->id = 'list';
|
2012-08-23 16:24:43 +02:00
|
|
|
$table->class = 'databox';
|
|
|
|
$table->width = '98%';
|
|
|
|
$table->data = array ();
|
|
|
|
$table->head = array ();
|
|
|
|
$table->head[0] = __('Name');
|
|
|
|
$table->head[1] = __('Group');
|
|
|
|
$table->head[2] = __('OS');
|
|
|
|
$table->head[3] = __('Last contact');
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
$table->head['count_modules'] = __('Modules');
|
|
|
|
$table->head[5] = __('Actions');
|
|
|
|
$table->align[5] = "center";
|
|
|
|
$table->size[5] = "5%";
|
2012-08-23 16:24:43 +02:00
|
|
|
|
|
|
|
foreach ($downtimes as $downtime) {
|
|
|
|
$data = array ();
|
|
|
|
|
|
|
|
$data[0] = $downtime['nombre'];
|
|
|
|
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
$data[1] = db_get_sql ("SELECT nombre
|
|
|
|
FROM tgrupo
|
2013-06-11 Miguel de Dios <miguel.dedios@artica.es>
* extensions/insert_data.php,
godmode/alerts/configure_alert_template.php,
godmode/reporting/reporting_builder.item_editor.php,
godmode/agentes/planned_downtime.editor.php,
include/ajax/module.php, include/constants.php, operation/tree.php,
operation/netflow/nf_live_view.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
operation/agentes/datos_agente.php: fixed the date and time format
and set a help tip to say the Pandora's format.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8287 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-06-11 15:14:48 +02:00
|
|
|
WHERE id_grupo = " . $downtime["id_grupo"]);
|
2012-08-23 16:24:43 +02:00
|
|
|
|
2013-06-11 Miguel de Dios <miguel.dedios@artica.es>
* extensions/insert_data.php,
godmode/alerts/configure_alert_template.php,
godmode/reporting/reporting_builder.item_editor.php,
godmode/agentes/planned_downtime.editor.php,
include/ajax/module.php, include/constants.php, operation/tree.php,
operation/netflow/nf_live_view.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
operation/agentes/datos_agente.php: fixed the date and time format
and set a help tip to say the Pandora's format.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8287 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-06-11 15:14:48 +02:00
|
|
|
$data[2] = ui_print_os_icon($downtime["id_os"], true, true);
|
2012-08-23 16:24:43 +02:00
|
|
|
|
|
|
|
$data[3] = $downtime["ultimo_contacto"];
|
|
|
|
|
2013-02-12 19:25:34 +01:00
|
|
|
if ($type_downtime == 'disable_agents_alerts') {
|
|
|
|
$data['count_modules'] = __("All alerts");
|
|
|
|
}
|
|
|
|
elseif ($type_downtime == 'disable_agents') {
|
|
|
|
$data['count_modules'] = __("Entire agent");
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
}
|
|
|
|
else {
|
2013-02-12 19:25:34 +01:00
|
|
|
if ($downtime["all_modules"]) {
|
|
|
|
$data['count_modules'] = __("All modules");
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$data['count_modules'] = __("Some modules");
|
|
|
|
}
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
}
|
2012-08-23 16:24:43 +02:00
|
|
|
|
2013-02-12 19:25:34 +01:00
|
|
|
$data[5] = '';
|
|
|
|
if (($type_downtime != 'disable_agents_alerts')
|
|
|
|
&& ($type_downtime != 'disable_agents')) {
|
|
|
|
|
|
|
|
$data[5] = '<a href="javascript:show_editor_module(' . $downtime["id_agente"] . ');">' .
|
|
|
|
html_print_image("images/config.png", true, array("border" => '0', "alt" => __('Delete'))) . "</a>";
|
|
|
|
|
|
|
|
}
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
$data[5] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/planned_downtime.editor'.
|
|
|
|
'&id_agent=' . $downtime["id_agente"] .
|
2013-02-12 19:25:34 +01:00
|
|
|
'&delete_downtime_agent=1' .
|
2013-06-11 Miguel de Dios <miguel.dedios@artica.es>
* extensions/insert_data.php,
godmode/alerts/configure_alert_template.php,
godmode/reporting/reporting_builder.item_editor.php,
godmode/agentes/planned_downtime.editor.php,
include/ajax/module.php, include/constants.php, operation/tree.php,
operation/netflow/nf_live_view.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
operation/agentes/datos_agente.php: fixed the date and time format
and set a help tip to say the Pandora's format.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8287 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-06-11 15:14:48 +02:00
|
|
|
'&id_downtime_agent=' . $downtime["id"] .
|
|
|
|
'&id_downtime=' . $id_downtime . '">' .
|
|
|
|
html_print_image("images/cross.png", true,
|
|
|
|
array("border" => '0', "alt" => __('Delete'))) . "</a>";
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
|
|
|
|
$table->data['agent_' . $downtime["id_agente"]] = $data;
|
2012-08-23 16:24:43 +02:00
|
|
|
}
|
|
|
|
html_print_table ($table);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
$table = null;
|
|
|
|
$table->id = 'loading';
|
|
|
|
$table->colspan['loading'][0] = '6';
|
|
|
|
$table->style[0] = 'text-align: center;';
|
|
|
|
$table->data = array();
|
|
|
|
$table->data['loading'] = array();
|
|
|
|
$table->data['loading'][0] = html_print_image("images/spinner.gif", true);
|
|
|
|
echo "<div style='display: none;'>";
|
|
|
|
html_print_table ($table);
|
|
|
|
echo "</div>";
|
|
|
|
|
|
|
|
$table = null;
|
|
|
|
$table->id = 'editor';
|
|
|
|
$table->colspan['module'][1] = '5';
|
|
|
|
$table->data = array();
|
|
|
|
$table->data['module'] = array();
|
|
|
|
$table->data['module'][0] = '';
|
|
|
|
$table->data['module'][1] = "<h4>" . __('Modules') . "</h4>";
|
|
|
|
|
|
|
|
//List of modules, empty, it is populated by javascript.
|
|
|
|
$table->data['module'][1] = "
|
|
|
|
<table cellspacing='4' cellpadding='4' border='0' width='98%'
|
|
|
|
id='modules_in_agent' class='databox_color'>
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th scope='col' class='header c0'>" . __('Module') . "</th>
|
|
|
|
<th scope='col' class='header c1'>" . __('Action') . "</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr class='datos' id='template' style='display: none;'>
|
|
|
|
<td class='name_module' style=''></td>
|
|
|
|
<td class='cell_delete_button' style='text-align: center; width:10%;' id=''>"
|
|
|
|
. '<a class="link_delete"
|
|
|
|
onclick="if(!confirm(\'' . __('Are you sure?') . '\')) return false;"
|
|
|
|
href="">'
|
|
|
|
. html_print_image("images/cross.png", true,
|
|
|
|
array("border" => '0', "alt" => __('Delete'))) . "</a>"
|
|
|
|
. "</td>
|
|
|
|
</tr>
|
|
|
|
<tr class='datos2' id='add_modules_row'>
|
|
|
|
<td class='datos2' style='' id=''>"
|
|
|
|
. __("Add Module:") . ' '
|
|
|
|
. html_print_select(array(),
|
|
|
|
'modules', '', '', '', 0, true)
|
|
|
|
. "</td>
|
|
|
|
<td class='datos2 button_cell' style='text-align: center; width:10%;' id=''>"
|
|
|
|
. '<div id="add_button_div">'
|
|
|
|
. '<a class="add_button" href="">'
|
|
|
|
. html_print_image("images/add.png", true,
|
2013-02-12 19:25:34 +01:00
|
|
|
array("border" => '0', "alt" => __('Add'))) . "</a>"
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
. '</div>'
|
|
|
|
. "<div id='spinner_add' style='display: none;'>"
|
|
|
|
. html_print_image("images/spinner.gif", true)
|
|
|
|
. "</div>"
|
|
|
|
. "</td>
|
|
|
|
</tr>
|
|
|
|
</tbody></table>";
|
|
|
|
|
|
|
|
echo "<div style='display: none;'>";
|
|
|
|
html_print_table ($table);
|
|
|
|
echo "</div>";
|
|
|
|
|
|
|
|
echo "<div style='display: none;'>";
|
|
|
|
echo "<div id='spinner_template'>";
|
|
|
|
html_print_image("images/spinner.gif");
|
|
|
|
echo "</div>";
|
|
|
|
echo "</div>";
|
|
|
|
|
|
|
|
echo "<div id='some_modules_text' style='display: none;'>";
|
|
|
|
echo __('Some modules');
|
|
|
|
echo "</div>";
|
|
|
|
|
|
|
|
echo "<div id='some_modules_text' style='display: none;'>";
|
|
|
|
echo __('Some modules');
|
|
|
|
echo "</div>";
|
|
|
|
|
|
|
|
echo "<div id='all_modules_text' style='display: none;'>";
|
|
|
|
echo __("All modules");
|
|
|
|
echo "</div>";
|
|
|
|
|
2014-06-02 Miguel de Dios <miguel.dedios@artica.es>
* godmode/alerts/configure_alert_template.php,
godmode/reporting/reporting_builder.item_editor.php,
godmode/agentes/planned_downtime.editor.php, godmode/setup/news.php,
include/ajax/module.php, include/functions.php,
include/functions_ui.php, extensions/insert_data.php,
operation/netflow/nf_live_view.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php, operation/tree.php,
operation/agentes/datos_agente.php,
operation/agentes/estado_monitores.php: fixed the i18n of the
timepicker.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10076 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2014-06-02 17:57:36 +02:00
|
|
|
ui_include_time_picker();
|
2013-06-10 Miguel de Dios <miguel.dedios@artica.es>
* include/javascript/jquery.ui-timepicker-addon.js: updated the
datepicker for to avoid some found bugs.
* include/javascript/i18n: added translations for the datepicker.
* godmode/alerts/configure_alert_template.php,
godmode/reporting/reporting_builder.item_editor.php,
godmode/agentes/planned_downtime.editor.php,
include/ajax/module.php, include/functions_ui.php,
operation/tree.php, operation/agentes/status_monitor.php,
operation/agentes/datos_agente.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php, extensions/insert_data.php:
changed the code for to use the user/system language in the
datepicker.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-06-10 18:19:48 +02:00
|
|
|
ui_require_jquery_file("ui.datepicker-" . get_user_language(), "include/javascript/i18n/");
|
2012-08-23 16:24:43 +02:00
|
|
|
|
|
|
|
?>
|
|
|
|
<script language="javascript" type="text/javascript">
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
var id_downtime = <?php echo $id_downtime?>;
|
|
|
|
var action_in_progress = false;
|
|
|
|
|
2013-02-12 19:25:34 +01:00
|
|
|
function change_type_downtime() {
|
|
|
|
switch ($("#type_downtime").val()) {
|
|
|
|
case 'disable_agents_alerts':
|
|
|
|
case 'disable_agents':
|
|
|
|
$("#available_modules").hide();
|
|
|
|
break;
|
|
|
|
case 'quiet':
|
|
|
|
$("#available_modules").show();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
function change_type_execution() {
|
|
|
|
switch ($("#type_execution").val()) {
|
|
|
|
case 'once':
|
|
|
|
$("#periodically_time").hide();
|
|
|
|
$("#once_time").show();
|
|
|
|
break;
|
|
|
|
case 'periodically':
|
|
|
|
$("#once_time").hide();
|
|
|
|
$("#periodically_time").show();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function change_type_periodicity() {
|
|
|
|
switch ($("#type_periodicity").val()) {
|
|
|
|
case 'weekly':
|
|
|
|
$("#monthly_item").hide();
|
|
|
|
$("#weekly_item").show();
|
|
|
|
break;
|
|
|
|
case 'monthly':
|
|
|
|
$("#weekly_item").hide();
|
|
|
|
$("#monthly_item").show();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function show_editor_module(id_agent) {
|
|
|
|
//Avoid freak states.
|
|
|
|
if (action_in_progress)
|
|
|
|
return;
|
|
|
|
|
|
|
|
//Check if the row editor module exists
|
|
|
|
if ($('#loading_' + id_agent).length > 0) {
|
|
|
|
//The row exists
|
|
|
|
$('#loading_' + id_agent).remove();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if ($('#module_editor_' + id_agent).length == 0) {
|
|
|
|
$("#list-agent_" + id_agent).after(
|
|
|
|
$("#loading-loading").clone().attr('id', 'loading_' + id_agent));
|
|
|
|
|
|
|
|
jQuery.post ('ajax.php',
|
|
|
|
{"page": "include/ajax/planned_downtime.ajax",
|
|
|
|
"get_modules_downtime": 1,
|
|
|
|
"id_agent": id_agent,
|
|
|
|
"id_downtime": id_downtime
|
|
|
|
},
|
|
|
|
function (data) {
|
|
|
|
if (data['correct']) {
|
|
|
|
//Check if the row editor module exists
|
|
|
|
if ($('#loading_' + id_agent).length > 0) {
|
|
|
|
//The row exists
|
|
|
|
$('#loading_' + id_agent).remove();
|
|
|
|
|
|
|
|
$("#list-agent_" + id_agent).after(
|
|
|
|
$("#editor-module").clone()
|
|
|
|
.attr('id', 'module_editor_' + id_agent)
|
|
|
|
.hide());
|
|
|
|
|
|
|
|
fill_row_editor(id_agent, data);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"json"
|
|
|
|
);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if ($('#module_editor_' + id_agent).is(':visible')) {
|
|
|
|
$('#module_editor_' + id_agent).hide();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$('#module_editor_' + id_agent).css('display', '');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function fill_row_editor(id_agent, data) {
|
|
|
|
//$("#modules", $('#module_editor_' + id_agent)).empty();
|
|
|
|
|
|
|
|
//Fill the select for to add modules
|
|
|
|
$.each(data['in_agent'], function(id_module, name) {
|
|
|
|
$("#modules", $('#module_editor_' + id_agent))
|
|
|
|
.append($("<option value='" + id_module + "'>" + name + "</option>"));
|
|
|
|
});
|
|
|
|
$(".add_button", $('#module_editor_' + id_agent)).
|
|
|
|
attr('href', 'javascript:' +
|
|
|
|
'add_module_in_downtime(' + id_agent + ')');
|
|
|
|
|
|
|
|
|
|
|
|
//Fill the list of modules
|
|
|
|
$.each(data['in_downtime'], function(id_module, name) {
|
|
|
|
var template_row = $("#template").clone();
|
|
|
|
|
|
|
|
$(template_row).css('display', '');
|
|
|
|
$(template_row).attr('id', 'row_module_in_downtime_' + id_module);
|
|
|
|
$(".name_module", template_row).html(name);
|
|
|
|
$(".link_delete", template_row).attr('href',
|
|
|
|
'javascript:' +
|
|
|
|
'delete_module_from_downtime(' + id_downtime + ',' + id_module + ');');
|
|
|
|
|
|
|
|
$("#add_modules_row", $('#module_editor_' + id_agent))
|
|
|
|
.before(template_row);
|
2012-08-23 16:24:43 +02:00
|
|
|
});
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
|
|
|
|
//.show() is crap, because put a 'display: block;'.
|
|
|
|
$('#module_editor_' + id_agent).css('display', '');
|
|
|
|
}
|
2012-08-23 16:24:43 +02:00
|
|
|
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
function add_row_module(id_downtime, id_agent, id_module, name) {
|
|
|
|
var template_row = $("#template").clone();
|
|
|
|
|
|
|
|
$(template_row).css('display', '');
|
|
|
|
$(template_row).attr('id', 'row_module_in_downtime_' + id_module);
|
|
|
|
$(".name_module", template_row).html(name);
|
|
|
|
$(".link_delete", template_row).attr('href',
|
|
|
|
'javascript:' +
|
|
|
|
'delete_module_from_downtime(' + id_downtime + ',' + id_module + ');');
|
|
|
|
|
|
|
|
$("#add_modules_row", $('#module_editor_' + id_agent))
|
|
|
|
.before(template_row);
|
|
|
|
|
|
|
|
}
|
2012-08-23 16:24:43 +02:00
|
|
|
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
function fill_selectbox_modules(id_downtime, id_agent) {
|
|
|
|
jQuery.post ('ajax.php',
|
|
|
|
{"page": "include/ajax/planned_downtime.ajax",
|
|
|
|
"get_modules_downtime": 1,
|
|
|
|
"id_agent": id_agent,
|
|
|
|
"id_downtime": id_downtime,
|
|
|
|
"none_value": 1
|
|
|
|
},
|
|
|
|
function (data) {
|
|
|
|
if (data['correct']) {
|
|
|
|
$("#modules", $('#module_editor_' + id_agent)).empty();
|
|
|
|
|
|
|
|
//Fill the select for to add modules
|
|
|
|
$.each(data['in_agent'], function(id_module, name) {
|
|
|
|
$("#modules", $('#module_editor_' + id_agent))
|
|
|
|
.append($("<option value='" + id_module + "'>" + name + "</option>"));
|
|
|
|
});
|
|
|
|
|
|
|
|
$("#modules", $('#module_editor_' + id_agent)).val(0);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"json"
|
|
|
|
);
|
|
|
|
}
|
2012-08-23 16:24:43 +02:00
|
|
|
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
function add_module_in_downtime(id_agent) {
|
|
|
|
var module_sel = $("#modules", $('#module_editor_' + id_agent)).val();
|
|
|
|
|
|
|
|
if (module_sel == 0) {
|
|
|
|
alert('<?php echo __("Please select a module."); ?>');
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
action_in_progress = true;
|
|
|
|
|
|
|
|
$("#add_button_div", $('#module_editor_' + id_agent)).toggle();
|
|
|
|
$("#spinner_add", $('#module_editor_' + id_agent)).toggle();
|
|
|
|
|
|
|
|
jQuery.post ('ajax.php',
|
|
|
|
{"page": "include/ajax/planned_downtime.ajax",
|
|
|
|
"add_module_into_downtime": 1,
|
|
|
|
"id_agent": id_agent,
|
|
|
|
"id_module": module_sel,
|
|
|
|
"id_downtime": id_downtime
|
|
|
|
},
|
|
|
|
function (data) {
|
|
|
|
if (data['correct']) {
|
|
|
|
$("#list-agent_"
|
|
|
|
+ id_agent
|
|
|
|
+ '-count_modules').html(
|
|
|
|
$("#some_modules_text").html());
|
|
|
|
|
|
|
|
add_row_module(id_downtime, id_agent,
|
|
|
|
module_sel, data['name']);
|
|
|
|
fill_selectbox_modules(id_downtime, id_agent);
|
|
|
|
|
|
|
|
|
|
|
|
$("#add_button_div", $('#module_editor_' + id_agent))
|
|
|
|
.toggle();
|
|
|
|
$("#spinner_add", $('#module_editor_' + id_agent))
|
|
|
|
.toggle();
|
|
|
|
}
|
|
|
|
|
|
|
|
action_in_progress = false;
|
|
|
|
},
|
|
|
|
"json"
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2012-08-23 16:24:43 +02:00
|
|
|
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
function delete_module_from_downtime(id_downtime, id_module) {
|
|
|
|
var spinner = $("#spinner_template").clone();
|
|
|
|
var old_cell_content =
|
|
|
|
$(".cell_delete_button", "#row_module_in_downtime_" + id_module)
|
|
|
|
.clone(true);
|
|
|
|
|
|
|
|
$(".cell_delete_button", "#row_module_in_downtime_" + id_module)
|
|
|
|
.html(spinner);
|
|
|
|
|
|
|
|
action_in_progress = true;
|
|
|
|
|
|
|
|
jQuery.post ('ajax.php',
|
|
|
|
{"page": "include/ajax/planned_downtime.ajax",
|
|
|
|
"delete_module_from_downtime": 1,
|
|
|
|
"id_downtime": id_downtime,
|
|
|
|
"id_module": id_module
|
|
|
|
},
|
|
|
|
function (data) {
|
|
|
|
if (data['correct']) {
|
|
|
|
fill_selectbox_modules(id_downtime, data['id_agent']);
|
|
|
|
|
|
|
|
$("#row_module_in_downtime_" + id_module).remove();
|
|
|
|
|
|
|
|
if (data['all_modules']) {
|
|
|
|
$("#list-agent_"
|
|
|
|
+ data['id_agent']
|
|
|
|
+ '-count_modules').html(
|
|
|
|
$("#all_modules_text").html());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$(".cell_delete_button", "#row_module_in_downtime_" + id_module)
|
|
|
|
.html($(old_cell_content));
|
|
|
|
}
|
|
|
|
|
|
|
|
action_in_progress = false;
|
|
|
|
},
|
|
|
|
"json"
|
|
|
|
);
|
|
|
|
}
|
2012-08-23 16:24:43 +02:00
|
|
|
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
$(document).ready (function () {
|
|
|
|
$("#id_agents").change(agent_changed_by_multiple_agents);
|
|
|
|
|
2013-02-12 19:25:34 +01:00
|
|
|
change_type_downtime();
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
change_type_execution();
|
|
|
|
change_type_periodicity();
|
|
|
|
|
2012-09-25 Miguel de Dios <miguel.dedios@artica.es>
* general/login_page.php, general/logoff.php, general/header.php,
general/login_help_dialog.php,
godmode/reporting/reporting_builder.item_editor.php,
godmode/reporting/visual_console_builder.elements.php,
godmode/agentes/planned_downtime.editor.php,
godmode/alerts/alert_list.list.php,
godmode/alerts/configure_alert_compound.php,
godmode/alerts/alert_list.php,
godmode/alerts/configure_alert_template.php,
include/styles/jquery-ui-1.8.23.custom.css,
include/javascript/jquery.jquery-ui-1.8.17.custom.min.js,
include/javascript/jquery.timeentry.js,
include/javascript/jquery.ui.droppable.js,
include/javascript/jquery.ui.draggable.js,
include/javascript/jquery.ui-timepicker-addon.js,
include/javascript/jquery.ui.resizable.js,
include/javascript/jquery.autocomplete.js,
include/javascript/jquery.ui.core.js,
include/javascript/jquery-1.8.2.js,
include/javascript/jquery.ui.dialog.js,
include/javascript/jquery.jquery-ui-1.8.23.custom.min.js,
include/functions_ui.php, index.php,
extensions/update_manager/update_pandora.php,
extensions/insert_data.php, operation/agentes/datos_agente.php,
operation/reporting/graph_viewer.php,
operation/reporting/reporting_viewer.php: updated the jquery and
jquery.ui, and removed old useless files. And added the jquery
library to timepicker and implemented the calls into the code.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6999 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-09-25 17:34:36 +02:00
|
|
|
$("#text-periodically_time_from, #text-periodically_time_to, #text-once_time_from, #text-once_time_to").timepicker({
|
|
|
|
showSecond: true,
|
2013-06-11 Miguel de Dios <miguel.dedios@artica.es>
* extensions/insert_data.php,
godmode/alerts/configure_alert_template.php,
godmode/reporting/reporting_builder.item_editor.php,
godmode/agentes/planned_downtime.editor.php,
include/ajax/module.php, include/constants.php, operation/tree.php,
operation/netflow/nf_live_view.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
operation/agentes/datos_agente.php: fixed the date and time format
and set a help tip to say the Pandora's format.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8287 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-06-11 15:14:48 +02:00
|
|
|
timeFormat: '<?php echo TIME_FORMAT_JS; ?>',
|
2012-09-25 Miguel de Dios <miguel.dedios@artica.es>
* general/login_page.php, general/logoff.php, general/header.php,
general/login_help_dialog.php,
godmode/reporting/reporting_builder.item_editor.php,
godmode/reporting/visual_console_builder.elements.php,
godmode/agentes/planned_downtime.editor.php,
godmode/alerts/alert_list.list.php,
godmode/alerts/configure_alert_compound.php,
godmode/alerts/alert_list.php,
godmode/alerts/configure_alert_template.php,
include/styles/jquery-ui-1.8.23.custom.css,
include/javascript/jquery.jquery-ui-1.8.17.custom.min.js,
include/javascript/jquery.timeentry.js,
include/javascript/jquery.ui.droppable.js,
include/javascript/jquery.ui.draggable.js,
include/javascript/jquery.ui-timepicker-addon.js,
include/javascript/jquery.ui.resizable.js,
include/javascript/jquery.autocomplete.js,
include/javascript/jquery.ui.core.js,
include/javascript/jquery-1.8.2.js,
include/javascript/jquery.ui.dialog.js,
include/javascript/jquery.jquery-ui-1.8.23.custom.min.js,
include/functions_ui.php, index.php,
extensions/update_manager/update_pandora.php,
extensions/insert_data.php, operation/agentes/datos_agente.php,
operation/reporting/graph_viewer.php,
operation/reporting/reporting_viewer.php: updated the jquery and
jquery.ui, and removed old useless files. And added the jquery
library to timepicker and implemented the calls into the code.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6999 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-09-25 17:34:36 +02:00
|
|
|
timeOnlyTitle: '<?php echo __('Choose time');?>',
|
|
|
|
timeText: '<?php echo __('Time');?>',
|
|
|
|
hourText: '<?php echo __('Hour');?>',
|
|
|
|
minuteText: '<?php echo __('Minute');?>',
|
|
|
|
secondText: '<?php echo __('Second');?>',
|
|
|
|
currentText: '<?php echo __('Now');?>',
|
|
|
|
closeText: '<?php echo __('Close');?>'});
|
2013-06-11 Miguel de Dios <miguel.dedios@artica.es>
* extensions/insert_data.php,
godmode/alerts/configure_alert_template.php,
godmode/reporting/reporting_builder.item_editor.php,
godmode/agentes/planned_downtime.editor.php,
include/ajax/module.php, include/constants.php, operation/tree.php,
operation/netflow/nf_live_view.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
operation/agentes/datos_agente.php: fixed the date and time format
and set a help tip to say the Pandora's format.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8287 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-06-11 15:14:48 +02:00
|
|
|
$("#text-once_date_from, #text-once_date_to").datepicker({dateFormat: "<?php echo DATE_FORMAT_JS; ?>"});
|
2013-06-10 Miguel de Dios <miguel.dedios@artica.es>
* include/javascript/jquery.ui-timepicker-addon.js: updated the
datepicker for to avoid some found bugs.
* include/javascript/i18n: added translations for the datepicker.
* godmode/alerts/configure_alert_template.php,
godmode/reporting/reporting_builder.item_editor.php,
godmode/agentes/planned_downtime.editor.php,
include/ajax/module.php, include/functions_ui.php,
operation/tree.php, operation/agentes/status_monitor.php,
operation/agentes/datos_agente.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php, extensions/insert_data.php:
changed the code for to use the user/system language in the
datepicker.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-06-10 18:19:48 +02:00
|
|
|
|
|
|
|
$.datepicker.setDefaults($.datepicker.regional[ "<?php echo get_user_language(); ?>"]);
|
2012-08-29 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
include/db/mysql.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/planned_downtime.list.php,
godmode/agentes/planned_downtime.editor.php, godmode/menu.php,
include/ajax/planned_downtime.ajax.php: refactoriced the code for
planned downtime, now this have new feature such as set a downtime
with a periodicity each week, each month and set the agents and
the modules with Quiet state instead the old form (but the old still
is). And the page is more easy and quickly to set or config a
planned downtime.
* godmode/alerts/configure_alert_template.php,
include/javascript/pandora.js: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6919 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-08-29 11:46:05 +02:00
|
|
|
|
|
|
|
|
|
|
|
$("#filter_group").click (
|
|
|
|
function () {
|
|
|
|
$(this).css ("width", "auto");
|
|
|
|
});
|
|
|
|
|
|
|
|
$("#filter_group").blur (function () {
|
|
|
|
$(this).css ("width", "180px");
|
|
|
|
});
|
|
|
|
|
|
|
|
$("#id_agent").click (
|
|
|
|
function () {
|
|
|
|
$(this).css ("width", "auto");
|
|
|
|
});
|
|
|
|
|
|
|
|
$("#id_agent").blur (function () {
|
|
|
|
$(this).css ("width", "180px");
|
|
|
|
});
|
2012-08-23 16:24:43 +02:00
|
|
|
});
|
2012-11-04 15:41:14 +01:00
|
|
|
</script>
|