pandorafms/pandora_console/include/functions_incidents.php

475 lines
12 KiB
PHP
Raw Normal View History

2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2009 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation; version 2
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
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
* @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 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
/**
* Gets all the possible priorities for incidents in an array
*
* @return array The several priorities with their values
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
*/
function incidents_get_priorities($priority=false)
{
$fields = [];
$fields[0] = __('Informative');
$fields[1] = __('Low');
$fields[2] = __('Medium');
$fields[3] = __('Serious');
$fields[4] = __('Very serious');
$fields[10] = __('Maintenance');
if ($priority === false) {
return $fields;
} else {
return $fields[$priority];
}
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
}
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
/**
* Prints the image tag for passed status
*
* @param integer $id_status Which status to return the image to
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
*
* @return string The string with the image tag
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
*/
function incidents_print_priority_img($id_priority, $return=false)
{
switch ($id_priority) {
case 0:
$img = html_print_image('images/dot_green.png', true, ['title' => __('Informative')]).html_print_image('images/dot_green.png', true, ['title' => __('Informative')]).html_print_image('images/dot_yellow.png', true, ['title' => __('Informative')]);
break;
case 1:
$img = html_print_image('images/dot_green.png', true, ['title' => __('Low')]).html_print_image('images/dot_yellow.png', true, ['title' => __('Low')]).html_print_image('images/dot_yellow.png', true, ['title' => __('Low')]);
break;
case 2:
$img = html_print_image('images/dot_yellow.png', true, ['title' => __('Medium')]).html_print_image('images/dot_yellow.png', true, ['title' => __('Medium')]).html_print_image('images/dot_red.png', true, ['title' => __('Medium')]);
break;
case 3:
$img = html_print_image('images/dot_yellow.png', true, ['title' => __('Serious')]).html_print_image('images/dot_red.png', true, ['title' => __('Serious')]).html_print_image('images/dot_red.png', true, ['title' => __('Serious')]);
break;
case 4:
$img = html_print_image('images/dot_red.png', true, ['title' => __('Very serious')]).html_print_image('images/dot_red.png', true, ['title' => __('Very serious')]).html_print_image('images/dot_red.png', true, ['title' => __('Very serious')]);
break;
case 10:
$img = html_print_image('images/dot_green.png', true, ['title' => __('Maintenance')]).html_print_image('images/dot_green.png', true, ['title' => __('Maintenance')]).html_print_image('images/dot_green.png', true, ['title' => __('Maintenance')]);
break;
}
if ($return === false) {
echo $img;
}
return $img;
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
}
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
/**
* Gets all the possible status for incidents in an array
*
* @return array The several status with their values
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
*/
function incidents_get_status()
{
$fields = [];
$fields[0] = __('Active incidents');
$fields[1] = __('Active incidents, with comments');
$fields[2] = __('Rejected incidents');
$fields[3] = __('Expired incidents');
$fields[13] = __('Closed incidents');
return $fields;
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
}
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
/**
* Prints the image tag for passed status
*
* @param integer $id_status: Which status to return the image to
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
*
* @return string The string with the image tag
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
*/
function incidents_print_status_img($id_status, $return=false)
{
switch ($id_status) {
case 0:
$img = html_print_image('images/dot_red.png', true, ['title' => __('Active incidents')]);
break;
case 1:
$img = html_print_image('images/dot_yellow.png', true, ['title' => __('Active incidents, with comments')]);
break;
case 2:
$img = html_print_image('images/dot_blue.png', true, ['title' => __('Rejected incidents')]);
break;
case 3:
$img = html_print_image('images/dot_green.png', true, ['title' => __('Expired incidents')]);
break;
case 13:
$img = html_print_image('images/dot_white.png', true, ['title' => __('Closed incidents')]);
break;
}
if ($return === false) {
echo $img;
}
return $img;
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
}
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
/**
* Updates the last user (either by adding an attachment, note or the incident itself)
* Named after the UNIX touch utility
*
* @param integer $id_incident: A single incident or an array of incidents
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
*
* @return boolean True if it was done, false if it wasn't
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
*/
function incidents_process_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;
}
if (empty($id_incident)) {
return false;
}
return db_process_sql_update('tincidencia', ['id_lastupdate' => $config['id_user']], ['id_incidencia' => $id_incident]);
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
}
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
/**
* Updates the owner (named after the UNIX utility chown)
*
* @param integer $id_incident: A single incident or an array of incidents
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
*
* @return boolean True if it was done, false if it wasn't
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
*/
function incidents_process_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 db_process_sql($sql);
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
}
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
/**
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
* Get the author of an incident.
*
* @param integer $id_incident Incident id.
*
* @return string The author of an incident
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
*/
function incidents_get_author($id_incident)
{
if ($id_incident < 1) {
return '';
}
return (string) db_get_value('id_creator', 'tincidencia', 'id_incidencia', (int) $id_incident);
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
}
/**
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
* Get the owner of an incident.
*
* @param integer $id_incident Incident id.
*
* @return string The last updater of an incident
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
*/
function incidents_get_owner($id_incident)
{
if ($id_incident < 1) {
return '';
}
return (string) db_get_value('id_usuario', 'tincidencia', 'id_incidencia', (int) $id_incident);
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
}
/**
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
* Get the last updater of an incident.
*
* @param integer $id_incident Incident id.
*
* @return string The last updater of an incident
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
*/
function incidents_get_lastupdate($id_incident)
{
if ($id_incident < 1) {
return '';
}
return (string) db_get_value('id_lastupdate', 'tincidencia', 'id_incidencia', (int) $id_incident);
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
}
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
/**
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
* Get the group id of an incident.
*
* @param integer $id_incident Incident id.
*
* @return integer The group id of an incident
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
*/
function incidents_get_group($id_incident)
{
if ($id_incident < 1) {
return 0;
}
return (int) db_get_value('id_grupo', 'tincidencia', 'id_incidencia', (int) $id_incident);
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
}
/**
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
* Delete an incident out the database.
*
* @param mixed $id_inc An int or an array of ints to be deleted
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
*
* @return boolean True if incident was succesfully deleted, false if not
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
*/
function incidents_delete_incident($id_incident)
{
global $config;
$ids = (array) safe_int($id_incident, 1);
// Make the input an array
$notes = [];
$attachments = [];
$errors = 0;
foreach ($ids as $id_inc) {
// Delete incident
$ret = db_process_sql_delete('tincidencia', ['id_incidencia' => $id_inc]);
if ($ret === false) {
$errors++;
}
// We only need the ID's
$notes = array_merge($notes, array_keys(incidents_get_notes($id_inc)));
$attachments = array_merge($attachments, array_keys(incidents_get_attach($id_inc)));
db_pandora_audit('Incident deleted', $config['id_user'].' deleted incident #'.$id_inc);
}
// Delete notes
$note_err = incidents_delete_note($notes, false);
$attach_err = incidents_delete_attach($attachments, false);
if ($note_err === false || $attach_err === false) {
$errors++;
}
if ($errors > 0) {
return false;
}
return true;
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
}
/**
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
* Delete notes out the database.
*
* @param mixed $id_note An int or an array of ints to be deleted
* @param boolean $transact true if a transaction should be started, false if not
*
* @return boolean True if note was succesfully deleted, false if not
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
*/
function incidents_delete_note($id_note, $transact=true)
{
$id_note = (array) safe_int($id_note, 1);
// cast as array
$errors = 0;
// Delete notes
foreach ($id_note as $id) {
$ret = db_process_sql_delete('tnota', ['id_nota' => $id]);
if ($ret === false) {
$errors++;
}
}
if ($errors > 0) {
return false;
} else {
return true;
}
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
}
/**
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
* Delete attachments out the database and from the machine.
*
* @param mixed $id_attach An int or an array of ints to be deleted
* @param boolean $transact true if a transaction should be started, false if not
*
* @return boolean True if attachment was succesfully deleted, false if not
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
*/
function incidents_delete_attach($id_attach, $transact=true)
{
global $config;
$id_attach = (array) safe_int($id_attach, 1);
// cast as array
$errors = 0;
// Delete attachment
foreach ($id_attach as $id) {
$filename = db_get_value('filename', 'tattachment', 'id_attachment', $id);
$ret = db_process_sql_delete('tattachment', ['id_attachment' => $id]);
if ($ret === false) {
$errors++;
}
unlink($config['attachment_store'].'/pand'.$id.'_'.$filename);
}
if ($errors > 0) {
return false;
} else {
return true;
}
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
}
/**
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
* Get notes based on the incident id.
*
* @param integer $id_incident An int with the incident id
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
*
* @return array An array of all the notes for that incident
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
*/
function incidents_get_notes($id_incident)
{
$return = db_get_all_rows_field_filter('tnota', 'id_incident', (int) $id_incident);
if ($return === false) {
$return = [];
}
$notes = [];
foreach ($return as $row) {
$notes[$row['id_nota']] = $row;
}
return $notes;
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
}
/**
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
* Get attachments based on the incident id.
*
* @param integer $id_incident An int with the incident id
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
*
* @return array An array of all the notes for that incident
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
*/
function incidents_get_attach($id_incident)
{
$return = db_get_all_rows_field_filter('tattachment', 'id_incidencia', (int) $id_incident);
if ($return === false) {
$return = [];
}
$attach = [];
foreach ($return as $row) {
$attach[$row['id_attachment']] = $row;
}
return $attach;
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
}
/**
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
* Get user id of a note.
*
* @param integer $id_note Note id.
*
* @return string User id of the given note.
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
*/
function incidents_get_notes_author($id_note)
{
return (string) db_get_value('id_usuario', 'tnota', 'id_nota', (int) $id_note);
2008-12-10 Evi Vanoost <vanooste@rcbi.rochester.edu> * include/functions.php: format_for_graph is now much simpler and uses format_numeric. * include/functions_db.php: give_note_author, give_incident_author, dame_numero_notas, borrar_incidencia, event_insert and return_event_description are now in their respective functions_*.php files but under a new name. Fixed delete_agent transaction error detection * include/functions_events.php: Added get_event_description and create_event (formerly return_event_description and event_insert) * include/functions_html.php: print_timestamp attributes should be default empty, not required. Added print_username for a consistent username print * operation/agentes/ver_agente.php: Function renaming (create_event) * operation/incidents/incident.php: Partial rewrite. Uses new functions. Also added some of feature request #2264838 * operation/incidents/incident_detail.php: Partial rewrite. Uses new functions. Added some of feature request #2264838 functionality. * operation/incidents/incident_search.php, operation/incidents/incident_statistics.php: Minor style update * pandoradb.sql: New tincidencia and tnota layout. No use for tnota_inc * include/functions_incidents.php: All incidents functions. Documentation will be online soon. Also includes an upgrade mechanism for SVN users. Mechanism should be removed for a stable version and integrated into install/upgrade tool. * lib/PandoraFMS/DB.pm: New table layout doesn't require timestamp anymore git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-12-10 21:15:13 +01:00
}
/**
2011-05-09 Juan Manuel Ramon <juanmanuel.ramon@artica.es> * include/functions_graph.php include/functions_html.php include/functions_menu.php include/graphs/fgraph.php include/functions_messages.php include/functions_modules.php include/functions_reporting.php include/functions_filemanager.php include/functions_networkmap.php include/functions_servers.php include/functions_network_profiles.php include/functions_network_components.php include/functions_visual_map.php include/ajax/visual_console_builder.ajax.php include/ajax/agent.php include/ajax/alert_list.ajax.php include/ajax/module.php include/functions_io.php include/functions_api.php include/functions_ui.php include/fgraph.php include/functions_incidents.php include/functions.php include/functions_agents.php include/functions_db.php include/functions_alerts.php include/functions_reports.php include/functions_ui_renders.php extensions/insert_data.php extensions/agents_modules.php extensions/resource_registration.php extensions/resource_exportation.php extensions/module_groups.php extensions/plugin_registration.php operation/incidents/incident.incident.php operation/incidents/incident.php operation/incidents/incident_detail.php operation/incidents/incident.download_file.php operation/incidents/incident.list.php operation/search_modules.php operation/agentes/status_monitor.php operation/agentes/export_csv.php operation/agentes/estado_ultimopaquete.php operation/agentes/datos_agente.php operation/agentes/estado_agente.php operation/agentes/networkmap.topology.php operation/agentes/networkmap.groups.php operation/agentes/sla_view.php operation/agentes/exportdata.php operation/agentes/estado_monitores.php operation/agentes/ver_agente.php operation/agentes/tactical.php operation/agentes/group_view.php operation/agentes/networkmap.php operation/agentes/stat_win.php operation/servers/view_server.php operation/servers/view_server_detail.php operation/menu.php operation/search_agents.php operation/integria_incidents/incident.incident.php operation/integria_incidents/incident.php operation/integria_incidents/incident_detail.php operation/integria_incidents/incident.download_file.php operation/integria_incidents/incident.list.php operation/events/events_rss.php operation/events/events_list.php operation/search_alerts.php operation/messages/message.php operation/reporting/reporting_xml.php operation/reporting/reporting_viewer.php operation/reporting/custom_reporting.php operation/search_reports.php operation/search_results.php mobile/operation/agents/monitor_status.php mobile/operation/agents/view_agents.php mobile/operation/agents/tactical.php mobile/operation/agents/view_alerts.php mobile/operation/agents/group_view.php mobile/operation/servers/view_servers.php general/logon_ok.php general/header.php godmode/admin_access_logs.php godmode/db/db_refine.php godmode/db/db_info.php godmode/db/db_purge.php godmode/agentes/agent_template.php godmode/agentes/module_manager_editor_common.php godmode/agentes/module_manager.php godmode/agentes/configurar_agente.php godmode/agentes/module_manager_editor.php godmode/agentes/agent_manager.php godmode/servers/recon_script.php godmode/servers/plugin.php godmode/servers/manage_recontask.php godmode/servers/modificar_server.php godmode/menu.php godmode/alerts/alert_list.list.php godmode/alerts/configure_alert_compound.php godmode/alerts/configure_alert_action.php godmode/setup/os.list.php godmode/setup/links.php godmode/setup/setup.php godmode/users/user_list.php godmode/users/configure_user.php godmode/massive/massive_add_alerts.php godmode/massive/massive_delete_profiles.php godmode/massive/massive_edit_agents.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/modules/manage_network_components_form.php godmode/modules/manage_nc_groups_form.php godmode/modules/manage_network_templates.php godmode/modules/manage_network_components_form_common.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.preview.php godmode/reporting/graph_builder.graph_editor.php godmode/reporting/reporting_builder.php godmode/reporting/reporting_builder.item_editor.php: Functions in functions_incidents.php, functions_io.php, functions_menu.php, functions_messages.php, functions_modules.php, functions_network_components.php, functions_network_profiles.php, functions_networkmap.php, functions_reporting.php, functions_reports.php, functions_servers.php have "incidents_", "io_", "menu_", "messages_", "modules_", "network_profiles_", "network_components_", "networkmap_", "reporting_", "reports_", "servers_" prefixes respectively. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4326 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-05-09 19:30:55 +02:00
* Interface to Integria API functionality.
*
* @param string $url Url to Integria API with user, password and option (function to use).
2011-05-09 Juan Manuel Ramon <juanmanuel.ramon@artica.es> * include/functions_graph.php include/functions_html.php include/functions_menu.php include/graphs/fgraph.php include/functions_messages.php include/functions_modules.php include/functions_reporting.php include/functions_filemanager.php include/functions_networkmap.php include/functions_servers.php include/functions_network_profiles.php include/functions_network_components.php include/functions_visual_map.php include/ajax/visual_console_builder.ajax.php include/ajax/agent.php include/ajax/alert_list.ajax.php include/ajax/module.php include/functions_io.php include/functions_api.php include/functions_ui.php include/fgraph.php include/functions_incidents.php include/functions.php include/functions_agents.php include/functions_db.php include/functions_alerts.php include/functions_reports.php include/functions_ui_renders.php extensions/insert_data.php extensions/agents_modules.php extensions/resource_registration.php extensions/resource_exportation.php extensions/module_groups.php extensions/plugin_registration.php operation/incidents/incident.incident.php operation/incidents/incident.php operation/incidents/incident_detail.php operation/incidents/incident.download_file.php operation/incidents/incident.list.php operation/search_modules.php operation/agentes/status_monitor.php operation/agentes/export_csv.php operation/agentes/estado_ultimopaquete.php operation/agentes/datos_agente.php operation/agentes/estado_agente.php operation/agentes/networkmap.topology.php operation/agentes/networkmap.groups.php operation/agentes/sla_view.php operation/agentes/exportdata.php operation/agentes/estado_monitores.php operation/agentes/ver_agente.php operation/agentes/tactical.php operation/agentes/group_view.php operation/agentes/networkmap.php operation/agentes/stat_win.php operation/servers/view_server.php operation/servers/view_server_detail.php operation/menu.php operation/search_agents.php operation/integria_incidents/incident.incident.php operation/integria_incidents/incident.php operation/integria_incidents/incident_detail.php operation/integria_incidents/incident.download_file.php operation/integria_incidents/incident.list.php operation/events/events_rss.php operation/events/events_list.php operation/search_alerts.php operation/messages/message.php operation/reporting/reporting_xml.php operation/reporting/reporting_viewer.php operation/reporting/custom_reporting.php operation/search_reports.php operation/search_results.php mobile/operation/agents/monitor_status.php mobile/operation/agents/view_agents.php mobile/operation/agents/tactical.php mobile/operation/agents/view_alerts.php mobile/operation/agents/group_view.php mobile/operation/servers/view_servers.php general/logon_ok.php general/header.php godmode/admin_access_logs.php godmode/db/db_refine.php godmode/db/db_info.php godmode/db/db_purge.php godmode/agentes/agent_template.php godmode/agentes/module_manager_editor_common.php godmode/agentes/module_manager.php godmode/agentes/configurar_agente.php godmode/agentes/module_manager_editor.php godmode/agentes/agent_manager.php godmode/servers/recon_script.php godmode/servers/plugin.php godmode/servers/manage_recontask.php godmode/servers/modificar_server.php godmode/menu.php godmode/alerts/alert_list.list.php godmode/alerts/configure_alert_compound.php godmode/alerts/configure_alert_action.php godmode/setup/os.list.php godmode/setup/links.php godmode/setup/setup.php godmode/users/user_list.php godmode/users/configure_user.php godmode/massive/massive_add_alerts.php godmode/massive/massive_delete_profiles.php godmode/massive/massive_edit_agents.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/modules/manage_network_components_form.php godmode/modules/manage_nc_groups_form.php godmode/modules/manage_network_templates.php godmode/modules/manage_network_components_form_common.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.preview.php godmode/reporting/graph_builder.graph_editor.php godmode/reporting/reporting_builder.php godmode/reporting/reporting_builder.item_editor.php: Functions in functions_incidents.php, functions_io.php, functions_menu.php, functions_messages.php, functions_modules.php, functions_network_components.php, functions_network_profiles.php, functions_networkmap.php, functions_reporting.php, functions_reports.php, functions_servers.php have "incidents_", "io_", "menu_", "messages_", "modules_", "network_profiles_", "network_components_", "networkmap_", "reporting_", "reports_", "servers_" prefixes respectively. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4326 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-05-09 19:30:55 +02:00
* @param string $postparameters Additional parameters to pass.
*
* @return variant The function result called in the API.
*/
function incidents_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;
}
/**
2011-05-09 Juan Manuel Ramon <juanmanuel.ramon@artica.es> * include/functions_graph.php include/functions_html.php include/functions_menu.php include/graphs/fgraph.php include/functions_messages.php include/functions_modules.php include/functions_reporting.php include/functions_filemanager.php include/functions_networkmap.php include/functions_servers.php include/functions_network_profiles.php include/functions_network_components.php include/functions_visual_map.php include/ajax/visual_console_builder.ajax.php include/ajax/agent.php include/ajax/alert_list.ajax.php include/ajax/module.php include/functions_io.php include/functions_api.php include/functions_ui.php include/fgraph.php include/functions_incidents.php include/functions.php include/functions_agents.php include/functions_db.php include/functions_alerts.php include/functions_reports.php include/functions_ui_renders.php extensions/insert_data.php extensions/agents_modules.php extensions/resource_registration.php extensions/resource_exportation.php extensions/module_groups.php extensions/plugin_registration.php operation/incidents/incident.incident.php operation/incidents/incident.php operation/incidents/incident_detail.php operation/incidents/incident.download_file.php operation/incidents/incident.list.php operation/search_modules.php operation/agentes/status_monitor.php operation/agentes/export_csv.php operation/agentes/estado_ultimopaquete.php operation/agentes/datos_agente.php operation/agentes/estado_agente.php operation/agentes/networkmap.topology.php operation/agentes/networkmap.groups.php operation/agentes/sla_view.php operation/agentes/exportdata.php operation/agentes/estado_monitores.php operation/agentes/ver_agente.php operation/agentes/tactical.php operation/agentes/group_view.php operation/agentes/networkmap.php operation/agentes/stat_win.php operation/servers/view_server.php operation/servers/view_server_detail.php operation/menu.php operation/search_agents.php operation/integria_incidents/incident.incident.php operation/integria_incidents/incident.php operation/integria_incidents/incident_detail.php operation/integria_incidents/incident.download_file.php operation/integria_incidents/incident.list.php operation/events/events_rss.php operation/events/events_list.php operation/search_alerts.php operation/messages/message.php operation/reporting/reporting_xml.php operation/reporting/reporting_viewer.php operation/reporting/custom_reporting.php operation/search_reports.php operation/search_results.php mobile/operation/agents/monitor_status.php mobile/operation/agents/view_agents.php mobile/operation/agents/tactical.php mobile/operation/agents/view_alerts.php mobile/operation/agents/group_view.php mobile/operation/servers/view_servers.php general/logon_ok.php general/header.php godmode/admin_access_logs.php godmode/db/db_refine.php godmode/db/db_info.php godmode/db/db_purge.php godmode/agentes/agent_template.php godmode/agentes/module_manager_editor_common.php godmode/agentes/module_manager.php godmode/agentes/configurar_agente.php godmode/agentes/module_manager_editor.php godmode/agentes/agent_manager.php godmode/servers/recon_script.php godmode/servers/plugin.php godmode/servers/manage_recontask.php godmode/servers/modificar_server.php godmode/menu.php godmode/alerts/alert_list.list.php godmode/alerts/configure_alert_compound.php godmode/alerts/configure_alert_action.php godmode/setup/os.list.php godmode/setup/links.php godmode/setup/setup.php godmode/users/user_list.php godmode/users/configure_user.php godmode/massive/massive_add_alerts.php godmode/massive/massive_delete_profiles.php godmode/massive/massive_edit_agents.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/modules/manage_network_components_form.php godmode/modules/manage_nc_groups_form.php godmode/modules/manage_network_templates.php godmode/modules/manage_network_components_form_common.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.preview.php godmode/reporting/graph_builder.graph_editor.php godmode/reporting/reporting_builder.php godmode/reporting/reporting_builder.item_editor.php: Functions in functions_incidents.php, functions_io.php, functions_menu.php, functions_messages.php, functions_modules.php, functions_network_components.php, functions_network_profiles.php, functions_networkmap.php, functions_reporting.php, functions_reports.php, functions_servers.php have "incidents_", "io_", "menu_", "messages_", "modules_", "network_profiles_", "network_components_", "networkmap_", "reporting_", "reports_", "servers_" prefixes respectively. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4326 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-05-09 19:30:55 +02:00
* Converts Xml format file to an array datatype.
*
2011-05-09 Juan Manuel Ramon <juanmanuel.ramon@artica.es> * include/functions_graph.php include/functions_html.php include/functions_menu.php include/graphs/fgraph.php include/functions_messages.php include/functions_modules.php include/functions_reporting.php include/functions_filemanager.php include/functions_networkmap.php include/functions_servers.php include/functions_network_profiles.php include/functions_network_components.php include/functions_visual_map.php include/ajax/visual_console_builder.ajax.php include/ajax/agent.php include/ajax/alert_list.ajax.php include/ajax/module.php include/functions_io.php include/functions_api.php include/functions_ui.php include/fgraph.php include/functions_incidents.php include/functions.php include/functions_agents.php include/functions_db.php include/functions_alerts.php include/functions_reports.php include/functions_ui_renders.php extensions/insert_data.php extensions/agents_modules.php extensions/resource_registration.php extensions/resource_exportation.php extensions/module_groups.php extensions/plugin_registration.php operation/incidents/incident.incident.php operation/incidents/incident.php operation/incidents/incident_detail.php operation/incidents/incident.download_file.php operation/incidents/incident.list.php operation/search_modules.php operation/agentes/status_monitor.php operation/agentes/export_csv.php operation/agentes/estado_ultimopaquete.php operation/agentes/datos_agente.php operation/agentes/estado_agente.php operation/agentes/networkmap.topology.php operation/agentes/networkmap.groups.php operation/agentes/sla_view.php operation/agentes/exportdata.php operation/agentes/estado_monitores.php operation/agentes/ver_agente.php operation/agentes/tactical.php operation/agentes/group_view.php operation/agentes/networkmap.php operation/agentes/stat_win.php operation/servers/view_server.php operation/servers/view_server_detail.php operation/menu.php operation/search_agents.php operation/integria_incidents/incident.incident.php operation/integria_incidents/incident.php operation/integria_incidents/incident_detail.php operation/integria_incidents/incident.download_file.php operation/integria_incidents/incident.list.php operation/events/events_rss.php operation/events/events_list.php operation/search_alerts.php operation/messages/message.php operation/reporting/reporting_xml.php operation/reporting/reporting_viewer.php operation/reporting/custom_reporting.php operation/search_reports.php operation/search_results.php mobile/operation/agents/monitor_status.php mobile/operation/agents/view_agents.php mobile/operation/agents/tactical.php mobile/operation/agents/view_alerts.php mobile/operation/agents/group_view.php mobile/operation/servers/view_servers.php general/logon_ok.php general/header.php godmode/admin_access_logs.php godmode/db/db_refine.php godmode/db/db_info.php godmode/db/db_purge.php godmode/agentes/agent_template.php godmode/agentes/module_manager_editor_common.php godmode/agentes/module_manager.php godmode/agentes/configurar_agente.php godmode/agentes/module_manager_editor.php godmode/agentes/agent_manager.php godmode/servers/recon_script.php godmode/servers/plugin.php godmode/servers/manage_recontask.php godmode/servers/modificar_server.php godmode/menu.php godmode/alerts/alert_list.list.php godmode/alerts/configure_alert_compound.php godmode/alerts/configure_alert_action.php godmode/setup/os.list.php godmode/setup/links.php godmode/setup/setup.php godmode/users/user_list.php godmode/users/configure_user.php godmode/massive/massive_add_alerts.php godmode/massive/massive_delete_profiles.php godmode/massive/massive_edit_agents.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/modules/manage_network_components_form.php godmode/modules/manage_nc_groups_form.php godmode/modules/manage_network_templates.php godmode/modules/manage_network_components_form_common.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.preview.php godmode/reporting/graph_builder.graph_editor.php godmode/reporting/reporting_builder.php godmode/reporting/reporting_builder.item_editor.php: Functions in functions_incidents.php, functions_io.php, functions_menu.php, functions_messages.php, functions_modules.php, functions_network_components.php, functions_network_profiles.php, functions_networkmap.php, functions_reporting.php, functions_reports.php, functions_servers.php have "incidents_", "io_", "menu_", "messages_", "modules_", "network_profiles_", "network_components_", "networkmap_", "reporting_", "reports_", "servers_" prefixes respectively. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4326 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-05-09 19:30:55 +02:00
* @param string $xml Xml file to convert.
*
2011-05-09 Juan Manuel Ramon <juanmanuel.ramon@artica.es> * include/functions_graph.php include/functions_html.php include/functions_menu.php include/graphs/fgraph.php include/functions_messages.php include/functions_modules.php include/functions_reporting.php include/functions_filemanager.php include/functions_networkmap.php include/functions_servers.php include/functions_network_profiles.php include/functions_network_components.php include/functions_visual_map.php include/ajax/visual_console_builder.ajax.php include/ajax/agent.php include/ajax/alert_list.ajax.php include/ajax/module.php include/functions_io.php include/functions_api.php include/functions_ui.php include/fgraph.php include/functions_incidents.php include/functions.php include/functions_agents.php include/functions_db.php include/functions_alerts.php include/functions_reports.php include/functions_ui_renders.php extensions/insert_data.php extensions/agents_modules.php extensions/resource_registration.php extensions/resource_exportation.php extensions/module_groups.php extensions/plugin_registration.php operation/incidents/incident.incident.php operation/incidents/incident.php operation/incidents/incident_detail.php operation/incidents/incident.download_file.php operation/incidents/incident.list.php operation/search_modules.php operation/agentes/status_monitor.php operation/agentes/export_csv.php operation/agentes/estado_ultimopaquete.php operation/agentes/datos_agente.php operation/agentes/estado_agente.php operation/agentes/networkmap.topology.php operation/agentes/networkmap.groups.php operation/agentes/sla_view.php operation/agentes/exportdata.php operation/agentes/estado_monitores.php operation/agentes/ver_agente.php operation/agentes/tactical.php operation/agentes/group_view.php operation/agentes/networkmap.php operation/agentes/stat_win.php operation/servers/view_server.php operation/servers/view_server_detail.php operation/menu.php operation/search_agents.php operation/integria_incidents/incident.incident.php operation/integria_incidents/incident.php operation/integria_incidents/incident_detail.php operation/integria_incidents/incident.download_file.php operation/integria_incidents/incident.list.php operation/events/events_rss.php operation/events/events_list.php operation/search_alerts.php operation/messages/message.php operation/reporting/reporting_xml.php operation/reporting/reporting_viewer.php operation/reporting/custom_reporting.php operation/search_reports.php operation/search_results.php mobile/operation/agents/monitor_status.php mobile/operation/agents/view_agents.php mobile/operation/agents/tactical.php mobile/operation/agents/view_alerts.php mobile/operation/agents/group_view.php mobile/operation/servers/view_servers.php general/logon_ok.php general/header.php godmode/admin_access_logs.php godmode/db/db_refine.php godmode/db/db_info.php godmode/db/db_purge.php godmode/agentes/agent_template.php godmode/agentes/module_manager_editor_common.php godmode/agentes/module_manager.php godmode/agentes/configurar_agente.php godmode/agentes/module_manager_editor.php godmode/agentes/agent_manager.php godmode/servers/recon_script.php godmode/servers/plugin.php godmode/servers/manage_recontask.php godmode/servers/modificar_server.php godmode/menu.php godmode/alerts/alert_list.list.php godmode/alerts/configure_alert_compound.php godmode/alerts/configure_alert_action.php godmode/setup/os.list.php godmode/setup/links.php godmode/setup/setup.php godmode/users/user_list.php godmode/users/configure_user.php godmode/massive/massive_add_alerts.php godmode/massive/massive_delete_profiles.php godmode/massive/massive_edit_agents.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/modules/manage_network_components_form.php godmode/modules/manage_nc_groups_form.php godmode/modules/manage_network_templates.php godmode/modules/manage_network_components_form_common.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.preview.php godmode/reporting/graph_builder.graph_editor.php godmode/reporting/reporting_builder.php godmode/reporting/reporting_builder.item_editor.php: Functions in functions_incidents.php, functions_io.php, functions_menu.php, functions_messages.php, functions_modules.php, functions_network_components.php, functions_network_profiles.php, functions_networkmap.php, functions_reporting.php, functions_reports.php, functions_servers.php have "incidents_", "io_", "menu_", "messages_", "modules_", "network_profiles_", "network_components_", "networkmap_", "reporting_", "reports_", "servers_" prefixes respectively. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4326 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-05-09 19:30:55 +02:00
* @return array A Json encoded array with xml content.
*/
function incidents_xml_to_array($xml)
{
$xmlObj = simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA);
return json_decode(json_encode($xmlObj), true);
}