2008-12-10 21:15:13 +01:00
|
|
|
<?php
|
2009-06-08 20:26:14 +02:00
|
|
|
|
|
|
|
// Pandora FMS - http://pandorafms.com
|
|
|
|
// ==================================================
|
|
|
|
// Copyright (c) 2005-2009 Artica Soluciones Tecnologicas
|
|
|
|
// Please see http://pandorafms.org for full contribution list
|
2008-12-10 21:15:13 +01:00
|
|
|
|
|
|
|
// This program is free software; you can redistribute it and/or
|
2009-06-08 20:26:14 +02:00
|
|
|
// modify it under the terms of the GNU Lesser General Public License
|
|
|
|
// as published by the Free Software Foundation; version 2
|
|
|
|
|
2008-12-10 21:15:13 +01:00
|
|
|
// 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-08-24 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_menu.php, include/functions_html.php,
include/functions_events.php, include/functions_messages.php,
include/functions_modules.php, include/functions_exportserver.php,
include/functions_reporting.php, include/functions_filemanager.php,
include/pchart_graph.php, include/pandora_graph.php, include/auth/dev.php,
include/auth/ldap.php, include/auth/mysql.php, include/config.inc.php,
include/functions_networkmap.php, include/functions_servers.php,
include/FusionCharts/FusionCharts_Gen.php,
include/FusionCharts/FusionCharts.php,
include/functions_network_profiles.php, include/gettext.php,
include/functions_network_components.php, include/functions_visual_map.php,
include/fgraph2.php, include/Image/image_functions.php,
include/functions_config.php, include/help/en/help_plugin_parameters.php,
include/help/en/help_snmpcommunity.php, include/help/en/help_wmiquery.php,
include/help/en/help_postprocess.php,
include/help/en/help_prediction_source_module.php,
include/help/en/help_date_format.php, include/help/en/help_recontask.php,
include/help/en/help_alert-matches.php, include/help/en/help_tcp_send.php,
include/help/en/help_wmifield.php, include/help/en/help_duplicateconfig.php,
include/help/en/help_agent_status.php,
include/help/en/help_manage_alerts.php, include/help/en/help_wmikey.php,
include/help/en/help_alert_type.php,
include/help/en/help_network_component.php,
include/help/en/help_time_stamp-comparation.php,
include/help/en/help_eventview.php, include/help/en/help_timesource.php,
include/help/en/help_alert_validation.php,
include/help/en/help_map_builder.php,
include/help/en/help_alert_recovery.php,
include/help/en/help_module_type.php,
include/help/en/help_planned_downtime.php,
include/help/en/help_serverlag.php, include/help/en/help_alerts.php,
include/help/en/help_snmpwalk.php,
include/help/en/help_module_definition.php,
include/help/en/help_plugin_definition.php,
include/help/en/help_wminamespace.php, include/help/en/help_snmpoid.php
include/help/en/help_manageconfig.php,
include/help/es/help_alert_validation.php,
include/help/es/help_plugin_parameters.php,
include/help/es/help_snmpcommunity.php, include/help/es/help_wmiquery.php,
include/help/es/help_map_builder.php, include/help/es/help_postprocess.php,
include/help/es/help_date_format.php,
include/help/es/help_alert_recovery.php,
include/help/es/help_prediction_source_module.php,
include/help/es/help_module_type.php,
include/help/es/help_planned_downtime.php,
include/help/es/help_alert-matches.php, include/help/es/help_recontask.php,
include/help/es/help_alerts.php, include/help/es/help_serverlag.php,
include/help/es/help_snmpwalk.php,
include/help/es/help_module_definition.php,
include/help/es/help_tcp_send.php, include/help/es/help_duplicateconfig.php,
include/help/es/help_wmifield.php, include/help/es/help_manage_alerts.php,
include/help/es/help_wmikey.php, include/help/es/help_plugin_definition.php,
include/help/es/help_alert_type.php, include/help/es/help_snmpoid.php,
include/help/es/help_wminamespace.php,
include/help/es/help_network_component.php,
include/help/es/help_time_stamp-comparation.php,
include/help/es/help_manageconfig.php, include/help/es/help_timesource.php,
include/config_process.php, include/functions_ui.php, include/htmlawed.php,
include/functions_custom_graphs.php, include/fgraph.php,
include/functions_incidents.php, include/functions.php,
include/functions_agents.php, include/functions_db.php,
include/functions_themes.php, include/streams.php,
include/functions_fsgraph.php, include/functions_alerts.php,
include/functions_reports.php, include/functions_extensions.php,
include/functions_ui_renders.php: change comments blocks for delete the
warnings to construct phpDoc Files, give a struct and order in the
phpDoc files.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1881 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-08-25 19:39:28 +02:00
|
|
|
/**
|
|
|
|
* @package Include
|
2009-08-24 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_menu.php, include/functions_html.php,
include/functions_events.php, include/functions_messages.php,
include/functions_modules.php, include/functions_exportserver.php,
include/functions_reporting.php, include/functions_filemanager.php,
include/pchart_graph.php, include/pandora_graph.php, include/auth/ldap.php,
include/auth/mysql.php, include/config.inc.php,
include/functions_networkmap.php, include/functions_servers.php,
include/functions_network_profiles.php, include/gettext.php,
include/functions_network_components.php, include/functions_visual_map.php,
include/fgraph2.php, include/Image/image_functions.php,
include/functions_config.php, include/config_process.php,
include/functions_ui.php, include/htmlawed.php,
include/functions_custom_graphs.php, include/fgraph.php,
include/functions_incidents.php, include/functions.php,
include/functions_agents.php, include/functions_db.php,
include/functions_themes.php, include/streams.php,
include/functions_fsgraph.php, include/functions_alerts.php,
include/functions_reports.php, include/functions_extensions.php,
include/functions_ui_renders.php: change or add the subpackage in phpdoc
comment blocks for to organize more the result phpdoc files. Start to
document undocument functions.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1882 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-08-26 17:37:47 +02:00
|
|
|
* @subpackage Incidents
|
2009-08-24 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_menu.php, include/functions_html.php,
include/functions_events.php, include/functions_messages.php,
include/functions_modules.php, include/functions_exportserver.php,
include/functions_reporting.php, include/functions_filemanager.php,
include/pchart_graph.php, include/pandora_graph.php, include/auth/dev.php,
include/auth/ldap.php, include/auth/mysql.php, include/config.inc.php,
include/functions_networkmap.php, include/functions_servers.php,
include/FusionCharts/FusionCharts_Gen.php,
include/FusionCharts/FusionCharts.php,
include/functions_network_profiles.php, include/gettext.php,
include/functions_network_components.php, include/functions_visual_map.php,
include/fgraph2.php, include/Image/image_functions.php,
include/functions_config.php, include/help/en/help_plugin_parameters.php,
include/help/en/help_snmpcommunity.php, include/help/en/help_wmiquery.php,
include/help/en/help_postprocess.php,
include/help/en/help_prediction_source_module.php,
include/help/en/help_date_format.php, include/help/en/help_recontask.php,
include/help/en/help_alert-matches.php, include/help/en/help_tcp_send.php,
include/help/en/help_wmifield.php, include/help/en/help_duplicateconfig.php,
include/help/en/help_agent_status.php,
include/help/en/help_manage_alerts.php, include/help/en/help_wmikey.php,
include/help/en/help_alert_type.php,
include/help/en/help_network_component.php,
include/help/en/help_time_stamp-comparation.php,
include/help/en/help_eventview.php, include/help/en/help_timesource.php,
include/help/en/help_alert_validation.php,
include/help/en/help_map_builder.php,
include/help/en/help_alert_recovery.php,
include/help/en/help_module_type.php,
include/help/en/help_planned_downtime.php,
include/help/en/help_serverlag.php, include/help/en/help_alerts.php,
include/help/en/help_snmpwalk.php,
include/help/en/help_module_definition.php,
include/help/en/help_plugin_definition.php,
include/help/en/help_wminamespace.php, include/help/en/help_snmpoid.php
include/help/en/help_manageconfig.php,
include/help/es/help_alert_validation.php,
include/help/es/help_plugin_parameters.php,
include/help/es/help_snmpcommunity.php, include/help/es/help_wmiquery.php,
include/help/es/help_map_builder.php, include/help/es/help_postprocess.php,
include/help/es/help_date_format.php,
include/help/es/help_alert_recovery.php,
include/help/es/help_prediction_source_module.php,
include/help/es/help_module_type.php,
include/help/es/help_planned_downtime.php,
include/help/es/help_alert-matches.php, include/help/es/help_recontask.php,
include/help/es/help_alerts.php, include/help/es/help_serverlag.php,
include/help/es/help_snmpwalk.php,
include/help/es/help_module_definition.php,
include/help/es/help_tcp_send.php, include/help/es/help_duplicateconfig.php,
include/help/es/help_wmifield.php, include/help/es/help_manage_alerts.php,
include/help/es/help_wmikey.php, include/help/es/help_plugin_definition.php,
include/help/es/help_alert_type.php, include/help/es/help_snmpoid.php,
include/help/es/help_wminamespace.php,
include/help/es/help_network_component.php,
include/help/es/help_time_stamp-comparation.php,
include/help/es/help_manageconfig.php, include/help/es/help_timesource.php,
include/config_process.php, include/functions_ui.php, include/htmlawed.php,
include/functions_custom_graphs.php, include/fgraph.php,
include/functions_incidents.php, include/functions.php,
include/functions_agents.php, include/functions_db.php,
include/functions_themes.php, include/streams.php,
include/functions_fsgraph.php, include/functions_alerts.php,
include/functions_reports.php, include/functions_extensions.php,
include/functions_ui_renders.php: change comments blocks for delete the
warnings to construct phpDoc Files, give a struct and order in the
phpDoc files.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1881 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-08-25 19:39:28 +02:00
|
|
|
*/
|
|
|
|
|
2008-12-10 21:15:13 +01:00
|
|
|
/**
|
|
|
|
* Gets all the possible priorities for incidents in an array
|
|
|
|
*
|
2009-01-08 16:52:13 +01:00
|
|
|
* @return array The several priorities with their values
|
2008-12-10 21:15:13 +01:00
|
|
|
*/
|
|
|
|
function get_incidents_priorities () {
|
|
|
|
$fields = array();
|
|
|
|
$fields[0] = __('Informative');
|
|
|
|
$fields[1] = __('Low');
|
|
|
|
$fields[2] = __('Medium');
|
|
|
|
$fields[3] = __('Serious');
|
|
|
|
$fields[4] = __('Very serious');
|
|
|
|
$fields[10] = __('Maintenance');
|
|
|
|
|
|
|
|
return $fields;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Prints the image tag for passed status
|
|
|
|
*
|
2009-01-08 16:52:13 +01:00
|
|
|
* @param int $id_status Which status to return the image to
|
2008-12-10 21:15:13 +01:00
|
|
|
*
|
2009-01-08 16:52:13 +01:00
|
|
|
* @return string The string with the image tag
|
2008-12-10 21:15:13 +01:00
|
|
|
*/
|
|
|
|
function print_incidents_priority_img ($id_priority, $return = false) {
|
|
|
|
switch ($id_priority) {
|
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
|
|
|
case 0:
|
2011-03-17 19:02:44 +01:00
|
|
|
$img = print_image ("images/dot_green.png", true, array('title' => __('Informative'))).print_image ("images/dot_green.png", true, array('title' => __('Informative'))).print_image ("images/dot_yellow.png", true, array('title' => __('Informative')));
|
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
|
|
|
break;
|
|
|
|
case 1:
|
2011-03-17 19:02:44 +01:00
|
|
|
$img = print_image ("images/dot_green.png", true, array('title' => __('Low'))).print_image ("images/dot_yellow.png", true, array('title' => __('Low'))).print_image ("images/dot_yellow.png", true, array('title' => __('Low')));
|
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
|
|
|
break;
|
|
|
|
case 2:
|
2011-03-17 19:02:44 +01:00
|
|
|
$img = print_image ("images/dot_yellow.png", true, array('title' => __('Medium'))).print_image ("images/dot_yellow.png", true, array('title' => __('Medium'))).print_image ("images/dot_red.png", true, array('title' => __('Medium')));
|
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
|
|
|
break;
|
|
|
|
case 3:
|
2011-03-17 19:02:44 +01:00
|
|
|
$img = print_image ("images/dot_yellow.png", true, array('title' => __('Serious'))).print_image ("images/dot_red.png", true, array('title' => __('Serious'))).print_image ("images/dot_red.png", true, array('title' => __('Serious')));
|
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
|
|
|
break;
|
|
|
|
case 4:
|
2011-03-17 19:02:44 +01:00
|
|
|
$img = print_image ("images/dot_red.png", true, array('title' => __('Very serious'))).print_image ("images/dot_red.png", true, array('title' => __('Very serious'))).print_image ("images/dot_red.png", true, array('title' => __('Very serious')));
|
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
|
|
|
break;
|
|
|
|
case 10:
|
2011-03-17 19:02:44 +01:00
|
|
|
$img = print_image ("images/dot_green.png", true, array('title' => __('Maintenance'))).print_image ("images/dot_green.png", true, array('title' => __('Maintenance'))).print_image ("images/dot_green.png", true, array('title' => __('Maintenance')));
|
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
|
|
|
break;
|
2008-12-10 21:15:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if ($return === false) {
|
|
|
|
echo $img;
|
|
|
|
}
|
|
|
|
return $img;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets all the possible status for incidents in an array
|
|
|
|
*
|
2009-01-08 16:52:13 +01:00
|
|
|
* @return array The several status with their values
|
2008-12-10 21:15:13 +01:00
|
|
|
*/
|
|
|
|
function get_incidents_status () {
|
|
|
|
$fields = array ();
|
|
|
|
$fields[0] = __('Active incidents');
|
|
|
|
$fields[1] = __('Active incidents, with comments');
|
|
|
|
$fields[2] = __('Rejected incidents');
|
|
|
|
$fields[3] = __('Expired incidents');
|
|
|
|
$fields[13] = __('Closed incidents');
|
|
|
|
|
|
|
|
return $fields;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Prints the image tag for passed status
|
|
|
|
*
|
2009-01-08 16:52:13 +01:00
|
|
|
* @param int $id_status: Which status to return the image to
|
2008-12-10 21:15:13 +01:00
|
|
|
*
|
2009-01-08 16:52:13 +01:00
|
|
|
* @return string The string with the image tag
|
2008-12-10 21:15:13 +01:00
|
|
|
*/
|
|
|
|
function print_incidents_status_img ($id_status, $return = false) {
|
|
|
|
switch ($id_status) {
|
|
|
|
case 0:
|
2011-03-17 19:02:44 +01:00
|
|
|
$img = print_image ("images/dot_red.png", true, array('title' => __('Active incidents')));
|
2008-12-10 21:15:13 +01:00
|
|
|
break;
|
|
|
|
case 1:
|
2011-03-17 19:02:44 +01:00
|
|
|
$img = print_image ("images/dot_yellow.png", true, array('title' => __('Active incidents, with comments')));
|
2008-12-10 21:15:13 +01:00
|
|
|
break;
|
|
|
|
case 2:
|
2011-03-17 19:02:44 +01:00
|
|
|
$img = print_image ("images/dot_blue.png", true, array('title' => __('Rejected incidents')));
|
2008-12-10 21:15:13 +01:00
|
|
|
break;
|
|
|
|
case 3:
|
2011-03-17 19:02:44 +01:00
|
|
|
$img = print_image ("images/dot_green.png", true, array('title' => __('Expired incidents')));
|
2008-12-10 21:15:13 +01:00
|
|
|
break;
|
|
|
|
case 13:
|
2011-03-17 19:02:44 +01:00
|
|
|
$img = print_image ("images/dot_white.png", true, array('title' => __('Closed incidents')));
|
2008-12-10 21:15:13 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($return === false) {
|
|
|
|
echo $img;
|
|
|
|
}
|
|
|
|
return $img;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Updates the last user (either by adding an attachment, note or the incident itself)
|
|
|
|
* Named after the UNIX touch utility
|
|
|
|
*
|
2009-01-08 16:52:13 +01:00
|
|
|
* @param int $id_incident: A single incident or an array of incidents
|
2008-12-10 21:15:13 +01:00
|
|
|
*
|
2009-01-08 16:52:13 +01:00
|
|
|
* @return bool True if it was done, false if it wasn't
|
2008-12-10 21:15:13 +01:00
|
|
|
*/
|
|
|
|
function process_incidents_touch ($id_incident) {
|
|
|
|
global $config;
|
|
|
|
|
|
|
|
$id_incident = (array) safe_int ($id_incident, 1); //Make sure we have all positive int's
|
|
|
|
if (empty ($id_incident)) {
|
|
|
|
return false;
|
|
|
|
}
|
2011-03-08 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_events.php, include/functions_messages.php,
include/functions_incidents.php, include/functions_db.php,
operation/incidents/incident.php, operation/agentes/ver_agente.php,
operation/agentes/tactical.php, operation/servers/view_server_detail.php,
operation/snmpconsole/snmp_view.php, godmode/groups/modu_group_list.php,
godmode/agentes/configurar_agente.php, godmode/servers/manage_recontask.php,
godmode/servers/modificar_server.php, godmode/snmpconsole/snmp_filters.php,
godmode/setup/news.php, godmode/modules/manage_network_templates_form.php:
change the source code for to use process_sql_update instead of the SQL.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4066 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-03-08 12:14:03 +01:00
|
|
|
|
2009-10-08 16:25:37 +02:00
|
|
|
if (empty ($id_incident)) {
|
|
|
|
return false;
|
|
|
|
}
|
2011-03-08 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_events.php, include/functions_messages.php,
include/functions_incidents.php, include/functions_db.php,
operation/incidents/incident.php, operation/agentes/ver_agente.php,
operation/agentes/tactical.php, operation/servers/view_server_detail.php,
operation/snmpconsole/snmp_view.php, godmode/groups/modu_group_list.php,
godmode/agentes/configurar_agente.php, godmode/servers/manage_recontask.php,
godmode/servers/modificar_server.php, godmode/snmpconsole/snmp_filters.php,
godmode/setup/news.php, godmode/modules/manage_network_templates_form.php:
change the source code for to use process_sql_update instead of the SQL.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4066 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-03-08 12:14:03 +01:00
|
|
|
|
|
|
|
return process_sql_update('tincidencia', array('id_lastupdate' => $config["id_user"]), array('id_incidencia' => $id_incident));
|
2008-12-10 21:15:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Updates the owner (named after the UNIX utility chown)
|
|
|
|
*
|
2009-01-08 16:52:13 +01:00
|
|
|
* @param int $id_incident: A single incident or an array of incidents
|
2008-12-10 21:15:13 +01:00
|
|
|
*
|
2009-01-08 16:52:13 +01:00
|
|
|
* @return bool True if it was done, false if it wasn't
|
2008-12-10 21:15:13 +01:00
|
|
|
*/
|
|
|
|
function process_incidents_chown ($id_incident, $owner = false) {
|
|
|
|
if ($owner === false) {
|
|
|
|
global $config;
|
|
|
|
$owner = $config["id_user"];
|
|
|
|
}
|
|
|
|
|
|
|
|
$id_incident = (array) safe_int ($id_incident, 1); //Make sure we have all positive int's
|
|
|
|
if (empty ($id_incident)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
$id_incident = implode (",", $id_incident);
|
|
|
|
$sql = sprintf ("UPDATE tincidencia SET id_usuario = '%s' WHERE id_incidencia IN (%s)", $owner, $id_incident);
|
|
|
|
return process_sql ($sql);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the author of an incident.
|
|
|
|
*
|
2009-01-08 16:52:13 +01:00
|
|
|
* @param int $id_incident Incident id.
|
2008-12-10 21:15:13 +01:00
|
|
|
*
|
2009-01-08 16:52:13 +01:00
|
|
|
* @return string The author of an incident
|
2008-12-10 21:15:13 +01:00
|
|
|
*/
|
|
|
|
function get_incidents_author ($id_incident) {
|
|
|
|
if ($id_incident < 1) {
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
return (string) get_db_value ('id_creator', 'tincidencia', 'id_incidencia', (int) $id_incident);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the owner of an incident.
|
|
|
|
*
|
2009-01-08 16:52:13 +01:00
|
|
|
* @param int $id_incident Incident id.
|
2008-12-10 21:15:13 +01:00
|
|
|
*
|
2009-01-08 16:52:13 +01:00
|
|
|
* @return string The last updater of an incident
|
2008-12-10 21:15:13 +01:00
|
|
|
*/
|
|
|
|
function get_incidents_owner ($id_incident) {
|
|
|
|
if ($id_incident < 1) {
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
return (string) get_db_value ('id_usuario', 'tincidencia', 'id_incidencia', (int) $id_incident);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the last updater of an incident.
|
|
|
|
*
|
2009-01-08 16:52:13 +01:00
|
|
|
* @param int $id_incident Incident id.
|
2008-12-10 21:15:13 +01:00
|
|
|
*
|
2009-01-08 16:52:13 +01:00
|
|
|
* @return string The last updater of an incident
|
2008-12-10 21:15:13 +01:00
|
|
|
*/
|
|
|
|
function get_incidents_lastupdate ($id_incident) {
|
|
|
|
if ($id_incident < 1) {
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
return (string) get_db_value ('id_lastupdate', 'tincidencia', 'id_incidencia', (int) $id_incident);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the group id of an incident.
|
|
|
|
*
|
2009-01-08 16:52:13 +01:00
|
|
|
* @param int $id_incident Incident id.
|
2008-12-10 21:15:13 +01:00
|
|
|
*
|
2009-01-08 16:52:13 +01:00
|
|
|
* @return int The group id of an incident
|
2008-12-10 21:15:13 +01:00
|
|
|
*/
|
|
|
|
function get_incidents_group ($id_incident) {
|
|
|
|
if ($id_incident < 1) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
return (int) get_db_value ('id_grupo', 'tincidencia', 'id_incidencia', (int) $id_incident);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Delete an incident out the database.
|
|
|
|
*
|
2009-01-08 16:52:13 +01:00
|
|
|
* @param mixed $id_inc An int or an array of ints to be deleted
|
2008-12-10 21:15:13 +01:00
|
|
|
*
|
2009-01-08 16:52:13 +01:00
|
|
|
* @return bool True if incident was succesfully deleted, false if not
|
2008-12-10 21:15:13 +01:00
|
|
|
*/
|
|
|
|
function delete_incidents ($id_incident) {
|
|
|
|
global $config;
|
|
|
|
$ids = (array) safe_int ($id_incident, 1); //Make the input an array
|
|
|
|
$notes = array ();
|
|
|
|
$attachments = array ();
|
|
|
|
$errors = 0;
|
|
|
|
|
|
|
|
//Start transaction
|
2009-05-04 Esteban Sánchez <estebans@artica.es>
* include/functions_agents.php: Added create_agent(),
* include/functions_db.php: Renamed dame_agente_id() to get_agent_id ().
Added process_sql_begin(), process_sql_rollback() and process_sql_commit()
and use MySQL functions directly because the Pandora cache was avoiding
more than one execution.
* include/functions_incidents.php, include/functions_messages.php,
godmode/agentes/massive_delete_agents.php,
godmode/agentes/massive_delete_alerts.php,
godmode/agentes/massive_delete_modules.php,
godmode/agentes/massive_edit_modules.php,
godmode/db/db_purge.php,
include/functions_events.php: Use new transaction functions.
* include/functions_modules.php: Sanitize some values. Added
create_agent_module_from_network_component(), create_agent_module()
and get_network_component().
* godmode/agentes/configurar_agente.php: Use get_agent_id() and transaction
functions.
* reporting/fgraph.php, operation/reporting/reporting_viewer.php: Use
get_agent_id().
* godmode/setup/file_manager.php: Removed unnecesary variable.
* operation/agentes/ver_agente.php: Replaced exit with return on ajax
operation.
* include/config_process.php: Updated build number.
* include/functions_network_profiles.php: Fixed documentation.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1672 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-05-04 12:10:19 +02:00
|
|
|
process_sql_begin ();
|
2008-12-10 21:15:13 +01:00
|
|
|
|
|
|
|
foreach ($ids as $id_inc) {
|
|
|
|
//Delete incident
|
2011-03-08 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_events.php, include/functions_messages.php,
include/auth/mysql.php, include/functions_api.php,
include/functions_incidents.php, include/functions_db.php,
operation/incidents/incident_detail.php,
operation/snmpconsole/snmp_view.php, operation/reporting/graph_viewer.php,
godmode/groups/group_list.php, godmode/agentes/module_manager.php,
godmode/agentes/configurar_agente.php, godmode/agentes/planned_downtime.php,
godmode/servers/recon_script.php, godmode/servers/manage_recontask.php,
godmode/servers/modificar_server.php, godmode/snmpconsole/snmp_alert.php,
godmode/snmpconsole/snmp_filters.php,
godmode/modules/manage_network_templates_form.php: change the source code
for to use process_sql_delete instead of the SQL.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4070 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-03-08 17:12:58 +01:00
|
|
|
$ret = process_sql_delete('tincidencia', array('id_incidencia' => $id_inc));
|
2008-12-10 21:15:13 +01:00
|
|
|
if ($ret === false) {
|
|
|
|
$errors++;
|
|
|
|
}
|
|
|
|
//We only need the ID's
|
|
|
|
$notes = array_merge ($notes, array_keys (get_incidents_notes ($id_inc)));
|
|
|
|
$attachments = array_merge ($attachments, array_keys (get_incidents_attach ($id_inc)));
|
|
|
|
|
2010-10-27 Miguel de Dios <miguel.dedios@artica.es>
* godmode/admin_access_logs.php: added hooks to enterprise code, and added
new filter with more options.
* include/functions_db.php: erase the deprecated function "audit_db", and
added in function "pandora_audit" two new parameters $user_id, $ip for
pass this values when it are differents to the default values. Finally
replaced the depecrated "audit_db" for "pandora_audit".
* include/functions_events.php, include/functions_filemanager.php,
include/ajax/reporting.ajax.php,
include/ajax/visual_console_builder.ajax.php,
include/ajax/alert_list.ajax.php, include/help/es/modu_group_list.php,
include/functions_incidents.php, index.php, extensions/agents_modules.php,
extensions/insert_data.php, extensions/system_info.php,
extensions/dbmanager.php, extensions/update_manager/settings.php,
extensions/pandora_logs.php, extensions/plugin_registration.php,
operation/incidents/incident.php, operation/incidents/incident_detail.php,
operation/incidents/incident_statistics.php, operation/extensions.php,
operation/visual_console/render_view.php,
operation/agentes/status_monitor.php, operation/agentes/export_csv.php,
operation/agentes/datos_agente.php, operation/agentes/alerts_status.php,
operation/agentes/estado_generalagente.php,
operation/agentes/custom_fields.php, operation/agentes/estado_agente.php,
operation/agentes/networkmap.topology.php,
operation/agentes/networkmap.groups.php, operation/agentes/sla_view.php,
operation/agentes/gis_view.php, operation/agentes/estado_monitores.php,
operation/agentes/ver_agente.php, operation/agentes/graphs.php,
operation/agentes/agent_fields.php, operation/agentes/tactical.php,
operation/agentes/group_view.php, operation/agentes/networkmap.php,
operation/servers/view_server.php,operation/servers/view_server_detail.php,
operation/snmpconsole/snmp_view.php, operation/users/user_edit.php,
operation/gis_maps/render_view.php, operation/events/event_statistics.php,
operation/events/sound_events.php, operation/events/events_validate.php,
operation/events/events_list.php, operation/events/events_marquee.php,
operation/events/events.php, operation/reporting/reporting_xml.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
mobile/operation/agents/view_agents.php, mobile/index.php,
godmode/groups/modu_group_list.php, godmode/groups/configure_group.php,
godmode/groups/configure_modu_group.php, godmode/groups/group_list.php,
godmode/extensions.php, godmode/db/db_main.php, godmode/db/db_audit.php,
godmode/db/db_sanity.php, godmode/db/db_refine.php, godmode/db/db_info.php,
godmode/db/db_event.php, godmode/db/db_purge.php,
godmode/agentes/fields_manager.php, godmode/agentes/module_manager.php,
godmode/agentes/modificar_agente.php, godmode/agentes/configurar_agente.php,
godmode/agentes/configure_field.php, godmode/agentes/planned_downtime.php,
godmode/agentes/manage_config_remote.php, godmode/agentes/agent_manager.php,
godmode/servers/manage_export.php, godmode/servers/recon_script.php,
godmode/servers/manage_export_form.php, godmode/servers/plugin.php,
godmode/servers/manage_recontask.php, godmode/servers/modificar_server.php,
godmode/servers/manage_recontask_form.php,
godmode/alerts/alert_list.list.php,
godmode/alerts/configure_alert_compound.php,
godmode/alerts/alert_compounds.php, 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_list.builder.php,
godmode/alerts/alert_commands.php, godmode/snmpconsole/snmp_alert.php,
godmode/snmpconsole/snmp_filters.php, godmode/setup/file_manager.php,
godmode/setup/os.list.php, godmode/setup/news.php,
godmode/setup/gis_step_2.php, godmode/setup/links.php,
godmode/setup/setup.php, godmode/setup/os.php,
godmode/setup/performance.php, godmode/setup/setup_auth.php,
godmode/setup/gis.php, godmode/setup/os.builder.php,
godmode/setup/setup_visuals.php, godmode/users/user_list.php,
godmode/users/configure_user.php, godmode/users/configure_profile.php,
godmode/gis_maps/configure_gis_map.php, godmode/gis_maps/index.php,
godmode/massive/massive_add_alerts.php,
godmode/massive/massive_copy_modules.php,
godmode/massive/massive_delete_agents.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_operations.php,
godmode/massive/massive_delete_profiles.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_action_alerts.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_profiles.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_edit_modules.php,
godmode/massive/massive_standby_alerts.php,
godmode/massive/massive_add_action_alerts.php,
godmode/modules/manage_network_components_form.php,
godmode/modules/manage_nc_groups_form.php,
godmode/modules/manage_network_templates.php,
godmode/modules/module_list.php,
godmode/modules/manage_network_components_form_common.php,
godmode/modules/manage_network_components_form_network.php,
godmode/modules/manage_network_templates_form.php,
godmode/modules/manage_network_components_form_wmi.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_nc_groups.php,
godmode/reporting/reporting_builder.list_items.php,
godmode/reporting/graph_builder.main.php,
godmode/reporting/visual_console_builder.wizard.php,
godmode/reporting/visual_console_builder.php,
godmode/reporting/reporting_builder.preview.php,
godmode/reporting/reporting_builder.main.php,
godmode/reporting/visual_console_builder.data.php,
godmode/reporting/map_builder_wizard.php,
godmode/reporting/visual_console_builder.elements.php,
godmode/reporting/graph_builder.php,
godmode/reporting/visual_console_builder.preview.php,
godmode/reporting/graph_builder.graph_editor.php,
godmode/reporting/reporting_builder.php,
godmode/reporting/visual_console_builder.editor.php,
godmode/reporting/reporting_builder.item_editor.php,
godmode/reporting/graphs.php, godmode/reporting/graph_builder.preview.php:
Replaced the depecrated "audit_db" for "pandora_audit".
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3467 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-10-27 12:47:07 +02:00
|
|
|
pandora_audit("Incident deleted", $config['id_user']." deleted incident #".$id_inc);
|
2008-12-10 21:15:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//Delete notes
|
|
|
|
$note_err = delete_incidents_note ($notes, false);
|
|
|
|
$attach_err = delete_incidents_attach ($attachments, false);
|
|
|
|
|
|
|
|
if ($note_err === false || $attach_err === false) {
|
|
|
|
$errors++;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($errors > 0) {
|
|
|
|
//This will also rollback the audit log
|
2009-05-04 Esteban Sánchez <estebans@artica.es>
* include/functions_agents.php: Added create_agent(),
* include/functions_db.php: Renamed dame_agente_id() to get_agent_id ().
Added process_sql_begin(), process_sql_rollback() and process_sql_commit()
and use MySQL functions directly because the Pandora cache was avoiding
more than one execution.
* include/functions_incidents.php, include/functions_messages.php,
godmode/agentes/massive_delete_agents.php,
godmode/agentes/massive_delete_alerts.php,
godmode/agentes/massive_delete_modules.php,
godmode/agentes/massive_edit_modules.php,
godmode/db/db_purge.php,
include/functions_events.php: Use new transaction functions.
* include/functions_modules.php: Sanitize some values. Added
create_agent_module_from_network_component(), create_agent_module()
and get_network_component().
* godmode/agentes/configurar_agente.php: Use get_agent_id() and transaction
functions.
* reporting/fgraph.php, operation/reporting/reporting_viewer.php: Use
get_agent_id().
* godmode/setup/file_manager.php: Removed unnecesary variable.
* operation/agentes/ver_agente.php: Replaced exit with return on ajax
operation.
* include/config_process.php: Updated build number.
* include/functions_network_profiles.php: Fixed documentation.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1672 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-05-04 12:10:19 +02:00
|
|
|
process_sql_rollback ();
|
2008-12-10 21:15:13 +01:00
|
|
|
return false;
|
|
|
|
}
|
2009-05-04 Esteban Sánchez <estebans@artica.es>
* include/functions_agents.php: Added create_agent(),
* include/functions_db.php: Renamed dame_agente_id() to get_agent_id ().
Added process_sql_begin(), process_sql_rollback() and process_sql_commit()
and use MySQL functions directly because the Pandora cache was avoiding
more than one execution.
* include/functions_incidents.php, include/functions_messages.php,
godmode/agentes/massive_delete_agents.php,
godmode/agentes/massive_delete_alerts.php,
godmode/agentes/massive_delete_modules.php,
godmode/agentes/massive_edit_modules.php,
godmode/db/db_purge.php,
include/functions_events.php: Use new transaction functions.
* include/functions_modules.php: Sanitize some values. Added
create_agent_module_from_network_component(), create_agent_module()
and get_network_component().
* godmode/agentes/configurar_agente.php: Use get_agent_id() and transaction
functions.
* reporting/fgraph.php, operation/reporting/reporting_viewer.php: Use
get_agent_id().
* godmode/setup/file_manager.php: Removed unnecesary variable.
* operation/agentes/ver_agente.php: Replaced exit with return on ajax
operation.
* include/config_process.php: Updated build number.
* include/functions_network_profiles.php: Fixed documentation.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1672 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-05-04 12:10:19 +02:00
|
|
|
process_sql_commit ();
|
|
|
|
|
|
|
|
return true;
|
2008-12-10 21:15:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Delete notes out the database.
|
|
|
|
*
|
2009-01-08 16:52:13 +01:00
|
|
|
* @param mixed $id_note An int or an array of ints to be deleted
|
|
|
|
* @param bool $transact true if a transaction should be started, false if not
|
2008-12-10 21:15:13 +01:00
|
|
|
*
|
2009-01-08 16:52:13 +01:00
|
|
|
* @return bool True if note was succesfully deleted, false if not
|
2008-12-10 21:15:13 +01:00
|
|
|
*/
|
|
|
|
function delete_incidents_note ($id_note, $transact = true) {
|
|
|
|
$id_note = (array) safe_int ($id_note, 1); //cast as array
|
|
|
|
$errors = 0;
|
|
|
|
|
|
|
|
//Start transaction
|
|
|
|
if ($transact == true){
|
2009-05-04 Esteban Sánchez <estebans@artica.es>
* include/functions_agents.php: Added create_agent(),
* include/functions_db.php: Renamed dame_agente_id() to get_agent_id ().
Added process_sql_begin(), process_sql_rollback() and process_sql_commit()
and use MySQL functions directly because the Pandora cache was avoiding
more than one execution.
* include/functions_incidents.php, include/functions_messages.php,
godmode/agentes/massive_delete_agents.php,
godmode/agentes/massive_delete_alerts.php,
godmode/agentes/massive_delete_modules.php,
godmode/agentes/massive_edit_modules.php,
godmode/db/db_purge.php,
include/functions_events.php: Use new transaction functions.
* include/functions_modules.php: Sanitize some values. Added
create_agent_module_from_network_component(), create_agent_module()
and get_network_component().
* godmode/agentes/configurar_agente.php: Use get_agent_id() and transaction
functions.
* reporting/fgraph.php, operation/reporting/reporting_viewer.php: Use
get_agent_id().
* godmode/setup/file_manager.php: Removed unnecesary variable.
* operation/agentes/ver_agente.php: Replaced exit with return on ajax
operation.
* include/config_process.php: Updated build number.
* include/functions_network_profiles.php: Fixed documentation.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1672 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-05-04 12:10:19 +02:00
|
|
|
process_sql_begin ();
|
|
|
|
process_sql_commit ();
|
2008-12-10 21:15:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//Delete notes
|
|
|
|
foreach ($id_note as $id) {
|
2009-05-04 Esteban Sánchez <estebans@artica.es>
* include/functions_agents.php: Added create_agent(),
* include/functions_db.php: Renamed dame_agente_id() to get_agent_id ().
Added process_sql_begin(), process_sql_rollback() and process_sql_commit()
and use MySQL functions directly because the Pandora cache was avoiding
more than one execution.
* include/functions_incidents.php, include/functions_messages.php,
godmode/agentes/massive_delete_agents.php,
godmode/agentes/massive_delete_alerts.php,
godmode/agentes/massive_delete_modules.php,
godmode/agentes/massive_edit_modules.php,
godmode/db/db_purge.php,
include/functions_events.php: Use new transaction functions.
* include/functions_modules.php: Sanitize some values. Added
create_agent_module_from_network_component(), create_agent_module()
and get_network_component().
* godmode/agentes/configurar_agente.php: Use get_agent_id() and transaction
functions.
* reporting/fgraph.php, operation/reporting/reporting_viewer.php: Use
get_agent_id().
* godmode/setup/file_manager.php: Removed unnecesary variable.
* operation/agentes/ver_agente.php: Replaced exit with return on ajax
operation.
* include/config_process.php: Updated build number.
* include/functions_network_profiles.php: Fixed documentation.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1672 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-05-04 12:10:19 +02:00
|
|
|
$ret = process_sql_delete ('tnota', array ('id_nota' => $id));
|
2008-12-10 21:15:13 +01:00
|
|
|
if ($ret === false) {
|
|
|
|
$errors++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($transact == true && $errors > 0) {
|
2009-05-04 Esteban Sánchez <estebans@artica.es>
* include/functions_agents.php: Added create_agent(),
* include/functions_db.php: Renamed dame_agente_id() to get_agent_id ().
Added process_sql_begin(), process_sql_rollback() and process_sql_commit()
and use MySQL functions directly because the Pandora cache was avoiding
more than one execution.
* include/functions_incidents.php, include/functions_messages.php,
godmode/agentes/massive_delete_agents.php,
godmode/agentes/massive_delete_alerts.php,
godmode/agentes/massive_delete_modules.php,
godmode/agentes/massive_edit_modules.php,
godmode/db/db_purge.php,
include/functions_events.php: Use new transaction functions.
* include/functions_modules.php: Sanitize some values. Added
create_agent_module_from_network_component(), create_agent_module()
and get_network_component().
* godmode/agentes/configurar_agente.php: Use get_agent_id() and transaction
functions.
* reporting/fgraph.php, operation/reporting/reporting_viewer.php: Use
get_agent_id().
* godmode/setup/file_manager.php: Removed unnecesary variable.
* operation/agentes/ver_agente.php: Replaced exit with return on ajax
operation.
* include/config_process.php: Updated build number.
* include/functions_network_profiles.php: Fixed documentation.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1672 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-05-04 12:10:19 +02:00
|
|
|
process_sql_rollback ();
|
2008-12-10 21:15:13 +01:00
|
|
|
return false;
|
|
|
|
} elseif ($transact == true) {
|
2009-05-04 Esteban Sánchez <estebans@artica.es>
* include/functions_agents.php: Added create_agent(),
* include/functions_db.php: Renamed dame_agente_id() to get_agent_id ().
Added process_sql_begin(), process_sql_rollback() and process_sql_commit()
and use MySQL functions directly because the Pandora cache was avoiding
more than one execution.
* include/functions_incidents.php, include/functions_messages.php,
godmode/agentes/massive_delete_agents.php,
godmode/agentes/massive_delete_alerts.php,
godmode/agentes/massive_delete_modules.php,
godmode/agentes/massive_edit_modules.php,
godmode/db/db_purge.php,
include/functions_events.php: Use new transaction functions.
* include/functions_modules.php: Sanitize some values. Added
create_agent_module_from_network_component(), create_agent_module()
and get_network_component().
* godmode/agentes/configurar_agente.php: Use get_agent_id() and transaction
functions.
* reporting/fgraph.php, operation/reporting/reporting_viewer.php: Use
get_agent_id().
* godmode/setup/file_manager.php: Removed unnecesary variable.
* operation/agentes/ver_agente.php: Replaced exit with return on ajax
operation.
* include/config_process.php: Updated build number.
* include/functions_network_profiles.php: Fixed documentation.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1672 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-05-04 12:10:19 +02:00
|
|
|
process_sql_commit ();
|
2008-12-10 21:15:13 +01:00
|
|
|
return true;
|
|
|
|
} elseif ($errors > 0) {
|
|
|
|
return false;
|
|
|
|
} else {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Delete attachments out the database and from the machine.
|
|
|
|
*
|
2009-01-08 16:52:13 +01:00
|
|
|
* @param mixed $id_attach An int or an array of ints to be deleted
|
|
|
|
* @param bool $transact true if a transaction should be started, false if not
|
2008-12-10 21:15:13 +01:00
|
|
|
*
|
2009-01-08 16:52:13 +01:00
|
|
|
* @return bool True if attachment was succesfully deleted, false if not
|
2008-12-10 21:15:13 +01:00
|
|
|
*/
|
|
|
|
function delete_incidents_attach ($id_attach, $transact = true) {
|
|
|
|
global $config;
|
|
|
|
|
|
|
|
$id_attach = (array) safe_int ($id_attach, 1); //cast as array
|
|
|
|
$errors = 0;
|
|
|
|
|
|
|
|
//Start transaction
|
|
|
|
if ($transact == true) {
|
2009-05-04 Esteban Sánchez <estebans@artica.es>
* include/functions_agents.php: Added create_agent(),
* include/functions_db.php: Renamed dame_agente_id() to get_agent_id ().
Added process_sql_begin(), process_sql_rollback() and process_sql_commit()
and use MySQL functions directly because the Pandora cache was avoiding
more than one execution.
* include/functions_incidents.php, include/functions_messages.php,
godmode/agentes/massive_delete_agents.php,
godmode/agentes/massive_delete_alerts.php,
godmode/agentes/massive_delete_modules.php,
godmode/agentes/massive_edit_modules.php,
godmode/db/db_purge.php,
include/functions_events.php: Use new transaction functions.
* include/functions_modules.php: Sanitize some values. Added
create_agent_module_from_network_component(), create_agent_module()
and get_network_component().
* godmode/agentes/configurar_agente.php: Use get_agent_id() and transaction
functions.
* reporting/fgraph.php, operation/reporting/reporting_viewer.php: Use
get_agent_id().
* godmode/setup/file_manager.php: Removed unnecesary variable.
* operation/agentes/ver_agente.php: Replaced exit with return on ajax
operation.
* include/config_process.php: Updated build number.
* include/functions_network_profiles.php: Fixed documentation.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1672 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-05-04 12:10:19 +02:00
|
|
|
process_sql_begin ();
|
2008-12-10 21:15:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//Delete attachment
|
|
|
|
foreach ($id_attach as $id) {
|
|
|
|
$filename = get_db_value ("filename", "tattachment", "id_attachment", $id);
|
2011-03-08 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_events.php, include/functions_messages.php,
include/auth/mysql.php, include/functions_api.php,
include/functions_incidents.php, include/functions_db.php,
operation/incidents/incident_detail.php,
operation/snmpconsole/snmp_view.php, operation/reporting/graph_viewer.php,
godmode/groups/group_list.php, godmode/agentes/module_manager.php,
godmode/agentes/configurar_agente.php, godmode/agentes/planned_downtime.php,
godmode/servers/recon_script.php, godmode/servers/manage_recontask.php,
godmode/servers/modificar_server.php, godmode/snmpconsole/snmp_alert.php,
godmode/snmpconsole/snmp_filters.php,
godmode/modules/manage_network_templates_form.php: change the source code
for to use process_sql_delete instead of the SQL.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4070 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-03-08 17:12:58 +01:00
|
|
|
|
|
|
|
$ret = process_sql_delete('tattachment', array('id_attachment' => $id));
|
2008-12-10 21:15:13 +01:00
|
|
|
if ($ret === false) {
|
|
|
|
$errors++;
|
|
|
|
}
|
|
|
|
unlink ($config["attachment_store"]."/pand".$id."_".$filename);
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($transact == true && $errors > 0) {
|
2009-05-04 Esteban Sánchez <estebans@artica.es>
* include/functions_agents.php: Added create_agent(),
* include/functions_db.php: Renamed dame_agente_id() to get_agent_id ().
Added process_sql_begin(), process_sql_rollback() and process_sql_commit()
and use MySQL functions directly because the Pandora cache was avoiding
more than one execution.
* include/functions_incidents.php, include/functions_messages.php,
godmode/agentes/massive_delete_agents.php,
godmode/agentes/massive_delete_alerts.php,
godmode/agentes/massive_delete_modules.php,
godmode/agentes/massive_edit_modules.php,
godmode/db/db_purge.php,
include/functions_events.php: Use new transaction functions.
* include/functions_modules.php: Sanitize some values. Added
create_agent_module_from_network_component(), create_agent_module()
and get_network_component().
* godmode/agentes/configurar_agente.php: Use get_agent_id() and transaction
functions.
* reporting/fgraph.php, operation/reporting/reporting_viewer.php: Use
get_agent_id().
* godmode/setup/file_manager.php: Removed unnecesary variable.
* operation/agentes/ver_agente.php: Replaced exit with return on ajax
operation.
* include/config_process.php: Updated build number.
* include/functions_network_profiles.php: Fixed documentation.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1672 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-05-04 12:10:19 +02:00
|
|
|
process_sql_rollback ();
|
2008-12-10 21:15:13 +01:00
|
|
|
return false;
|
2011-03-08 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_events.php, include/functions_messages.php,
include/auth/mysql.php, include/functions_api.php,
include/functions_incidents.php, include/functions_db.php,
operation/incidents/incident_detail.php,
operation/snmpconsole/snmp_view.php, operation/reporting/graph_viewer.php,
godmode/groups/group_list.php, godmode/agentes/module_manager.php,
godmode/agentes/configurar_agente.php, godmode/agentes/planned_downtime.php,
godmode/servers/recon_script.php, godmode/servers/manage_recontask.php,
godmode/servers/modificar_server.php, godmode/snmpconsole/snmp_alert.php,
godmode/snmpconsole/snmp_filters.php,
godmode/modules/manage_network_templates_form.php: change the source code
for to use process_sql_delete instead of the SQL.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4070 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-03-08 17:12:58 +01:00
|
|
|
}
|
|
|
|
elseif ($transact == true) {
|
2009-05-04 Esteban Sánchez <estebans@artica.es>
* include/functions_agents.php: Added create_agent(),
* include/functions_db.php: Renamed dame_agente_id() to get_agent_id ().
Added process_sql_begin(), process_sql_rollback() and process_sql_commit()
and use MySQL functions directly because the Pandora cache was avoiding
more than one execution.
* include/functions_incidents.php, include/functions_messages.php,
godmode/agentes/massive_delete_agents.php,
godmode/agentes/massive_delete_alerts.php,
godmode/agentes/massive_delete_modules.php,
godmode/agentes/massive_edit_modules.php,
godmode/db/db_purge.php,
include/functions_events.php: Use new transaction functions.
* include/functions_modules.php: Sanitize some values. Added
create_agent_module_from_network_component(), create_agent_module()
and get_network_component().
* godmode/agentes/configurar_agente.php: Use get_agent_id() and transaction
functions.
* reporting/fgraph.php, operation/reporting/reporting_viewer.php: Use
get_agent_id().
* godmode/setup/file_manager.php: Removed unnecesary variable.
* operation/agentes/ver_agente.php: Replaced exit with return on ajax
operation.
* include/config_process.php: Updated build number.
* include/functions_network_profiles.php: Fixed documentation.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1672 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-05-04 12:10:19 +02:00
|
|
|
process_sql_commit ();
|
2008-12-10 21:15:13 +01:00
|
|
|
return true;
|
2011-03-08 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_events.php, include/functions_messages.php,
include/auth/mysql.php, include/functions_api.php,
include/functions_incidents.php, include/functions_db.php,
operation/incidents/incident_detail.php,
operation/snmpconsole/snmp_view.php, operation/reporting/graph_viewer.php,
godmode/groups/group_list.php, godmode/agentes/module_manager.php,
godmode/agentes/configurar_agente.php, godmode/agentes/planned_downtime.php,
godmode/servers/recon_script.php, godmode/servers/manage_recontask.php,
godmode/servers/modificar_server.php, godmode/snmpconsole/snmp_alert.php,
godmode/snmpconsole/snmp_filters.php,
godmode/modules/manage_network_templates_form.php: change the source code
for to use process_sql_delete instead of the SQL.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4070 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-03-08 17:12:58 +01:00
|
|
|
}
|
|
|
|
elseif ($errors > 0) {
|
2008-12-10 21:15:13 +01:00
|
|
|
return false;
|
2011-03-08 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_events.php, include/functions_messages.php,
include/auth/mysql.php, include/functions_api.php,
include/functions_incidents.php, include/functions_db.php,
operation/incidents/incident_detail.php,
operation/snmpconsole/snmp_view.php, operation/reporting/graph_viewer.php,
godmode/groups/group_list.php, godmode/agentes/module_manager.php,
godmode/agentes/configurar_agente.php, godmode/agentes/planned_downtime.php,
godmode/servers/recon_script.php, godmode/servers/manage_recontask.php,
godmode/servers/modificar_server.php, godmode/snmpconsole/snmp_alert.php,
godmode/snmpconsole/snmp_filters.php,
godmode/modules/manage_network_templates_form.php: change the source code
for to use process_sql_delete instead of the SQL.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4070 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-03-08 17:12:58 +01:00
|
|
|
}
|
|
|
|
else {
|
2008-12-10 21:15:13 +01:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get notes based on the incident id.
|
|
|
|
*
|
2009-01-08 16:52:13 +01:00
|
|
|
* @param int $id_incident An int with the incident id
|
2008-12-10 21:15:13 +01:00
|
|
|
*
|
2009-01-08 16:52:13 +01:00
|
|
|
* @return array An array of all the notes for that incident
|
2008-12-10 21:15:13 +01:00
|
|
|
*/
|
|
|
|
function get_incidents_notes ($id_incident) {
|
|
|
|
$return = get_db_all_rows_field_filter ("tnota", "id_incident", (int) $id_incident);
|
|
|
|
|
|
|
|
if ($return === false) {
|
|
|
|
$return = array ();
|
|
|
|
}
|
|
|
|
|
|
|
|
$notes = array ();
|
|
|
|
foreach ($return as $row) {
|
|
|
|
$notes[$row["id_nota"]] = $row;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $notes;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get attachments based on the incident id.
|
|
|
|
*
|
2009-01-08 16:52:13 +01:00
|
|
|
* @param int $id_incident An int with the incident id
|
2008-12-10 21:15:13 +01:00
|
|
|
*
|
2009-01-08 16:52:13 +01:00
|
|
|
* @return array An array of all the notes for that incident
|
2008-12-10 21:15:13 +01:00
|
|
|
*/
|
|
|
|
function get_incidents_attach ($id_incident) {
|
|
|
|
$return = get_db_all_rows_field_filter ("tattachment", "id_incidencia", (int) $id_incident);
|
|
|
|
|
|
|
|
if ($return === false) {
|
|
|
|
$return = array ();
|
|
|
|
}
|
|
|
|
|
|
|
|
$attach = array ();
|
|
|
|
foreach ($return as $row) {
|
|
|
|
$attach[$row["id_attachment"]] = $row;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $attach;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get user id of a note.
|
|
|
|
*
|
2009-01-08 16:52:13 +01:00
|
|
|
* @param int $id_note Note id.
|
2008-12-10 21:15:13 +01:00
|
|
|
*
|
2009-01-08 16:52:13 +01:00
|
|
|
* @return string User id of the given note.
|
2008-12-10 21:15:13 +01:00
|
|
|
*/
|
|
|
|
function get_incidents_notes_author ($id_note) {
|
|
|
|
return (string) get_db_value ('id_usuario', 'tnota', 'id_nota', (int) $id_note);
|
|
|
|
}
|
2011-03-17 19:02:44 +01:00
|
|
|
|
|
|
|
function call_api($url, $postparameters = false) {
|
|
|
|
|
|
|
|
$curlObj = curl_init();
|
|
|
|
curl_setopt($curlObj, CURLOPT_URL, $url);
|
|
|
|
curl_setopt($curlObj, CURLOPT_RETURNTRANSFER, 1);
|
|
|
|
if($postparameters !== false) {
|
|
|
|
curl_setopt($curlObj, CURLOPT_POSTFIELDS, $postparameters);
|
|
|
|
}
|
|
|
|
$result = curl_exec($curlObj);
|
|
|
|
curl_close($curlObj);
|
|
|
|
|
|
|
|
return $result;
|
|
|
|
}
|
|
|
|
|
|
|
|
function xml_to_array($xml) {
|
|
|
|
$xmlObj = simplexml_load_string($xml);
|
|
|
|
return json_decode(json_encode($xmlObj), 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
|
|
|
?>
|