2019-01-30 16:18:44 +01:00
< ? php
2022-02-01 11:29:25 +01:00
/**
* Alerts templates .
*
* @ category Alerts
* @ package Pandora FMS
* @ subpackage Community
* @ version 1.0 . 0
* @ license See below
*
* ______ ___ _______ _______ ________
* | __ \ .-----.--.--.--| |.-----.----.-----. | ___ | | | __ |
* | __ /| _ | | _ || _ | _ | _ | | ___ | | __ |
* | ___ | | ___ . _ | __ | __ | _____ || _____ | __ | | ___ . _ | | ___ | | __ | _ | __ | _______ |
*
* ============================================================================
* Copyright ( c ) 2005 - 2022 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 .
* ============================================================================
*/
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
2021-11-04 09:55:37 +01:00
// Load global vars.
2010-03-02 Sancho Lerena <slerena@artica.es>
* include/functions_reporting.php: Solved issue with several undefined
vars.
* include/functions_servers.php: Solved issue with several undefined
vars.
* include/functions_config.php: Added metaconsola witch to readconfig.
* include/config_process.php: Update build.. is YYMMDD !
* include/functions_ui.php: Removed deprecated call to split and replaced
by preg_split.
* index.php: Activated developer mode.
* operation/agentes/estado_monitores.php: Solved small problem with modules
without history, filling missing column in table. Added headers
* godmode/alerts/configure_alert_compound.php,
operation/agentes/status_monitor.php
godmode/alerts/configure_alert_template.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php,
godmode/alerts/alert_commands.php,
godmode/modules/manage_network_templates.php,
godmode/modules/module_list.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_nc_groups.php: Removed deprecated call to include
config.php and in some cases, added new header style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2444 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-03-02 15:13:00 +01:00
global $config ;
2021-11-04 09:55:37 +01:00
use PandoraFMS\Calendar ;
2019-01-30 16:18:44 +01:00
require_once $config [ 'homedir' ] . '/include/functions_alerts.php' ;
require_once $config [ 'homedir' ] . '/include/functions_users.php' ;
enterprise_include_once ( 'meta/include/functions_alerts_meta.php' );
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
2019-01-30 16:18:44 +01:00
check_login ();
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
2022-02-02 10:09:31 +01:00
if ( is_metaconsole () === true ) {
enterprise_hook ( 'open_meta_frame' );
}
2015-03-06 12:28:05 +01:00
2019-01-30 16:18:44 +01:00
if ( ! check_acl ( $config [ 'id_user' ], 0 , 'LM' )) {
db_pandora_audit (
2022-01-20 10:55:23 +01:00
AUDIT_LOG_ACL_VIOLATION ,
2019-01-30 16:18:44 +01:00
'Trying to access Alert Management'
);
include 'general/noaccess.php' ;
exit ;
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
}
2019-01-30 16:18:44 +01:00
$duplicate_template = ( bool ) get_parameter ( 'duplicate_template' );
$id = ( int ) get_parameter ( 'id' );
2012-12-12 20:37:35 +01:00
$pure = get_parameter ( 'pure' , 0 );
2020-07-07 11:05:19 +02:00
$step = ( int ) get_parameter ( 'step' , 1 );
2022-02-02 10:09:31 +01:00
2020-07-07 11:05:19 +02:00
// We set here the number of steps.
2021-06-24 19:48:07 +02:00
if ( defined ( 'LAST_STEP' ) === false ) {
define ( 'LAST_STEP' , 3 );
}
2009-03-23 16:22:19 +01:00
2022-02-01 16:50:53 +01:00
// Default events calendar.
2022-02-22 13:20:53 +01:00
$default_events_calendar = default_events_calendar ( $id , 'talert_templates' );
2022-02-01 16:50:53 +01:00
2022-02-01 11:29:25 +01:00
if ( $duplicate_template === true ) {
2019-01-30 16:18:44 +01:00
$source_id = ( int ) get_parameter ( 'source_id' );
$a_template = alerts_get_alert_template ( $source_id );
} else {
$a_template = alerts_get_alert_template ( $id );
2011-02-15 14:17:26 +01:00
}
2022-02-01 11:29:25 +01:00
if ( is_metaconsole () === true ) {
2019-01-30 16:18:44 +01:00
$sec = 'advanced' ;
} else {
$sec = 'galertas' ;
2012-12-12 20:37:35 +01:00
}
2021-03-26 09:11:10 +01:00
$can_edit_all = false ;
if ( check_acl_restricted_all ( $config [ 'id_user' ], 0 , 'LM' )) {
$can_edit_all = true ;
}
2012-02-28 13:05:41 +01:00
if ( $a_template !== false ) {
2022-01-31 13:45:44 +01:00
// If user tries to duplicate/edit a template with group=ALL.
2019-01-30 16:18:44 +01:00
if ( $a_template [ 'id_group' ] == 0 ) {
2022-02-01 11:29:25 +01:00
if ( is_metaconsole () === true ) {
2019-01-30 16:18:44 +01:00
alerts_meta_print_header ();
} else {
2019-04-29 14:36:02 +02:00
if ( $step == 1 ) {
2020-05-29 11:37:06 +02:00
$help_header = '' ;
2019-04-29 14:36:02 +02:00
} else if ( $step == 2 ) {
$help_header = 'configure_alert_template_step_2' ;
} else if ( $step == 3 ) {
2020-05-29 11:37:06 +02:00
$help_header = '' ;
2019-04-29 14:36:02 +02:00
}
2019-01-30 16:18:44 +01:00
ui_print_page_header (
__ ( 'Alerts' ) . ' » ' . __ ( 'Configure alert template' ),
'' ,
false ,
2019-04-29 14:36:02 +02:00
$help_header ,
2019-01-30 16:18:44 +01:00
true
);
}
} else {
2022-01-31 13:45:44 +01:00
// If user tries to duplicate/edit a template of others groups.
2019-01-30 16:18:44 +01:00
$own_info = get_user_info ( $config [ 'id_user' ]);
if ( $own_info [ 'is_admin' ] || check_acl ( $config [ 'id_user' ], 0 , 'PM' )) {
$own_groups = array_keys ( users_get_groups ( $config [ 'id_user' ], 'LM' ));
} else {
$own_groups = array_keys ( users_get_groups ( $config [ 'id_user' ], 'LM' , false ));
}
$is_in_group = in_array ( $a_template [ 'id_group' ], $own_groups );
2022-01-31 13:45:44 +01:00
// Then template group have to be in his own groups.
2019-01-30 16:18:44 +01:00
if ( $is_in_group ) {
2022-01-31 13:45:44 +01:00
// Header.
2022-02-01 11:29:25 +01:00
if ( is_metaconsole () === true ) {
2019-01-30 16:18:44 +01:00
alerts_meta_print_header ();
} else {
2019-04-29 14:36:02 +02:00
ui_print_page_header (
__ ( 'Alerts' ) . ' » ' . __ ( 'Configure alert template' ),
'images/gm_alerts.png' ,
false ,
'conf_alert_template' ,
true
);
2019-01-30 16:18:44 +01:00
}
} else {
db_pandora_audit (
2022-01-20 10:55:23 +01:00
AUDIT_LOG_ACL_VIOLATION ,
2019-01-30 16:18:44 +01:00
'Trying to access Alert Management'
);
include 'general/noaccess.php' ;
exit ;
}
}
2022-01-31 13:45:44 +01:00
// This prevents to duplicate the header in case duplicate/edit_template action is performed.
2019-01-30 16:18:44 +01:00
} else {
2022-01-31 13:45:44 +01:00
// Header.
2022-02-01 11:29:25 +01:00
if ( is_metaconsole () === true ) {
2019-01-30 16:18:44 +01:00
alerts_meta_print_header ();
} else {
2019-04-29 14:36:02 +02:00
if ( $step == 1 ) {
2020-05-29 11:37:06 +02:00
$help_header = '' ;
2019-04-29 14:36:02 +02:00
} else if ( $step == 2 ) {
$help_header = 'configure_alert_template_step_2' ;
} else if ( $step == 3 ) {
2020-05-29 11:37:06 +02:00
$help_header = '' ;
2019-04-29 14:36:02 +02:00
}
ui_print_page_header (
__ ( 'Alerts' ) . ' » ' . __ ( 'Configure alert template' ),
'images/gm_alerts.png' ,
false ,
$help_header ,
true
);
2019-01-30 16:18:44 +01:00
}
2012-12-12 20:37:35 +01:00
}
2011-02-15 14:17:26 +01:00
2009-03-23 16:22:19 +01:00
if ( $duplicate_template ) {
2019-01-30 16:18:44 +01:00
$source_id = ( int ) get_parameter ( 'source_id' );
2022-01-31 13:45:44 +01:00
// If user doesn't have the permission to access
// All group and source template is All group,
// then group is changed to the first group of user.
if ( $can_edit_all == false && $a_template [ 'id_group' ] == 0 ) {
2021-03-26 09:11:10 +01:00
$a_template [ 'id_group' ] = users_get_first_group ( false , 'LM' , false );
2021-05-06 14:22:47 +02:00
}
2021-03-26 09:11:10 +01:00
$id = alerts_duplicate_alert_template ( $source_id , $a_template [ 'id_group' ]);
2019-01-30 16:18:44 +01:00
if ( $id ) {
2022-02-01 13:39:18 +01:00
db_pandora_audit (
AUDIT_LOG_ALERT_MANAGEMENT ,
'Duplicate alert template ' . $source_id . ' clone to ' . $id
);
2019-01-30 16:18:44 +01:00
} else {
2022-02-01 13:39:18 +01:00
db_pandora_audit (
AUDIT_LOG_ALERT_MANAGEMENT ,
'Fail try to duplicate alert template ' . $source_id
);
2019-01-30 16:18:44 +01:00
}
ui_print_result_message (
$id ,
__ ( 'Successfully created from %s' , alerts_get_alert_template_name ( $source_id )),
__ ( 'Could not be created' )
);
2009-03-23 16:22:19 +01:00
}
2022-02-02 10:09:31 +01:00
/**
* Build navbar steps .
*
* @ param integer $step Step .
* @ param integer $id Id template .
*
* @ return void Html output .
*/
2019-01-30 16:18:44 +01:00
function print_alert_template_steps ( $step , $id )
{
echo '<ol class="steps">' ;
2022-02-01 11:29:25 +01:00
if ( is_metaconsole () === true ) {
2019-01-30 16:18:44 +01:00
$sec = 'advanced' ;
} else {
$sec = 'galertas' ;
}
$pure = get_parameter ( 'pure' , 0 );
2022-01-31 13:45:44 +01:00
// Step 1.
2019-01-30 16:18:44 +01:00
if ( $step == 1 ) {
echo '<li class="first current">' ;
} else if ( $step > 1 ) {
echo '<li class="visited">' ;
} else {
echo '<li class="first">' ;
}
if ( $id ) {
echo '<a href="index.php?sec=' . $sec . '&sec2=godmode/alerts/configure_alert_template&id=' . $id . '&pure=' . $pure . '">' ;
echo __ ( 'Step' ) . ' 1 » ' ;
echo '<span>' . __ ( 'General' ) . '</span>' ;
echo '</a>' ;
} else {
echo __ ( 'Step' ) . ' 1 » ' ;
echo '<span>' . __ ( 'General' ) . '</span>' ;
}
echo '</li>' ;
2022-01-31 13:45:44 +01:00
// Step 2.
2019-01-30 16:18:44 +01:00
if ( $step == 2 ) {
echo '<li class="current">' ;
} else if ( $step > 2 ) {
echo '<li class="visited">' ;
} else {
echo '<li>' ;
}
if ( $id ) {
echo '<a href="index.php?sec=' . $sec . '&sec2=godmode/alerts/configure_alert_template&id=' . $id . '&step=2&pure=' . $pure . '">' ;
echo __ ( 'Step' ) . ' 2 » ' ;
echo '<span>' . __ ( 'Conditions' ) . '</span>' ;
echo '</a>' ;
} else {
echo __ ( 'Step' ) . ' 2 » ' ;
echo '<span>' . __ ( 'Conditions' ) . '</span>' ;
}
echo '</li>' ;
2022-01-31 13:45:44 +01:00
// Step 3.
2019-01-30 16:18:44 +01:00
if ( $step == 3 ) {
echo '<li class="last current">' ;
} else if ( $step > 3 ) {
echo '<li class="last visited">' ;
} else {
echo '<li class="last">' ;
}
if ( $id ) {
echo '<a href="index.php?sec=' . $sec . '&sec2=godmode/alerts/configure_alert_template&id=' . $id . '&step=3&pure=' . $pure . '">' ;
echo __ ( 'Step' ) . ' 3 » ' ;
echo '<span>' . __ ( 'Advanced fields' ) . '</span>' ;
echo '</a>' ;
} else {
echo __ ( 'Step' ) . ' 3 » ' ;
echo '<span>' . __ ( 'Advanced fields' ) . '</span>' ;
}
echo '</ol>' ;
echo '<div id="steps_clean"> </div>' ;
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
}
2019-01-30 16:18:44 +01:00
2022-02-02 10:09:31 +01:00
/**
* Update template
*
* @ param integer $step Step .
*
* @ return boolean result to update .
*/
2019-01-30 16:18:44 +01:00
function update_template ( $step )
{
global $config ;
$id = ( int ) get_parameter ( 'id' );
2022-02-02 10:09:31 +01:00
if ( empty ( $id ) === true ) {
2019-01-30 16:18:44 +01:00
return false ;
}
2022-02-01 11:29:25 +01:00
if ( is_metaconsole () === true ) {
2019-01-30 16:18:44 +01:00
$sec = 'advanced' ;
} else {
$sec = 'galertas' ;
}
if ( $step == 1 ) {
$name = ( string ) get_parameter ( 'name' );
$description = ( string ) get_parameter ( 'description' );
$wizard_level = ( string ) get_parameter ( 'wizard_level' );
$priority = ( int ) get_parameter ( 'priority' );
$id_group = get_parameter ( 'id_group' );
2020-07-07 11:05:19 +02:00
// Only for Metaconsole. Save the previous name for synchronizing.
2022-02-02 10:09:31 +01:00
if ( is_metaconsole () === true ) {
2020-07-07 11:05:19 +02:00
$previous_name = db_get_value ( 'name' , 'talert_templates' , 'id' , $id );
} else {
$previous_name = '' ;
2019-01-30 16:18:44 +01:00
}
$values = [
2020-07-07 11:05:19 +02:00
'name' => $name ,
'description' => $description ,
'id_group' => $id_group ,
'priority' => $priority ,
'wizard_level' => $wizard_level ,
'previous_name' => $previous_name ,
2019-01-30 16:18:44 +01:00
];
$result = alerts_update_alert_template ( $id , $values );
} else if ( $step == 2 ) {
2022-02-22 12:03:22 +01:00
$schedule = io_safe_output ( get_parameter ( 'schedule' , []));
json_decode ( $schedule , true );
if ( json_last_error () !== JSON_ERROR_NONE ) {
return false ;
}
2021-11-04 09:55:37 +01:00
$special_day = ( int ) get_parameter ( 'special_day' );
2019-01-30 16:18:44 +01:00
$threshold = ( int ) get_parameter ( 'threshold' );
$max_alerts = ( int ) get_parameter ( 'max_alerts' );
$min_alerts = ( int ) get_parameter ( 'min_alerts' );
$min_alerts_reset_counter = ( int ) get_parameter ( 'min_alerts_reset_counter' );
2020-03-23 11:34:37 +01:00
$disable_event = ( int ) get_parameter ( 'disable_event' );
2019-01-30 16:18:44 +01:00
$type = ( string ) get_parameter ( 'type' );
$value = ( string ) html_entity_decode ( get_parameter ( 'value' ));
$max = ( float ) get_parameter ( 'max' );
$min = ( float ) get_parameter ( 'min' );
$matches = ( bool ) get_parameter ( 'matches_value' );
$default_action = ( int ) get_parameter ( 'default_action' );
2022-01-31 13:45:44 +01:00
if ( empty ( $default_action ) === true ) {
2019-01-30 16:18:44 +01:00
$default_action = null ;
}
$values = [
2022-02-22 12:03:22 +01:00
'schedule' => $schedule ,
2019-01-30 16:18:44 +01:00
'special_day' => $special_day ,
'time_threshold' => $threshold ,
'id_alert_action' => $default_action ,
'max_alerts' => $max_alerts ,
'min_alerts' => $min_alerts ,
'min_alerts_reset_counter' => $min_alerts_reset_counter ,
'type' => $type ,
'value' => $value ,
'max_value' => $max ,
'min_value' => $min ,
'matches_value' => $matches ,
2020-03-23 11:34:37 +01:00
'disable_event' => $disable_event ,
2019-01-30 16:18:44 +01:00
];
$result = alerts_update_alert_template ( $id , $values );
} else if ( $step == 3 ) {
$recovery_notify = ( bool ) get_parameter ( 'recovery_notify' );
for ( $i = 1 ; $i <= $config [ 'max_macro_fields' ]; $i ++ ) {
$values [ 'field' . $i ] = ( string ) get_parameter ( 'field' . $i );
2022-02-02 10:09:31 +01:00
$values [ 'field' . $i . '_recovery' ] = ( $recovery_notify ) ? ( string ) get_parameter ( 'field' . $i . '_recovery' ) : '' ;
2019-01-30 16:18:44 +01:00
}
$values [ 'recovery_notify' ] = $recovery_notify ;
$result = alerts_update_alert_template ( $id , $values );
} else {
return false ;
}
if ( $result ) {
2022-02-01 13:39:18 +01:00
db_pandora_audit (
AUDIT_LOG_ALERT_MANAGEMENT ,
'Update alert template #' . $id ,
false ,
false ,
json_encode ( $values )
);
2019-01-30 16:18:44 +01:00
} else {
2022-02-01 13:39:18 +01:00
db_pandora_audit (
AUDIT_LOG_ALERT_MANAGEMENT ,
'Fail try to update alert template #' . $id ,
false ,
false ,
json_encode ( $values )
);
2019-01-30 16:18:44 +01:00
}
return $result ;
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
}
2021-06-03 10:16:29 +02:00
$is_management_allowed = is_management_allowed ();
2020-07-13 12:23:46 +02:00
2021-06-03 10:16:29 +02:00
if ( $is_management_allowed === false ) {
2021-09-23 11:16:48 +02:00
if ( is_metaconsole () === false ) {
$url = '<a target="_blank" href="' . ui_get_meta_url (
'index.php?sec=advanced&sec2=godmode/alerts/configure_alert_template&pure=0&id=' . $id . '&step=' . $step
) . '">' . __ ( 'metaconsole' ) . '</a>' ;
} else {
$url = __ ( 'any node' );
}
2020-07-13 12:23:46 +02:00
ui_print_warning_message (
2021-06-24 19:48:07 +02:00
__ (
'This node is configured with centralized mode. All alerts templates information is read only. Go to Go to %s to manage it.' ,
2021-09-23 11:16:48 +02:00
$url
2021-06-24 19:48:07 +02:00
)
2020-07-13 12:23:46 +02:00
);
}
2019-01-30 16:18:44 +01:00
$step = ( int ) get_parameter ( 'step' , 1 );
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
2019-01-30 16:18:44 +01:00
$create_alert = ( bool ) get_parameter ( 'create_alert' );
$create_template = ( bool ) get_parameter ( 'create_template' );
$update_template = ( bool ) get_parameter ( 'update_template' );
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
2021-03-26 09:11:10 +01:00
$disabled = false ;
if ( ! $create_alert && ! $create_template ) {
// When user edits a template with All group, user must have "LM" access privileges againt All group.
if ( $a_template [ 'id_group' ] == 0 && ! $can_edit_all ) {
$disabled = true ;
}
}
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
$name = '' ;
$description = '' ;
$type = '' ;
$value = '' ;
$max = '' ;
$min = '' ;
2022-02-01 16:50:53 +01:00
$schedule = json_encode (
$default_events_calendar
);
2021-11-04 09:55:37 +01:00
$special_day = 0 ;
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
$default_action = 0 ;
2019-01-30 16:18:44 +01:00
$fields = [];
2017-02-06 16:20:39 +01:00
for ( $i = 1 ; $i <= $config [ 'max_macro_fields' ]; $i ++ ) {
2019-01-30 16:18:44 +01:00
$fields [ $i ] = '' ;
2012-10-29 09:45:06 +01:00
}
2019-01-30 16:18:44 +01:00
2017-02-06 16:20:39 +01:00
for ( $i = 1 ; $i <= $config [ 'max_macro_fields' ]; $i ++ ) {
2019-01-30 16:18:44 +01:00
$fields_recovery [ $i ] = '' ;
2014-03-05 12:34:05 +01:00
}
2019-01-30 16:18:44 +01:00
2009-04-01 13:25:58 +02:00
$priority = 1 ;
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
$min_alerts = 0 ;
2016-03-09 03:33:01 +01:00
$min_alerts_reset_counter = 0 ;
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
$max_alerts = 1 ;
2013-06-04 18:06:58 +02:00
$threshold = SECONDS_1DAY ;
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
$recovery_notify = false ;
$field2_recovery = '' ;
$field3_recovery = '' ;
2009-01-16 20:04:54 +01:00
$matches = true ;
2010-02-25 20:17:59 +01:00
$id_group = 0 ;
2013-01-28 14:14:27 +01:00
$wizard_level = 'nowizard' ;
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
if ( $create_template ) {
2019-01-30 16:18:44 +01:00
$name = ( string ) get_parameter ( 'name' );
$description = ( string ) get_parameter ( 'description' );
$type = ( string ) get_parameter ( 'type' , 'critical' );
$value = ( string ) get_parameter ( 'value' );
$max = ( float ) get_parameter ( 'max' );
$min = ( float ) get_parameter ( 'min' );
$matches = ( bool ) get_parameter ( 'matches_value' );
$priority = ( int ) get_parameter ( 'priority' );
$wizard_level = ( string ) get_parameter ( 'wizard_level' );
$id_group = get_parameter ( 'id_group' );
2022-01-31 13:45:44 +01:00
$name_check = db_get_value ( 'name' , 'talert_templates' , 'name' , $name );
2019-01-30 16:18:44 +01:00
$values = [
'description' => $description ,
'value' => $value ,
'max_value' => $max ,
'min_value' => $min ,
'id_group' => $id_group ,
'matches_value' => $matches ,
'priority' => $priority ,
'wizard_level' => $wizard_level ,
2022-02-01 16:50:53 +01:00
'schedule' => $schedule ,
2019-01-30 16:18:44 +01:00
];
if ( $config [ 'dbtype' ] == 'oracle' ) {
$values [ 'field3' ] = ' ' ;
$values [ 'field3_recovery' ] = ' ' ;
}
if ( ! $name_check ) {
$result = alerts_create_alert_template ( $name , $type , $values );
} else {
$result = '' ;
}
if ( $result ) {
db_pandora_audit (
2022-01-20 10:55:23 +01:00
AUDIT_LOG_ALERT_MANAGEMENT ,
2019-01-30 16:18:44 +01:00
'Create alert template #' . $result ,
false ,
false ,
json_encode ( $values )
);
} else {
db_pandora_audit (
2022-01-20 10:55:23 +01:00
AUDIT_LOG_ALERT_MANAGEMENT ,
2019-01-30 16:18:44 +01:00
'Fail try to create alert template' ,
false ,
false ,
json_encode ( $values )
);
}
2022-01-31 13:45:44 +01:00
// Show errors.
2019-01-30 16:18:44 +01:00
if ( ! isset ( $messageAction )) {
$messageAction = __ ( 'Could not be created' );
}
if ( $name == '' ) {
$messageAction = __ ( 'No template name specified' );
}
$messageAction = ui_print_result_message (
$result ,
__ ( 'Successfully created' ),
$messageAction
);
2022-01-31 13:45:44 +01:00
// Go to previous step in case of error.
2019-01-30 16:18:44 +01:00
if ( $result === false ) {
2022-01-31 13:45:44 +01:00
$step -- ;
2019-01-30 16:18:44 +01:00
} else {
$id = $result ;
}
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
}
if ( $update_template ) {
2019-01-30 16:18:44 +01:00
$result = update_template ( $step - 1 );
ui_print_result_message (
$result ,
__ ( 'Successfully updated' ),
__ ( 'Could not be updated' )
);
2022-01-31 13:45:44 +01:00
// Go to previous step in case of error.
2019-01-30 16:18:44 +01:00
if ( $result === false ) {
2022-01-31 13:45:44 +01:00
$step -- ;
2019-01-30 16:18:44 +01:00
}
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
}
2009-01-14 10:22:07 +01:00
if ( $id && ! $create_template ) {
2019-01-30 16:18:44 +01:00
$template = alerts_get_alert_template ( $id );
$name = $template [ 'name' ];
$description = $template [ 'description' ];
$type = $template [ 'type' ];
$value = $template [ 'value' ];
$max = $template [ 'max_value' ];
$min = $template [ 'min_value' ];
$matches = $template [ 'matches_value' ];
2022-01-28 14:06:31 +01:00
2022-02-22 13:20:53 +01:00
$schedule = json_encode (
$default_events_calendar
);
2021-11-04 09:55:37 +01:00
$special_day = ( int ) $template [ 'special_day' ];
2019-01-30 16:18:44 +01:00
$max_alerts = $template [ 'max_alerts' ];
$min_alerts = $template [ 'min_alerts' ];
$min_alerts_reset_counter = $template [ 'min_alerts_reset_counter' ];
2020-03-23 11:34:37 +01:00
$disable_event = $template [ 'disable_event' ];
2019-01-30 16:18:44 +01:00
$threshold = $template [ 'time_threshold' ];
$fields = [];
for ( $i = 1 ; $i <= $config [ 'max_macro_fields' ]; $i ++ ) {
$fields [ $i ] = $template [ 'field' . $i ];
}
$recovery_notify = $template [ 'recovery_notify' ];
$fields_recovery = [];
for ( $i = 1 ; $i <= $config [ 'max_macro_fields' ]; $i ++ ) {
$fields_recovery [ $i ] = $template [ 'field' . $i . '_recovery' ];
}
$default_action = $template [ 'id_alert_action' ];
$priority = $template [ 'priority' ];
$id_group = $template [ 'id_group' ];
$wizard_level = $template [ 'wizard_level' ];
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
}
2019-01-30 16:18:44 +01:00
print_alert_template_steps ( $step , $id );
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
2015-06-25 10:07:53 +02:00
$table = new stdClass ();
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
$table -> id = 'template' ;
2015-06-16 16:09:50 +02:00
$table -> width = '100%' ;
$table -> class = 'databox filters' ;
2022-02-01 11:29:25 +01:00
if ( is_metaconsole () === true ) {
2019-01-30 16:18:44 +01:00
$table -> head [ 0 ] = __ ( 'Create Template' );
$table -> head_colspan [ 0 ] = 4 ;
$table -> headstyle [ 0 ] = 'text-align: center' ;
2015-03-06 12:28:05 +01:00
}
2019-01-30 16:18:44 +01:00
$table -> style = [];
2015-07-07 13:57:47 +02:00
$table -> style [ 0 ] = 'font-weight: bold;' ;
$table -> style [ 2 ] = 'font-weight: bold;' ;
2019-01-30 16:18:44 +01:00
$table -> size = [];
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
$table -> size [ 0 ] = '20%' ;
$table -> size [ 2 ] = '20%' ;
if ( $step == 2 ) {
2019-01-30 16:18:44 +01:00
if ( ! isset ( $show_matches )) {
$show_matches = false ;
}
2022-01-28 14:06:31 +01:00
$table -> data [ 0 ][ 0 ] = __ ( 'Use special days list' );
2021-11-04 09:55:37 +01:00
$data_special_days = Calendar :: calendars (
// Fields.
[ '`talert_calendar`.*' ],
// Filter.
[],
// Count.
false ,
// Offset.
null ,
// Limit.
null ,
// Order.
null ,
// Sort field.
null ,
// Reduce to a select.
true
);
2022-01-28 14:06:31 +01:00
$table -> data [ 0 ][ 1 ] = html_print_select (
2021-11-04 09:55:37 +01:00
$data_special_days ,
2020-07-13 12:23:46 +02:00
'special_day' ,
$special_day ,
2021-11-04 09:55:37 +01:00
'' ,
__ ( 'None' ),
0 ,
2020-07-13 12:23:46 +02:00
true ,
2021-11-04 09:55:37 +01:00
false ,
false ,
'' ,
2021-06-03 10:16:29 +02:00
( ! $is_management_allowed | $disabled )
2020-07-13 12:23:46 +02:00
);
2019-01-30 16:18:44 +01:00
2022-01-28 14:06:31 +01:00
// Firing conditions and events.
$table -> colspan = [];
$table -> data [ 1 ][ 0 ] = __ ( 'Schedule' );
$table -> colspan [ 1 ][ 1 ] = 3 ;
2022-01-31 13:45:44 +01:00
$table -> data [ 1 ][ 1 ] = ui_print_warning_message (
[
2022-01-31 16:50:48 +01:00
'message' => __ ( 'No alert has been scheduled yet' ),
2022-01-31 13:45:44 +01:00
'force_style' => 'display:none;' ,
2022-02-07 13:07:48 +01:00
'force_class' => 'alert_schedule' ,
2022-01-31 13:45:44 +01:00
],
2020-07-13 12:23:46 +02:00
'' ,
2022-01-31 13:45:44 +01:00
true
2019-01-30 16:18:44 +01:00
);
2022-02-01 11:29:25 +01:00
$table -> data [ 1 ][ 1 ] .= '<div id="calendar_map" style="width: 90%;"></div>' ;
2022-01-28 14:06:31 +01:00
$table -> data [ 1 ][ 1 ] .= html_print_input_hidden ( 'schedule' , $schedule , true );
2019-01-30 16:18:44 +01:00
$table -> colspan [ 'threshold' ][ 1 ] = 3 ;
$table -> data [ 'threshold' ][ 0 ] = __ ( 'Time threshold' );
$table -> data [ 'threshold' ][ 1 ] = html_print_extended_select_for_time (
'threshold' ,
$threshold ,
'' ,
'' ,
'' ,
false ,
2020-07-13 12:23:46 +02:00
true ,
false ,
true ,
'' ,
2021-06-03 10:16:29 +02:00
( ! $is_management_allowed | $disabled )
2019-01-30 16:18:44 +01:00
);
2021-12-17 13:38:53 +01:00
$table -> data [ 4 ][ 0 ] = __ ( 'Min. number of alerts' );
$table -> data [ 4 ][ 1 ] = html_print_input_text (
2019-01-30 16:18:44 +01:00
'min_alerts' ,
$min_alerts ,
'' ,
5 ,
7 ,
2020-07-13 12:23:46 +02:00
true ,
false ,
false ,
'' ,
'' ,
'' ,
'' ,
false ,
'' ,
'' ,
'' ,
2021-06-03 10:16:29 +02:00
( ! $is_management_allowed | $disabled )
2019-01-30 16:18:44 +01:00
);
2021-12-17 13:38:53 +01:00
$table -> data [ 4 ][ 2 ] = __ ( 'Reset counter for non-sustained alerts' );
$table -> data [ 4 ][ 2 ] .= ui_print_help_tip (
2020-07-13 12:23:46 +02:00
__ ( 'Enable this option if you want the counter to be reset when the alert is not being fired consecutively, even if it\'s within the time threshold' ),
true
);
2021-12-17 13:38:53 +01:00
$table -> data [ 4 ][ 3 ] = html_print_checkbox (
2020-07-13 12:23:46 +02:00
'min_alerts_reset_counter' ,
1 ,
$min_alerts_reset_counter ,
true ,
2021-06-03 10:16:29 +02:00
( ! $is_management_allowed | $disabled ),
2020-09-14 13:43:18 +02:00
'' ,
false ,
2022-01-31 13:45:44 +01:00
( $create_template == 1 ) ? 'checked=checked' : ''
2020-07-13 12:23:46 +02:00
);
2019-01-30 16:18:44 +01:00
2021-12-17 13:38:53 +01:00
$table -> data [ 5 ][ 0 ] = __ ( 'Max. number of alerts' );
$table -> data [ 5 ][ 1 ] = html_print_input_text (
2019-01-30 16:18:44 +01:00
'max_alerts' ,
$max_alerts ,
'' ,
5 ,
7 ,
2020-07-13 12:23:46 +02:00
true ,
false ,
false ,
'' ,
'' ,
'' ,
'' ,
false ,
'' ,
'' ,
'' ,
2021-06-03 10:16:29 +02:00
( ! $is_management_allowed | $disabled )
2019-01-30 16:18:44 +01:00
);
2021-12-17 13:38:53 +01:00
$table -> data [ 5 ][ 2 ] = __ ( 'Disable event' );
$table -> data [ 5 ][ 3 ] = html_print_checkbox (
2020-07-13 12:23:46 +02:00
'disable_event' ,
1 ,
$disable_event ,
true ,
2021-06-03 10:16:29 +02:00
( ! $is_management_allowed | $disabled )
2020-07-13 12:23:46 +02:00
);
2020-03-23 11:34:37 +01:00
2021-12-17 13:38:53 +01:00
$table -> data [ 6 ][ 0 ] = __ ( 'Default action' );
2020-07-13 12:23:46 +02:00
$usr_groups = implode (
',' ,
array_keys ( users_get_groups ( $config [ 'id_user' ], 'LM' , true ))
);
2019-01-30 16:18:44 +01:00
2020-07-13 12:23:46 +02:00
$sql_query = sprintf (
2022-02-01 11:29:25 +01:00
' SELECT id , name
2020-07-13 12:23:46 +02:00
FROM talert_actions
WHERE id_group IN ( % s )
ORDER BY name ' ,
$usr_groups
);
2019-01-30 16:18:44 +01:00
2021-12-17 13:38:53 +01:00
$table -> data [ 6 ][ 1 ] = html_print_select_from_sql (
2019-01-30 16:18:44 +01:00
$sql_query ,
'default_action' ,
$default_action ,
'' ,
__ ( 'None' ),
0 ,
true ,
false ,
false ,
2021-06-03 10:16:29 +02:00
( ! $is_management_allowed | $disabled ),
2019-01-30 16:18:44 +01:00
false ,
false ,
0
2020-07-13 12:23:46 +02:00
);
2021-12-17 13:38:53 +01:00
$table -> data [ 6 ][ 1 ] .= ui_print_help_tip (
2019-01-30 16:18:44 +01:00
__ ( 'Unless they\'re left blank, the fields from the action will override those set on the template.' ),
true
);
2021-12-17 13:38:53 +01:00
$table -> data [ 7 ][ 0 ] = __ ( 'Condition type' );
$table -> data [ 7 ][ 1 ] = html_print_select (
2019-01-30 16:18:44 +01:00
alerts_get_alert_templates_types (),
'type' ,
$type ,
'' ,
2019-04-24 10:51:55 +02:00
__ ( 'None' ),
2019-01-30 16:18:44 +01:00
0 ,
true ,
false ,
2020-07-13 12:23:46 +02:00
false ,
'' ,
2021-06-03 10:16:29 +02:00
( ! $is_management_allowed | $disabled )
2019-01-30 16:18:44 +01:00
);
2022-01-31 13:45:44 +01:00
$table -> data [ 7 ][ 1 ] .= '<span id="matches_value" ' . (( $show_matches ) ? '' : 'class="invisible"' ) . '>' ;
2021-12-17 13:38:53 +01:00
$table -> data [ 7 ][ 1 ] .= ' ' . html_print_checkbox ( 'matches_value' , 1 , $matches , true );
$table -> data [ 7 ][ 1 ] .= html_print_label (
2019-01-30 16:18:44 +01:00
__ ( 'Trigger when matches the value' ),
'checkbox-matches_value' ,
true
);
2021-12-17 13:38:53 +01:00
$table -> data [ 7 ][ 1 ] .= '</span>' ;
$table -> colspan [ 7 ][ 1 ] = 3 ;
2019-01-30 16:18:44 +01:00
$table -> data [ 'value' ][ 0 ] = __ ( 'Value' );
$table -> data [ 'value' ][ 1 ] = html_print_input_text (
'value' ,
$value ,
'' ,
35 ,
255 ,
true
);
$table -> data [ 'value' ][ 1 ] .= ' <span id="regex_ok">' ;
$table -> data [ 'value' ][ 1 ] .= html_print_image (
'images/suc.png' ,
true ,
[
'style' => 'display:none' ,
'id' => 'regex_good' ,
'title' => __ ( 'The regular expression is valid' ),
'width' => '20px' ,
]
);
$table -> data [ 'value' ][ 1 ] .= html_print_image (
'images/err.png' ,
true ,
[
'style' => 'display:none' ,
'id' => 'regex_bad' ,
'title' => __ ( 'The regular expression is not valid' ),
'width' => '20px' ,
]
);
$table -> data [ 'value' ][ 1 ] .= '</span>' ;
$table -> colspan [ 'value' ][ 1 ] = 3 ;
2020-07-13 12:23:46 +02:00
// Min first, then max, that's more logical.
2019-01-30 16:18:44 +01:00
$table -> data [ 'min' ][ 0 ] = __ ( 'Min.' );
$table -> data [ 'min' ][ 1 ] = html_print_input_text (
'min' ,
$min ,
'' ,
5 ,
255 ,
2021-03-26 09:11:10 +01:00
true ,
$disabled
2019-01-30 16:18:44 +01:00
);
$table -> colspan [ 'min' ][ 1 ] = 3 ;
$table -> data [ 'max' ][ 0 ] = __ ( 'Max.' );
$table -> data [ 'max' ][ 1 ] = html_print_input_text (
'max' ,
$max ,
'' ,
5 ,
255 ,
2021-03-26 09:11:10 +01:00
true ,
$disabled
2019-01-30 16:18:44 +01:00
);
$table -> colspan [ 'max' ][ 1 ] = 3 ;
$table -> data [ 'example' ][ 1 ] = ui_print_alert_template_example (
$id ,
true ,
false
);
$table -> colspan [ 'example' ][ 1 ] = 4 ;
} else if ( $step == 3 ) {
$table -> style [ 0 ] = 'font-weight: bold; vertical-align: middle' ;
$table -> style [ 1 ] = 'font-weight: bold; vertical-align: top' ;
$table -> style [ 2 ] = 'font-weight: bold; vertical-align: top' ;
$table -> size = [];
$table -> size [ 0 ] = '10%' ;
$table -> size [ 1 ] = '45%' ;
$table -> size [ 2 ] = '45%' ;
2020-07-13 12:23:46 +02:00
// Alert recover.
2019-01-30 16:18:44 +01:00
if ( ! $recovery_notify ) {
$table -> cellstyle [ 'label_fields' ][ 2 ] = 'display:none;' ;
for ( $i = 1 ; $i <= $config [ 'max_macro_fields' ]; $i ++ ) {
$table -> cellstyle [ 'field' . $i ][ 2 ] = 'display:none;' ;
}
}
$table -> data [ 0 ][ 0 ] = __ ( 'Alert recovery' );
$values = [
false => __ ( 'Disabled' ),
true => __ ( 'Enabled' ),
];
$table -> data [ 0 ][ 1 ] = html_print_select (
$values ,
'recovery_notify' ,
$recovery_notify ,
'' ,
'' ,
'' ,
true ,
false ,
2020-07-13 12:23:46 +02:00
false ,
'' ,
2021-06-03 10:16:29 +02:00
( ! $is_management_allowed | $disabled )
2019-01-30 16:18:44 +01:00
);
$table -> colspan [ 0 ][ 1 ] = 2 ;
$table -> data [ 'label_fields' ][ 0 ] = '' ;
$table -> data [ 'label_fields' ][ 1 ] = __ ( 'Firing fields' );
$table -> data [ 'label_fields' ][ 2 ] = __ ( 'Recovery fields' );
for ( $i = 1 ; $i <= $config [ 'max_macro_fields' ]; $i ++ ) {
2020-07-13 12:23:46 +02:00
if ( isset ( $template [ $name ]) === true ) {
2019-01-30 16:18:44 +01:00
$value = $template [ $name ];
} else {
$value = '' ;
}
2020-05-29 11:37:06 +02:00
$table -> data [ 'field' . $i ][ 0 ] = sprintf ( __ ( 'Field %s' ), $i );
2020-07-13 12:23:46 +02:00
// TinyMCE.
// triggering fields.
// Basic.
2021-03-11 15:40:23 +01:00
$table -> data [ 'field' . $i ][ 1 ] = '<div id="command_div"><b><small>' ;
2020-07-13 12:23:46 +02:00
$table -> data [ 'field' . $i ][ 1 ] .= __ ( 'Basic' ) . ' ' ;
$table -> data [ 'field' . $i ][ 1 ] .= html_print_radio_button_extended (
'editor_type_value_' . $i ,
0 ,
'' ,
false ,
2021-06-03 10:16:29 +02:00
( ! $is_management_allowed | $disabled ),
2020-07-13 12:23:46 +02:00
" removeTinyMCE('textarea_field " . $i . " ') " ,
'' ,
true
);
// Advanced.
$table -> data [ 'field' . $i ][ 1 ] .= ' ' ;
$table -> data [ 'field' . $i ][ 1 ] .= __ ( 'Advanced' ) . ' ' ;
$table -> data [ 'field' . $i ][ 1 ] .= html_print_radio_button_extended (
'editor_type_value_' . $i ,
0 ,
'' ,
true ,
2021-06-03 10:16:29 +02:00
( ! $is_management_allowed | $disabled ),
2020-07-13 12:23:46 +02:00
" addTinyMCE('textarea_field " . $i . " ') " ,
'' ,
true
);
$table -> data [ 'field' . $i ][ 1 ] .= '</small></b></div>' ;
// Texarea.
$table -> data [ 'field' . $i ][ 1 ] .= html_print_textarea (
'field' . $i ,
1 ,
1 ,
isset ( $fields [ $i ]) ? $fields [ $i ] : '' ,
2021-03-11 15:40:23 +01:00
'class="fields" min-height-40px' ,
2020-07-13 12:23:46 +02:00
true ,
'' ,
2021-06-03 10:16:29 +02:00
( ! $is_management_allowed | $disabled )
2020-07-13 12:23:46 +02:00
);
// Recovery.
// Basic.
2021-03-11 15:40:23 +01:00
$table -> data [ 'field' . $i ][ 2 ] = '<div id="command_div"><b><small>' ;
2020-07-13 12:23:46 +02:00
$table -> data [ 'field' . $i ][ 2 ] .= __ ( 'Basic' ) . ' ' ;
$table -> data [ 'field' . $i ][ 2 ] .= html_print_radio_button_extended (
'editor_type_recovery_value_' . $i ,
0 ,
'' ,
false ,
2021-06-03 10:16:29 +02:00
( ! $is_management_allowed | $disabled ),
2020-07-13 12:23:46 +02:00
" removeTinyMCE('textarea_field " . $i . " _recovery') " ,
'' ,
true
);
// Advanced.
$table -> data [ 'field' . $i ][ 2 ] .= ' ' ;
$table -> data [ 'field' . $i ][ 2 ] .= __ ( 'Advanced' ) . ' ' ;
$table -> data [ 'field' . $i ][ 2 ] .= html_print_radio_button_extended (
'editor_type_recovery_value_' . $i ,
0 ,
'' ,
true ,
2021-06-03 10:16:29 +02:00
( ! $is_management_allowed | $disabled ),
2020-07-13 12:23:46 +02:00
" addTinyMCE('textarea_field " . $i . " _recovery') " ,
'' ,
true
);
$table -> data [ 'field' . $i ][ 2 ] .= '</small></b></div>' ;
// Texarea.
$table -> data [ 'field' . $i ][ 2 ] .= html_print_textarea (
'field' . $i . '_recovery' ,
1 ,
1 ,
isset ( $fields_recovery [ $i ]) ? $fields_recovery [ $i ] : '' ,
2021-03-11 15:40:23 +01:00
'class="fields min-height-40px"' ,
2020-07-13 12:23:46 +02:00
true ,
'' ,
2021-06-03 10:16:29 +02:00
( ! $is_management_allowed | $disabled )
2020-07-13 12:23:46 +02:00
);
2019-01-30 16:18:44 +01:00
}
} else {
2020-07-13 12:23:46 +02:00
// Step 1 by default.
2019-01-30 16:18:44 +01:00
$table -> size = [];
$table -> size [ 0 ] = '20%' ;
$table -> data = [];
$table -> rowstyle = [];
$table -> rowstyle [ 'value' ] = 'display: none' ;
$table -> rowstyle [ 'max' ] = 'display: none' ;
$table -> rowstyle [ 'min' ] = 'display: none' ;
$show_matches = false ;
switch ( $type ) {
case 'equal' :
case 'not_equal' :
case 'regex' :
$show_matches = true ;
$table -> rowstyle [ 'value' ] = '' ;
break ;
case 'max_min' :
$show_matches = true ;
case 'max' :
$table -> rowstyle [ 'max' ] = '' ;
if ( $type == 'max' ) {
break ;
}
case 'min' :
$table -> rowstyle [ 'min' ] = '' ;
break ;
case 'onchange' :
$show_matches = true ;
break ;
2022-01-31 13:45:44 +01:00
default :
// Not possible.
break ;
2019-01-30 16:18:44 +01:00
}
$table -> data [ 0 ][ 0 ] = __ ( 'Name' );
2020-07-13 12:23:46 +02:00
$table -> data [ 0 ][ 1 ] = html_print_input_text (
'name' ,
$name ,
'' ,
35 ,
255 ,
true ,
false ,
false ,
'' ,
'' ,
'' ,
'' ,
false ,
'' ,
'' ,
'' ,
2021-06-03 10:16:29 +02:00
( ! $is_management_allowed | $disabled )
2020-07-13 12:23:46 +02:00
);
2019-01-30 16:18:44 +01:00
$table -> data [ 0 ][ 1 ] .= ' ' . __ ( 'Group' );
$groups = users_get_groups ();
$own_info = get_user_info ( $config [ 'id_user' ]);
2021-01-20 18:22:43 +01:00
$return_all_group = false ;
2021-03-26 09:11:10 +01:00
if ( users_can_manage_group_all ( 'LM' ) === true || $disabled ) {
2021-01-20 18:22:43 +01:00
$return_all_group = true ;
2021-03-26 09:11:10 +01:00
} else {
if ( $id_group == 0 ) {
$id_group = users_get_first_group ( false , 'LM' , false );
}
2019-01-30 16:18:44 +01:00
}
2020-07-13 12:23:46 +02:00
$table -> data [ 0 ][ 1 ] .= ' ' ;
2020-09-28 18:04:46 +02:00
$table -> data [ 0 ][ 1 ] .= '<div class="w250px inline">' . html_print_select_groups (
2020-07-13 12:23:46 +02:00
false ,
'AR' ,
2021-01-20 18:22:43 +01:00
$return_all_group ,
2020-07-13 12:23:46 +02:00
'id_group' ,
$id_group ,
'' ,
'' ,
0 ,
true ,
false ,
true ,
'' ,
2021-06-03 10:16:29 +02:00
( ! $is_management_allowed | $disabled )
2020-09-28 18:04:46 +02:00
) . '</div>' ;
2019-01-30 16:18:44 +01:00
$table -> data [ 1 ][ 0 ] = __ ( 'Description' );
$table -> data [ 1 ][ 1 ] = html_print_textarea (
'description' ,
10 ,
30 ,
$description ,
'' ,
2020-07-13 12:23:46 +02:00
true ,
'' ,
2021-06-03 10:16:29 +02:00
( ! $is_management_allowed | $disabled )
2019-01-30 16:18:44 +01:00
);
$table -> data [ 2 ][ 0 ] = __ ( 'Priority' );
$table -> data [ 2 ][ 1 ] = html_print_select (
get_priorities (),
'priority' ,
$priority ,
'' ,
0 ,
0 ,
true ,
false ,
2020-07-13 12:23:46 +02:00
false ,
'' ,
2021-06-03 10:16:29 +02:00
( ! $is_management_allowed | $disabled )
2019-01-30 16:18:44 +01:00
);
2022-02-01 11:29:25 +01:00
if ( is_metaconsole () === true ) {
2019-01-30 16:18:44 +01:00
$table -> data [ 3 ][ 0 ] = __ ( 'Wizard level' );
$wizard_levels = [
'nowizard' => __ ( 'No wizard' ),
'basic' => __ ( 'Basic' ),
'advanced' => __ ( 'Advanced' ),
];
$table -> data [ 3 ][ 1 ] = html_print_select ( $wizard_levels , 'wizard_level' , $wizard_level , '' , '' , - 1 , true , false , false );
} else {
$table -> data [ 2 ][ 1 ] .= html_print_input_hidden ( 'wizard_level' , $wizard_level , true );
}
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
}
2018-06-11 16:40:10 +02:00
if ( $step == 2 ) {
2019-01-30 16:18:44 +01:00
echo ui_get_using_system_timezone_warning ();
2018-06-11 16:40:10 +02:00
}
2022-01-31 13:45:44 +01:00
// If it's the last step it will redirect to template lists.
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
if ( $step >= LAST_STEP ) {
2019-01-30 16:18:44 +01:00
echo '<form method="post" action="index.php?sec=' . $sec . '&sec2=godmode/alerts/alert_templates&pure=' . $pure . '">' ;
} else {
echo '<form method="post">' ;
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
}
2019-01-30 16:18:44 +01:00
html_print_table ( $table );
echo '<div class="action-buttons" style="width: ' . $table -> width . '">' ;
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
if ( $id ) {
2019-01-30 16:18:44 +01:00
html_print_input_hidden ( 'id' , $id );
html_print_input_hidden ( 'update_template' , 1 );
} else {
html_print_input_hidden ( 'create_template' , 1 );
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
}
2013-06-04 18:06:58 +02:00
if ( ! $disabled ) {
2021-06-03 10:16:29 +02:00
if ( $is_management_allowed === true ) {
2020-07-13 12:23:46 +02:00
if ( $step >= LAST_STEP ) {
2019-01-30 16:18:44 +01:00
html_print_submit_button (
2020-07-13 12:23:46 +02:00
__ ( 'Finish' ),
'finish' ,
2019-01-30 16:18:44 +01:00
false ,
2020-07-13 12:23:46 +02:00
'class="sub upd"'
2019-01-30 16:18:44 +01:00
);
} else {
2020-07-13 12:23:46 +02:00
html_print_input_hidden ( 'step' , ( $step + 1 ));
if ( $step == 2 ) {
2022-01-31 13:45:44 +01:00
// Javascript onsubmit to avoid min = 0 and max = 0.
2020-07-13 12:23:46 +02:00
html_print_submit_button (
__ ( 'Next' ),
'next' ,
false ,
'class="sub next" onclick="return check_fields_step2();"'
);
} else {
html_print_submit_button (
__ ( 'Next' ),
'next' ,
false ,
'class="sub next"'
);
}
2019-01-30 16:18:44 +01:00
}
}
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
}
2013-06-04 18:06:58 +02:00
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
echo '</div>' ;
echo '</form>' ;
2022-02-02 10:09:31 +01:00
if ( is_metaconsole () === true ) {
enterprise_hook ( 'close_meta_frame' );
}
2013-05-20 10:42:02 +02:00
2019-01-30 16:18:44 +01:00
ui_require_javascript_file ( 'pandora_alerts' );
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 ();
2019-01-30 16:18:44 +01:00
ui_require_jquery_file ( 'ui.datepicker-' . get_user_language (), 'include/javascript/i18n/' );
2016-09-29 14:30:07 +02:00
ui_require_javascript_file ( 'tiny_mce' , 'include/javascript/tiny_mce/' );
2021-12-17 13:38:53 +01:00
ui_require_css_file ( 'main.min' , 'include/javascript/fullcalendar/' );
ui_require_javascript_file ( 'main.min' , 'include/javascript/fullcalendar/' );
2022-01-27 17:02:24 +01:00
ui_require_javascript_file ( 'pandora_fullcalendar' );
2009-02-09 Evi Vanoost <vanooste@rcbi.rochester.edu>
* general/header.php, general/footer.php: Made it comply with standards
* general/main_menu.php: Fixed some typo's.
* include/javascript/jquery.pandora.js: This was loading an extension
that has a separate file already
* include/functions.php: Added process_page_head and process_page_body
these are callback functions for ob_start and add functionality like
conditional loading and external scripts in the correct places. Also adds
override functionality to certain items (like refresh) from anywhere
* include/javascript/time_en.js: Added as a placeholder
* extensions/update_manager.php: Fixed some typos
* operation/agentes/exportdata.php, operation/agentes/networkmap.php,
operation/events/events.php, operation/extensions.php,
operation/incidents/incident_detail.php,
operation/reporting/reporting_viewer.php,
operation/visual_console/render_view.php,
godmode/agentes/alert_manager.php,
godmode/agentes/module_manager_editor.php,
godmode/agentes/planned_downtime.php,
godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/groups/configure_group.php, godmode/reporting/graph_builder.php,
godmode/reporting/map_builder.php, godmode/reporting/reporting_builder.php
godmode/snmpconsole/snmp_alert.php: Changed javascript, css and jquery
loading to the new buffer callback handlers.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1436 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-02-09 19:41:54 +01:00
?>
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
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
< script type = " text/javascript " >
2009-02-12 22:04:02 +01:00
/* <![CDATA[ */
2019-01-30 16:18:44 +01:00
var matches = < ? php echo " ' " . __ ( 'The alert would fire when the value matches <span id="value"></span>' ) . " ' " ; ?> ;
var matches_not = < ? php echo '"' . __ ( " The alert would fire when the value doesn \ 't match %s " , " <span id='value'></span> " ) . '"' ; ?> ;
var is = < ? php echo " ' " . __ ( 'The alert would fire when the value is <span id="value"></span>' ) . " ' " ; ?> ;
var is_not = < ? php echo " ' " . __ ( 'The alert would fire when the value is not <span id="value"></span>' ) . " ' " ; ?> ;
var between = < ? php echo " ' " . __ ( 'The alert would fire when the value is between <span id="min"></span> and <span id="max"></span>' ) . " ' " ; ?> ;
2020-06-18 17:09:22 +02:00
var between_not = < ? php echo '"' . __ ( 'The alert would fire when the value is not between <span id=min></span> and <span id=max></span>' ) . '"' ; ?> ;
2019-01-30 16:18:44 +01:00
var under = < ? php echo " ' " . __ ( 'The alert would fire when the value is below <span id="min"></span>' ) . " ' " ; ?> ;
var over = < ? php echo " ' " . __ ( 'The alert would fire when the value is above <span id="max"></span>' ) . " ' " ; ?> ;
var warning = < ? php echo " ' " . __ ( 'The alert would fire when the module is in warning status' ) . " ' " ; ?> ;
var critical = < ? php echo " ' " . __ ( 'The alert would fire when the module is in critical status' ) . " ' " ; ?> ;
var onchange_msg = < ? php echo '"' . __ ( 'The alert would fire when the module value changes' ) . '"' ; ?> ;
var onchange_not = < ? php echo '"' . __ ( 'The alert would fire when the module value does not change' ) . '"' ; ?> ;
var unknown = < ? php echo " ' " . __ ( 'The alert would fire when the module is in unknown status' ) . " ' " ; ?> ;
var error_message_min_max_zero = < ? php echo " ' " . __ ( 'The alert template cannot have the same value for min and max thresholds.' ) . " ' " ; ?> ;
2019-04-24 10:51:55 +02:00
var not_normal = < ? php echo " ' " . __ ( 'The alert would fire when the module is in not normal status' ) . " ' " ; ?> ;
2014-09-10 16:33:19 +02:00
function check_fields_step2 () {
2019-01-30 16:18:44 +01:00
var correct = true ;
2022-01-27 17:02:24 +01:00
2019-01-30 16:18:44 +01:00
type = $ ( " select[name='type'] " ) . val ();
min_v = $ ( " input[name='min'] " ) . val ();
max_v = $ ( " input[name='max'] " ) . val ();
2022-01-27 17:02:24 +01:00
2019-01-30 16:18:44 +01:00
if ( type == 'max_min' ) {
if (( min_v == 0 ) && ( max_v == 0 )) {
alert ( error_message_min_max_zero );
correct = false ;
}
}
2022-01-27 17:02:24 +01:00
2019-01-30 16:18:44 +01:00
return correct ;
2014-09-10 16:33:19 +02:00
}
2009-01-16 11:55:29 +01:00
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
function check_regex () {
2019-01-30 16:18:44 +01:00
if ( $ ( " #type " ) . val () != 'regex' ) {
$ ( " img#regex_good, img#regex_bad " ) . hide ();
return ;
}
try {
re = new RegExp ( $ ( " #text-value " ) . val ());
} catch ( error ) {
$ ( " img#regex_good " ) . hide ();
$ ( " img#regex_bad " ) . show ();
return ;
}
$ ( " img#regex_bad " ) . hide ();
$ ( " img#regex_good " ) . show ();
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
}
2009-01-16 11:55:29 +01:00
function render_example () {
2019-01-30 16:18:44 +01:00
/* Set max */
var vmax = parseInt ( $ ( " input#text-max " ) . val ());
if ( isNaN ( vmax ) || vmax == " " ) {
$ ( " span#max " ) . empty () . append ( " 0 " );
}
else {
$ ( " span#max " ) . empty () . append ( vmax );
}
/* Set min */
var vmin = parseInt ( $ ( " input#text-min " ) . val ());
if ( isNaN ( vmin ) || vmin == " " ) {
$ ( " span#min " ) . empty () . append ( " 0 " );
}
else {
$ ( " span#min " ) . empty () . append ( vmin );
}
/* Set value */
var vvalue = $ ( " input#text-value " ) . val ();
if ( vvalue == " " ) {
$ ( " span#value " ) . empty () . append ( " <em><?php echo __('Empty'); ?></em> " );
}
else {
$ ( " span#value " ) . empty () . append ( vvalue );
}
2009-01-16 11:55:29 +01:00
}
2012-12-12 20:37:35 +01:00
// Fix for metaconsole toggle
$ ( '.row_field' ) . css ( " display " , " none " );
var hided = true ;
2012-10-29 09:45:06 +01:00
function toggle_fields () {
2019-01-30 16:18:44 +01:00
$ ( '.row_field' ) . toggle ();
if ( hided ) {
$ ( '.row_field' ) . css ( " display " , " " );
hided = false ;
}
else {
$ ( '.row_field' ) . css ( " display " , " none " );
hided = true ;
}
2012-10-29 09:45:06 +01:00
}
2012-12-12 20:37:35 +01:00
//toggle_fields();
2013-06-04 18:06:58 +02:00
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
$ ( document ) . ready ( function () {
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
< ? php
2014-03-05 12:34:05 +01:00
if ( $step == 2 ) {
2019-01-30 16:18:44 +01:00
?>
$ ( " input#text-value " ) . keyup ( render_example );
$ ( " input#text-max " ) . keyup ( render_example );
$ ( " input#text-min " ) . keyup ( render_example );
2022-01-27 17:02:24 +01:00
2019-01-30 16:18:44 +01:00
$ ( " #type " ) . change ( function () {
switch ( this . value ) {
case " equal " :
case " not_equal " :
$ ( " img#regex_good, img#regex_bad, span#matches_value " ) . hide ();
$ ( " #template-max, #template-min " ) . hide ();
$ ( " #template-value, #template-example " ) . show ();
2022-01-27 17:02:24 +01:00
2019-01-30 16:18:44 +01:00
/* Show example */
if ( this . value == " equal " )
$ ( " span#example " ) . empty () . append ( is );
else
$ ( " span#example " ) . empty () . append ( is_not );
break ;
case " regex " :
$ ( " #template-max, #template-min " ) . hide ();
$ ( " #template-value, #template-example, span#matches_value " ) . show ();
check_regex ();
2022-01-27 17:02:24 +01:00
2019-01-30 16:18:44 +01:00
/* Show example */
if ( $ ( " #checkbox-matches_value " )[ 0 ] . checked )
$ ( " span#example " ) . empty () . append ( matches );
else
$ ( " span#example " ) . empty () . append ( matches_not );
break ;
case " max_min " :
$ ( " #template-value " ) . hide ();
$ ( " #template-max, #template-min, #template-example, span#matches_value " ) . show ();
2022-01-27 17:02:24 +01:00
2019-01-30 16:18:44 +01:00
/* Show example */
if ( $ ( " #checkbox-matches_value " )[ 0 ] . checked )
$ ( " span#example " ) . empty () . append ( between );
else
$ ( " span#example " ) . empty () . append ( between_not );
2022-01-27 17:02:24 +01:00
2019-01-30 16:18:44 +01:00
break ;
case " max " :
$ ( " #template-value, #template-min, span#matches_value " ) . hide ();
$ ( " #template-max, #template-example " ) . show ();
2022-01-27 17:02:24 +01:00
2019-01-30 16:18:44 +01:00
/* Show example */
$ ( " span#example " ) . empty () . append ( over );
break ;
case " min " :
$ ( " #template-value, #template-max, span#matches_value " ) . hide ();
$ ( " #template-min, #template-example " ) . show ();
2022-01-27 17:02:24 +01:00
2019-01-30 16:18:44 +01:00
/* Show example */
$ ( " span#example " ) . empty () . append ( under );
break ;
case " warning " :
$ ( " #template-value, #template-max, span#matches_value, #template-min " ) . hide ();
$ ( " #template-example " ) . show ();
2022-01-27 17:02:24 +01:00
2019-01-30 16:18:44 +01:00
/* Show example */
$ ( " span#example " ) . empty () . append ( warning );
break ;
case " critical " :
$ ( " #template-value, #template-max, span#matches_value, #template-min " ) . hide ();
$ ( " #template-example " ) . show ();
2022-01-27 17:02:24 +01:00
2019-01-30 16:18:44 +01:00
/* Show example */
$ ( " span#example " ) . empty () . append ( critical );
break ;
2019-04-24 10:51:55 +02:00
case " not_normal " :
$ ( " #template-value, #template-max, span#matches_value, #template-min " ) . hide ();
$ ( " #template-example " ) . show ();
2022-01-27 17:02:24 +01:00
2019-04-24 10:51:55 +02:00
/* Show example */
$ ( " span#example " ) . empty () . append ( not_normal );
break ;
2019-01-30 16:18:44 +01:00
case " onchange " :
$ ( " #template-value, #template-max, #template-min " ) . hide ();
$ ( " #template-example, span#matches_value " ) . show ();
2022-01-27 17:02:24 +01:00
2019-01-30 16:18:44 +01:00
/* Show example */
if ( $ ( " #checkbox-matches_value " )[ 0 ] . checked )
$ ( " span#example " ) . empty () . append ( onchange_msg );
else
$ ( " span#example " ) . empty () . append ( onchange_not );
break ;
case " unknown " :
$ ( " #template-value, #template-max, span#matches_value, #template-min " ) . hide ();
$ ( " #template-example " ) . show ();
2021-01-19 16:03:34 +01:00
if ( $ ( " #text-min_alerts " ) . val () > 0 ) {
unknown = < ? php echo " ' " . __ ( 'The alert would fire when the module is in unknown status. Warning: unknown_updates of pandora_server.conf must be equal to 1' ) . " ' " ; ?> ;
}
2019-01-30 16:18:44 +01:00
/* Show example */
$ ( " span#example " ) . empty () . append ( unknown );
break ;
default :
$ ( " #template-value, #template-max, #template-min, #template-example, span#matches_value " ) . hide ();
break ;
}
2022-01-27 17:02:24 +01:00
2019-01-30 16:18:44 +01:00
render_example ();
}) . change ();
2022-01-27 17:02:24 +01:00
2019-01-30 16:18:44 +01:00
$ ( " #checkbox-matches_value " ) . click ( function () {
enabled = this . checked ;
type = $ ( " #type " ) . val ();
if ( type == " regex " ) {
if ( enabled ) {
$ ( " span#example " ) . empty () . append ( matches );
}
else {
$ ( " span#example " ) . empty () . append ( matches_not );
}
}
else if ( type == " max_min " ) {
if ( enabled ) {
$ ( " span#example " ) . empty () . append ( between );
}
else {
$ ( " span#example " ) . empty () . append ( between_not );
}
}
else if ( type == " onchange " ) {
if ( enabled ) {
$ ( " span#example " ) . empty () . append ( onchange_msg );
}
else {
$ ( " span#example " ) . empty () . append ( onchange_not );
}
2022-01-27 17:02:24 +01:00
}
2019-01-30 16:18:44 +01:00
render_example ();
});
2022-01-27 17:02:24 +01:00
2019-01-30 16:18:44 +01:00
$ ( " #text-value " ) . keyup ( check_regex );
2022-01-27 17:02:24 +01:00
2019-01-30 16:18:44 +01:00
$ ( '#text-time_from, #text-time_to' ) . timepicker ({
showSecond : true ,
timeFormat : '<?php echo TIME_FORMAT_JS; ?>' ,
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 '); ?>' ,
2022-01-27 17:02:24 +01:00
closeText : '<?php echo __(' Close '); ?>' }
);
2019-01-30 16:18:44 +01:00
$ ( " #threshold " ) . change ( function () {
if ( this . value == - 1 ) {
$ ( " #text-other_threshold " ) . val ( " " );
$ ( " #template-threshold-other_label " ) . show ();
$ ( " #template-threshold-other_input " ) . show ();
}
else {
$ ( " #template-threshold-other_label " ) . hide ();
$ ( " #template-threshold-other_input " ) . hide ();
}
});
2021-12-17 13:38:53 +01:00
2022-02-07 13:07:48 +01:00
var is_management_allowed = parseInt ( '<?php echo (int) $is_management_allowed; ?>' );
2022-01-28 14:06:31 +01:00
var eventsBBDD = $ ( " #hidden-schedule " ) . val ();
2022-02-01 16:50:53 +01:00
if ( eventsBBDD === '' ) {
eventsBBDD = '<?php echo json_encode($default_events_calendar); ?>' ;
}
2022-01-28 14:06:31 +01:00
var events = loadEventBBDD ( eventsBBDD );
var calendarEl = document . getElementById ( 'calendar_map' );
2022-02-07 13:07:48 +01:00
var options = {
contentHeight : " auto " ,
headerToolbar : {
left : " " ,
center : " " ,
right : is_management_allowed === 0 ? '' : " timeGridWeek,dayGridWeek "
},
buttonText : {
dayGridWeek : '<?php echo __(' Simple '); ?>' ,
timeGridWeek : '<?php echo __(' Detailed '); ?>'
},
dayHeaderFormat : { weekday : " short " },
initialView : " dayGridWeek " ,
navLinks : false ,
selectable : true ,
selectMirror : true ,
slotDuration : " 01:00:00 " ,
slotLabelInterval : " 02:00:00 " ,
snapDuration : " 01:00:00 " ,
slotMinTime : " 00:00:00 " ,
slotMaxTime : " 24:00:00 " ,
scrollTime : " 01:00:00 " ,
locale : " en-GB " ,
firstDay : 1 ,
eventTimeFormat : {
hour : " numeric " ,
minute : " 2-digit " ,
hour12 : false
},
eventColor : " #82b92e " ,
editable : is_management_allowed === 0 ? false : true ,
dayMaxEvents : 3 ,
dayPopoverFormat : { weekday : " long " },
defaultAllDay : false ,
displayEventTime : true ,
displayEventEnd : true ,
selectOverlap : false ,
eventOverlap : false ,
allDaySlot : true ,
droppable : false ,
select : is_management_allowed === 0 ? false : select_alert_template ,
selectAllow : is_management_allowed === 0 ? false : selectAllow_alert_template ,
eventAllow : is_management_allowed === 0 ? false : eventAllow_alert_template ,
eventDrop : is_management_allowed === 0 ? false : eventDrop_alert_template ,
eventDragStop : is_management_allowed === 0 ? false : eventDragStop_alert_template ,
eventResize : is_management_allowed === 0 ? false : eventResize_alert_template ,
eventMouseEnter : is_management_allowed === 0 ? false : eventMouseEnter_alert_template ,
eventMouseLeave : is_management_allowed === 0 ? false : eventMouseLeave_alert_template ,
eventClick : is_management_allowed === 0 ? false : eventClick_alert_template ,
};
2022-01-27 17:02:24 +01:00
var settings = {
timeFormat : '<?php echo TIME_FORMAT_JS; ?>' ,
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 '); ?>' ,
2022-01-31 13:45:44 +01:00
url : '<?php echo ui_get_full_url(' ajax . php ', false, false, false); ?>' ,
removeText : '<?php echo __(' Remove '); ?>' ,
userLanguage : '<?php echo get_user_language(); ?>' ,
loadingText : '<?php echo __(' Loading , this operation might take several minutes ... '); ?>' ,
tooltipText : '<?php echo __(' Drag out to remove '); ?>' ,
2022-02-02 13:03:52 +01:00
alert : '<?php echo __(' Alert '); ?>'
2022-01-27 17:02:24 +01:00
}
2021-12-17 13:38:53 +01:00
2022-02-07 13:07:48 +01:00
var calendar = fullCalendarPandora ( calendarEl , options , settings , events );
2021-12-17 13:38:53 +01:00
calendar . render ();
2019-01-30 16:18:44 +01:00
< ? php
} else if ( $step == 3 ) {
?>
$ ( " #recovery_notify " ) . change ( function () {
var max_fields = parseInt ( '<?php echo $config[' max_macro_fields ']; ?>' );
if ( this . value == 1 ) {
$ ( " #template-label_fields-2 " ) . show ();
for ( i = 1 ; i <= max_fields ; i ++ ) {
$ ( " #template-field " + i + " -2 " ) . show ();
}
//$("#template-label_fields-2, #template-field1-2, #template-field2-2, #template-field3-2, #template-field4-2, #template-field5-2, #template-field6-2, #template-field7-2, #template-field8-2, #template-field9-2, #template-field10-2").show ();
}
else {
$ ( " #template-label_fields-2 " ) . hide ();
for ( i = 1 ; i <= max_fields ; i ++ ) {
$ ( " #template-field " + i + " -2 " ) . hide ();
}
//$("#template-label_fields-2, #template-field1-2, #template-field2-2, #template-field3-2, #template-field4-2, #template-field5-2, #template-field6-2, #template-field7-2, #template-field8-2, #template-field9-2, #template-field10-2").hide ();
}
});
2019-11-26 13:19:28 +01:00
var added_config = {
" selector " : 'textarea.tiny-mce-editor' ,
" plugins " : " preview, print, table, searchreplace, nonbreaking, xhtmlxtras, noneditable " ,
" theme_advanced_buttons1 " : " bold,italic,underline,|,cut,copy,paste,|,justifyleft,justifycenter,justifyright,|,forecolor,backcolor,|,formatselect,fontselect,fontsizeselect " ,
" theme_advanced_buttons2 " : " search,replace,|,bullist,numlist,|,undo,redo,|,link,unlink,image,|,cleanup,code,preview " ,
" force_p_newlines " : false ,
" forced_root_block " : '' ,
" inline_styles " : true ,
" valid_children " : " +body[style] " ,
}
defineTinyMCE ( added_config );
2019-01-30 16:18:44 +01:00
< ? php
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
}
?>
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
})
2009-02-12 22:04:02 +01:00
/* ]]> */
2013-06-19 Mario Pulido <mario.pulido@artica.es>
*godmode/alerts/alert_list.php,
godmode/alerts/configure_alert_template.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php,
godmode/alerts/alert_commands.php,
include/help/en/help_event_alert.php,
include/help/en/help_alerts_config.php,
include/help/es/help_event_alert.php,
include/help/es/help_alerts_config.php,
include/help/ja/help_event_alert.php,
images/help/alert01.png,
images/help/alert02.png,
images/help/alert03.png,
images/help/alert04.png,
images/help/alert05.png,
images/help/alert06.png,
images/help/alert07.png,
images/help/alert08.png,
images/help/alert09.png,
images/help/event01.png,
images/help/event02.png,
images/help/event03.png,
images/help/event04.png,
images/help/alert10.png,
images/help/alert11.png,
images/help/alert12.png,
images/help/alert13.png,
images/help/alert14.png,
images/help/alert15.png,
images/help/alert16.png: Added new helps
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8353 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-06-19 18:28:30 +02:00
</ script >