2010-04-22 Miguel de Dios <miguel.dedios@artica.es>
* include/ajax/reporting.ajax.php: added ajax respond to delete_sla_item and
add_sla actions.
* include/functions.php: added in the function "get_report_types" new types
of items/contents for reporting.
* pandoradb.sql: added columns custom_logo, header, first_page, footer,
custom_font into the table treport. And in the table treport_content have
new columns text, external_source, treport_custom_sql_id, header_definition,
row_separator, line_separator. Added new table treport_custom_sql.
* extras/pandoradb_migrate_v3.0_to_v3.1.sql: added changes for DB that it
same to pandoradb.sql.
* images/sort_none.png, images/sort_down.png, images/sort_up.png: added the
images for order list items for reports.
* godmode/reporting/reporting_builder.list_items.php,
godmode/reporting/reporting_builder.main.php,
godmode/reporting/reporting_builder.php,
godmode/reporting/reporting_builder.item_editor.php: made new forms to
manage the reporting, now Pandora have tabs and list of items. In the list
of items, you can order manually or automatically the items.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2595 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-04-22 21:01:47 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
//Pandora FMS- http://pandorafms.com
|
|
|
|
// ==================================================
|
|
|
|
// Copyright (c) 2005-2010 Artica Soluciones Tecnologicas
|
|
|
|
// Please see http://pandorafms.org for full contribution list
|
|
|
|
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU Lesser General Public License
|
|
|
|
// as published by the Free Software Foundation; version 2
|
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
|
|
|
global $config;
|
|
|
|
|
|
|
|
// Login check
|
|
|
|
check_login ();
|
|
|
|
|
|
|
|
if (! give_acl ($config['id_user'], 0, "IW")) {
|
|
|
|
audit_db ($config['id_user'], $_SERVER['REMOTE_ADDR'], "ACL Violation",
|
|
|
|
"Trying to access report builder");
|
|
|
|
require ("general/noaccess.php");
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
$delete_sla_item = get_parameter('delete_sla_item', 0);
|
2010-04-27 17:25:32 +02:00
|
|
|
$get_custom_sql = get_parameter('get_custom_sql', 0);
|
2010-04-22 Miguel de Dios <miguel.dedios@artica.es>
* include/ajax/reporting.ajax.php: added ajax respond to delete_sla_item and
add_sla actions.
* include/functions.php: added in the function "get_report_types" new types
of items/contents for reporting.
* pandoradb.sql: added columns custom_logo, header, first_page, footer,
custom_font into the table treport. And in the table treport_content have
new columns text, external_source, treport_custom_sql_id, header_definition,
row_separator, line_separator. Added new table treport_custom_sql.
* extras/pandoradb_migrate_v3.0_to_v3.1.sql: added changes for DB that it
same to pandoradb.sql.
* images/sort_none.png, images/sort_down.png, images/sort_up.png: added the
images for order list items for reports.
* godmode/reporting/reporting_builder.list_items.php,
godmode/reporting/reporting_builder.main.php,
godmode/reporting/reporting_builder.php,
godmode/reporting/reporting_builder.item_editor.php: made new forms to
manage the reporting, now Pandora have tabs and list of items. In the list
of items, you can order manually or automatically the items.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2595 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-04-22 21:01:47 +02:00
|
|
|
$add_sla = get_parameter('add_sla', 0);
|
|
|
|
$id = get_parameter('id', 0);
|
|
|
|
|
|
|
|
if ($delete_sla_item) {
|
|
|
|
$result = process_sql_delete('treport_content_sla_combined', array('id' => (int)$id));
|
|
|
|
|
|
|
|
$data['correct'] = 1;
|
|
|
|
if ($result === false) {
|
|
|
|
$data['correct'] = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
echo json_encode($data);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($add_sla) {
|
|
|
|
$id_module = get_parameter('id_module', 0);
|
|
|
|
$sla_limit = get_parameter('sla_limit', 0);
|
|
|
|
$sla_max = get_parameter('sla_max', 0);
|
|
|
|
$sla_min = get_parameter('sla_min', 0);
|
|
|
|
|
|
|
|
$result = process_sql_insert('treport_content_sla_combined', array(
|
|
|
|
'id_report_content' => $id,
|
|
|
|
'id_agent_module' => $id_module,
|
|
|
|
'sla_max' => $sla_max,
|
|
|
|
'sla_min' => $sla_min,
|
|
|
|
'sla_limit' => $sla_limit));
|
|
|
|
|
|
|
|
if ($result === false) {
|
|
|
|
$data['correct'] = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$data['correct'] = 1;
|
|
|
|
$data['id'] = $result;
|
|
|
|
}
|
|
|
|
|
|
|
|
echo json_encode($data);
|
|
|
|
return;
|
|
|
|
}
|
2010-04-27 17:25:32 +02:00
|
|
|
|
|
|
|
if ($get_custom_sql) {
|
|
|
|
$sql = get_db_value_filter('`sql`', 'treport_custom_sql', array('id' => $id));
|
|
|
|
|
|
|
|
if ($result === false) {
|
|
|
|
$data['correct'] = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$data['correct'] = 1;
|
|
|
|
$data['sql'] = $sql;
|
|
|
|
}
|
|
|
|
|
|
|
|
echo json_encode($data);
|
|
|
|
return;
|
|
|
|
}
|
2010-04-22 Miguel de Dios <miguel.dedios@artica.es>
* include/ajax/reporting.ajax.php: added ajax respond to delete_sla_item and
add_sla actions.
* include/functions.php: added in the function "get_report_types" new types
of items/contents for reporting.
* pandoradb.sql: added columns custom_logo, header, first_page, footer,
custom_font into the table treport. And in the table treport_content have
new columns text, external_source, treport_custom_sql_id, header_definition,
row_separator, line_separator. Added new table treport_custom_sql.
* extras/pandoradb_migrate_v3.0_to_v3.1.sql: added changes for DB that it
same to pandoradb.sql.
* images/sort_none.png, images/sort_down.png, images/sort_up.png: added the
images for order list items for reports.
* godmode/reporting/reporting_builder.list_items.php,
godmode/reporting/reporting_builder.main.php,
godmode/reporting/reporting_builder.php,
godmode/reporting/reporting_builder.item_editor.php: made new forms to
manage the reporting, now Pandora have tabs and list of items. In the list
of items, you can order manually or automatically the items.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2595 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-04-22 21:01:47 +02:00
|
|
|
?>
|