2010-03-23 18:46:08 +01:00
|
|
|
<?php
|
|
|
|
// Pandora FMS - http://pandorafms.com
|
|
|
|
// ==================================================
|
|
|
|
// Copyright (c) 2005-2009 Artica Soluciones Tecnologicas
|
|
|
|
// Please see http://pandorafms.org for full contribution list
|
|
|
|
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License
|
|
|
|
// as published by the Free Software Foundation for version 2.
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
|
|
|
// Login check
|
|
|
|
global $config;
|
|
|
|
|
|
|
|
check_login ();
|
|
|
|
|
|
|
|
if (! give_acl ($config['id_user'], 0, "IW")) {
|
2010-10-27 Miguel de Dios <miguel.dedios@artica.es>
* godmode/admin_access_logs.php: added hooks to enterprise code, and added
new filter with more options.
* include/functions_db.php: erase the deprecated function "audit_db", and
added in function "pandora_audit" two new parameters $user_id, $ip for
pass this values when it are differents to the default values. Finally
replaced the depecrated "audit_db" for "pandora_audit".
* include/functions_events.php, include/functions_filemanager.php,
include/ajax/reporting.ajax.php,
include/ajax/visual_console_builder.ajax.php,
include/ajax/alert_list.ajax.php, include/help/es/modu_group_list.php,
include/functions_incidents.php, index.php, extensions/agents_modules.php,
extensions/insert_data.php, extensions/system_info.php,
extensions/dbmanager.php, extensions/update_manager/settings.php,
extensions/pandora_logs.php, extensions/plugin_registration.php,
operation/incidents/incident.php, operation/incidents/incident_detail.php,
operation/incidents/incident_statistics.php, operation/extensions.php,
operation/visual_console/render_view.php,
operation/agentes/status_monitor.php, operation/agentes/export_csv.php,
operation/agentes/datos_agente.php, operation/agentes/alerts_status.php,
operation/agentes/estado_generalagente.php,
operation/agentes/custom_fields.php, operation/agentes/estado_agente.php,
operation/agentes/networkmap.topology.php,
operation/agentes/networkmap.groups.php, operation/agentes/sla_view.php,
operation/agentes/gis_view.php, operation/agentes/estado_monitores.php,
operation/agentes/ver_agente.php, operation/agentes/graphs.php,
operation/agentes/agent_fields.php, operation/agentes/tactical.php,
operation/agentes/group_view.php, operation/agentes/networkmap.php,
operation/servers/view_server.php,operation/servers/view_server_detail.php,
operation/snmpconsole/snmp_view.php, operation/users/user_edit.php,
operation/gis_maps/render_view.php, operation/events/event_statistics.php,
operation/events/sound_events.php, operation/events/events_validate.php,
operation/events/events_list.php, operation/events/events_marquee.php,
operation/events/events.php, operation/reporting/reporting_xml.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
mobile/operation/agents/view_agents.php, mobile/index.php,
godmode/groups/modu_group_list.php, godmode/groups/configure_group.php,
godmode/groups/configure_modu_group.php, godmode/groups/group_list.php,
godmode/extensions.php, godmode/db/db_main.php, godmode/db/db_audit.php,
godmode/db/db_sanity.php, godmode/db/db_refine.php, godmode/db/db_info.php,
godmode/db/db_event.php, godmode/db/db_purge.php,
godmode/agentes/fields_manager.php, godmode/agentes/module_manager.php,
godmode/agentes/modificar_agente.php, godmode/agentes/configurar_agente.php,
godmode/agentes/configure_field.php, godmode/agentes/planned_downtime.php,
godmode/agentes/manage_config_remote.php, godmode/agentes/agent_manager.php,
godmode/servers/manage_export.php, godmode/servers/recon_script.php,
godmode/servers/manage_export_form.php, godmode/servers/plugin.php,
godmode/servers/manage_recontask.php, godmode/servers/modificar_server.php,
godmode/servers/manage_recontask_form.php,
godmode/alerts/alert_list.list.php,
godmode/alerts/configure_alert_compound.php,
godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php,
godmode/alerts/configure_alert_template.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php, godmode/alerts/alert_list.builder.php,
godmode/alerts/alert_commands.php, godmode/snmpconsole/snmp_alert.php,
godmode/snmpconsole/snmp_filters.php, godmode/setup/file_manager.php,
godmode/setup/os.list.php, godmode/setup/news.php,
godmode/setup/gis_step_2.php, godmode/setup/links.php,
godmode/setup/setup.php, godmode/setup/os.php,
godmode/setup/performance.php, godmode/setup/setup_auth.php,
godmode/setup/gis.php, godmode/setup/os.builder.php,
godmode/setup/setup_visuals.php, godmode/users/user_list.php,
godmode/users/configure_user.php, godmode/users/configure_profile.php,
godmode/gis_maps/configure_gis_map.php, godmode/gis_maps/index.php,
godmode/massive/massive_add_alerts.php,
godmode/massive/massive_copy_modules.php,
godmode/massive/massive_delete_agents.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_operations.php,
godmode/massive/massive_delete_profiles.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_action_alerts.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_profiles.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_edit_modules.php,
godmode/massive/massive_standby_alerts.php,
godmode/massive/massive_add_action_alerts.php,
godmode/modules/manage_network_components_form.php,
godmode/modules/manage_nc_groups_form.php,
godmode/modules/manage_network_templates.php,
godmode/modules/module_list.php,
godmode/modules/manage_network_components_form_common.php,
godmode/modules/manage_network_components_form_network.php,
godmode/modules/manage_network_templates_form.php,
godmode/modules/manage_network_components_form_wmi.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_nc_groups.php,
godmode/reporting/reporting_builder.list_items.php,
godmode/reporting/graph_builder.main.php,
godmode/reporting/visual_console_builder.wizard.php,
godmode/reporting/visual_console_builder.php,
godmode/reporting/reporting_builder.preview.php,
godmode/reporting/reporting_builder.main.php,
godmode/reporting/visual_console_builder.data.php,
godmode/reporting/map_builder_wizard.php,
godmode/reporting/visual_console_builder.elements.php,
godmode/reporting/graph_builder.php,
godmode/reporting/visual_console_builder.preview.php,
godmode/reporting/graph_builder.graph_editor.php,
godmode/reporting/reporting_builder.php,
godmode/reporting/visual_console_builder.editor.php,
godmode/reporting/reporting_builder.item_editor.php,
godmode/reporting/graphs.php, godmode/reporting/graph_builder.preview.php:
Replaced the depecrated "audit_db" for "pandora_audit".
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3467 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-10-27 12:47:07 +02:00
|
|
|
pandora_audit("ACL Violation",
|
2010-03-23 18:46:08 +01:00
|
|
|
"Trying to access report builder");
|
|
|
|
require ("general/noaccess.php");
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
2010-03-29 15:58:08 +02:00
|
|
|
require_once('godmode/reporting/visual_console_builder.constans.php');
|
|
|
|
require_once('include/functions_visual_map.php');
|
2010-03-23 18:46:08 +01:00
|
|
|
|
|
|
|
$action = get_parameter('action');
|
|
|
|
$type = get_parameter('type');
|
2010-03-31 11:13:54 +02:00
|
|
|
|
2010-03-23 18:46:08 +01:00
|
|
|
$id_visual_console = get_parameter('id_visual_console', null);
|
2010-03-31 11:13:54 +02:00
|
|
|
|
2010-03-23 18:46:08 +01:00
|
|
|
$id_element = get_parameter('id_element', null);
|
2010-03-31 11:13:54 +02:00
|
|
|
|
2010-03-23 18:46:08 +01:00
|
|
|
$image = get_parameter('image', null);
|
|
|
|
$background = get_parameter('background', null);
|
2011-02-16 14:26:28 +01:00
|
|
|
$label = get_parameter('label', '');
|
2010-03-23 18:46:08 +01:00
|
|
|
$left = get_parameter('left', null);
|
|
|
|
$top = get_parameter('top', null);
|
|
|
|
$agent = get_parameter('agent', null);
|
2010-03-29 15:58:08 +02:00
|
|
|
$id_module = get_parameter('module', null);
|
2010-03-23 18:46:08 +01:00
|
|
|
$period = get_parameter('period', null);
|
|
|
|
$width = get_parameter('width', null);
|
|
|
|
$height = get_parameter('height', null);
|
|
|
|
$parent = get_parameter('parent', null);
|
|
|
|
$map_linked = get_parameter('map_linked', null);
|
|
|
|
$label_color = get_parameter('label_color', null);
|
2010-03-29 15:58:08 +02:00
|
|
|
$width_percentile = get_parameter('width_percentile', null);
|
|
|
|
$max_percentile = get_parameter('max_percentile', null);
|
2010-03-29 20:31:22 +02:00
|
|
|
$height_module_graph = get_parameter('height_module_graph', null);
|
|
|
|
$width_module_graph = get_parameter('width_module_graph', null);
|
2010-03-23 18:46:08 +01:00
|
|
|
|
|
|
|
switch ($action) {
|
2010-03-29 20:31:22 +02:00
|
|
|
case 'get_layout_data':
|
|
|
|
$layoutData = get_db_row_filter('tlayout_data', array('id' => $id_element));
|
|
|
|
|
|
|
|
echo json_encode($layoutData);
|
|
|
|
break;
|
2010-03-29 15:58:08 +02:00
|
|
|
case 'get_module_value':
|
|
|
|
$layoutData = get_db_row_filter('tlayout_data', array('id' => $id_element));
|
|
|
|
$returnValue = get_db_sql ('SELECT datos FROM tagente_estado WHERE id_agente_modulo = ' . $layoutData['id_agente_modulo']);
|
|
|
|
|
|
|
|
$return = array();
|
|
|
|
$return['value'] = $returnValue;
|
|
|
|
$return['max_percentile'] = $layoutData['height'];
|
|
|
|
$return['width_percentile'] = $layoutData['width'];
|
|
|
|
|
|
|
|
echo json_encode($return);
|
|
|
|
break;
|
2010-03-25 17:18:05 +01:00
|
|
|
case 'get_color_line':
|
|
|
|
$layoutData = get_db_row_filter('tlayout_data', array('id' => $id_element));
|
|
|
|
|
|
|
|
$return = array();
|
|
|
|
$return['color_line'] = getColorLineStatus($layoutData);
|
|
|
|
echo json_encode($return);
|
|
|
|
break;
|
2010-03-23 18:46:08 +01:00
|
|
|
case 'get_image':
|
|
|
|
$layoutData = get_db_row_filter('tlayout_data', array('id' => $id_element));
|
|
|
|
|
|
|
|
$return = array();
|
|
|
|
$return['image'] = getImageStatusElement($layoutData);
|
|
|
|
echo json_encode($return);
|
|
|
|
break;
|
|
|
|
case 'update':
|
2011-02-18 12:31:09 +01:00
|
|
|
case 'move':
|
2010-03-23 18:46:08 +01:00
|
|
|
switch ($type) {
|
|
|
|
case 'background':
|
|
|
|
$values = array();
|
|
|
|
if ($background !== null)
|
|
|
|
$values['background'] = $background;
|
|
|
|
if ($width !== null)
|
|
|
|
$values['width'] = $width;
|
|
|
|
if ($height !== null)
|
|
|
|
$values['height'] = $height;
|
|
|
|
process_sql_update('tlayout', $values, array('id' => $id_visual_console));
|
|
|
|
break;
|
2010-03-29 20:31:22 +02:00
|
|
|
case 'simple_value':
|
2010-03-29 15:58:08 +02:00
|
|
|
case 'percentile_bar':
|
2010-03-23 18:46:08 +01:00
|
|
|
case 'static_graph':
|
2010-03-29 20:31:22 +02:00
|
|
|
case 'module_graph':
|
2010-07-26 Miguel de Dios <miguel.dedios@artica.es>
* images/mimetypes/text.png: added lost image file in previous commits about
collections.
*images/tag_red.disabled.png, images/cross.disabled.png,
images/chart_curve.disabled.png, images/config.disabled.png,
images/chart_bar.disabled.png, images/photo.disabled.png,
images/camera.disabled.png, images/binary.disabled.png: added image files
for the new palete buttons (when it are disabled) in visual console editor.
* include/styles/pandora.css: added the styles for the new buttons of
visual console editor (label and icon), and some changes for new style for
buttons of the palete in this page.
* include/functions_html.php: in function "print_button" added new
parameter $imageButton to set the button as image button, by default is
false.
* include/ajax/visual_console_builder.ajax.php,
godmode/reporting/visual_console_builder.editor.js,
godmode/reporting/visual_console_builder.editor.php,
godmode/reporting/visual_console_builder.constans.php: change the buttons
palete for a palete with more small buttons as icon buttons, added new items
for visual map (icon and label). And fixed the dinamic change label color
for any elements.
* include/functions_visual_map.php: added the new items (label and icon)
and cleaned the source code.
Pending task: #3019641
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3061 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-07-26 13:56:04 +02:00
|
|
|
case 'label':
|
|
|
|
case 'icon':
|
2010-03-23 18:46:08 +01:00
|
|
|
$values = array();
|
|
|
|
if ($label !== null) {
|
|
|
|
$values['label'] = $label;
|
|
|
|
}
|
|
|
|
if ($left !== null) {
|
|
|
|
$values['pos_x'] = $left;
|
|
|
|
}
|
|
|
|
if ($top !== null) {
|
|
|
|
$values['pos_y'] = $top;
|
|
|
|
}
|
2010-03-25 17:18:05 +01:00
|
|
|
if ($agent !== null) {
|
|
|
|
$id_agent = get_agent_id($agent);
|
|
|
|
$values['id_agent'] = $id_agent;
|
|
|
|
}
|
2010-03-29 15:58:08 +02:00
|
|
|
if ($id_module !== null) {
|
|
|
|
$values['id_agente_modulo'] = $id_module;
|
2010-03-23 18:46:08 +01:00
|
|
|
}
|
|
|
|
if ($parent !== null) {
|
|
|
|
$values['parent_item'] = $parent;
|
|
|
|
}
|
|
|
|
if ($map_linked !== null) {
|
|
|
|
$values['id_layout_linked'] = $map_linked;
|
|
|
|
}
|
|
|
|
if ($label_color !== null) {
|
|
|
|
$values['label_color'] = $label_color;
|
|
|
|
}
|
2010-03-29 15:58:08 +02:00
|
|
|
switch($type) {
|
2010-03-29 20:31:22 +02:00
|
|
|
case 'module_graph':
|
|
|
|
if ($height_module_graph !== null) {
|
|
|
|
$values['height'] = $height_module_graph;
|
|
|
|
}
|
|
|
|
if ($width_module_graph !== null) {
|
|
|
|
$values['width'] = $width_module_graph;
|
|
|
|
}
|
|
|
|
if ($period !== null) {
|
|
|
|
$values['period'] = $period;
|
|
|
|
}
|
|
|
|
break;
|
2010-03-29 15:58:08 +02:00
|
|
|
case 'percentile_bar':
|
|
|
|
if ($width_percentile !== null) {
|
|
|
|
$values['width'] = $width_percentile;
|
|
|
|
}
|
|
|
|
if ($max_percentile !== null) {
|
|
|
|
$values['height'] = $max_percentile;
|
|
|
|
}
|
|
|
|
break;
|
2010-07-26 Miguel de Dios <miguel.dedios@artica.es>
* images/mimetypes/text.png: added lost image file in previous commits about
collections.
*images/tag_red.disabled.png, images/cross.disabled.png,
images/chart_curve.disabled.png, images/config.disabled.png,
images/chart_bar.disabled.png, images/photo.disabled.png,
images/camera.disabled.png, images/binary.disabled.png: added image files
for the new palete buttons (when it are disabled) in visual console editor.
* include/styles/pandora.css: added the styles for the new buttons of
visual console editor (label and icon), and some changes for new style for
buttons of the palete in this page.
* include/functions_html.php: in function "print_button" added new
parameter $imageButton to set the button as image button, by default is
false.
* include/ajax/visual_console_builder.ajax.php,
godmode/reporting/visual_console_builder.editor.js,
godmode/reporting/visual_console_builder.editor.php,
godmode/reporting/visual_console_builder.constans.php: change the buttons
palete for a palete with more small buttons as icon buttons, added new items
for visual map (icon and label). And fixed the dinamic change label color
for any elements.
* include/functions_visual_map.php: added the new items (label and icon)
and cleaned the source code.
Pending task: #3019641
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3061 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-07-26 13:56:04 +02:00
|
|
|
case 'icon':
|
2010-03-29 15:58:08 +02:00
|
|
|
case 'static_graph':
|
|
|
|
if ($image !== null) {
|
|
|
|
$values['image'] = $image;
|
|
|
|
}
|
|
|
|
if ($width !== null) {
|
|
|
|
$values['width'] = $width;
|
|
|
|
}
|
|
|
|
if ($height !== null) {
|
|
|
|
$values['height'] = $height;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2011-02-18 12:31:09 +01:00
|
|
|
|
|
|
|
if ($action == 'move') {
|
|
|
|
//Don't change the label because only change the positions
|
|
|
|
unset($values['label']);
|
|
|
|
}
|
|
|
|
|
2010-03-25 17:18:05 +01:00
|
|
|
$result = process_sql_update('tlayout_data', $values, array('id' => $id_element));
|
2010-03-23 18:46:08 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 'load':
|
|
|
|
switch ($type) {
|
|
|
|
case 'background':
|
|
|
|
$backgroundFields = get_db_row_filter('tlayout', array('id' => $id_visual_console), array('background', 'height', 'width'));
|
|
|
|
echo json_encode($backgroundFields);
|
|
|
|
break;
|
2010-03-29 15:58:08 +02:00
|
|
|
case 'percentile_bar':
|
2010-03-23 18:46:08 +01:00
|
|
|
case 'static_graph':
|
2010-03-29 20:31:22 +02:00
|
|
|
case 'module_graph':
|
|
|
|
case 'simple_value':
|
2010-07-26 Miguel de Dios <miguel.dedios@artica.es>
* images/mimetypes/text.png: added lost image file in previous commits about
collections.
*images/tag_red.disabled.png, images/cross.disabled.png,
images/chart_curve.disabled.png, images/config.disabled.png,
images/chart_bar.disabled.png, images/photo.disabled.png,
images/camera.disabled.png, images/binary.disabled.png: added image files
for the new palete buttons (when it are disabled) in visual console editor.
* include/styles/pandora.css: added the styles for the new buttons of
visual console editor (label and icon), and some changes for new style for
buttons of the palete in this page.
* include/functions_html.php: in function "print_button" added new
parameter $imageButton to set the button as image button, by default is
false.
* include/ajax/visual_console_builder.ajax.php,
godmode/reporting/visual_console_builder.editor.js,
godmode/reporting/visual_console_builder.editor.php,
godmode/reporting/visual_console_builder.constans.php: change the buttons
palete for a palete with more small buttons as icon buttons, added new items
for visual map (icon and label). And fixed the dinamic change label color
for any elements.
* include/functions_visual_map.php: added the new items (label and icon)
and cleaned the source code.
Pending task: #3019641
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3061 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-07-26 13:56:04 +02:00
|
|
|
case 'label':
|
|
|
|
case 'icon':
|
2010-03-29 20:31:22 +02:00
|
|
|
$elementFields = get_db_row_filter('tlayout_data', array('id' => $id_element));
|
2011-02-16 17:17:45 +01:00
|
|
|
$elementFields['agent_name'] = safe_output(get_agent_name($elementFields['id_agent']));
|
2010-03-30 19:52:52 +02:00
|
|
|
//Make the html of select box of modules about id_agent.
|
2010-03-29 20:31:22 +02:00
|
|
|
if ($elementFields['id_agent'] != 0) {
|
2011-02-16 17:17:45 +01:00
|
|
|
$modules = get_agent_modules($elementFields['id_agent'], false, array('disabled' => 0, 'id_agente' => $elementFields['id_agent']));
|
2010-03-29 20:31:22 +02:00
|
|
|
|
|
|
|
$elementFields['modules_html'] = '<option value="0">--</option>';
|
|
|
|
foreach ($modules as $id => $name) {
|
2011-02-16 17:17:45 +01:00
|
|
|
$elementFields['modules_html'] .= '<option value="' . $id . '">' . safe_output($name) . '</option>';
|
2010-03-29 20:31:22 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$elementFields['modules_html'] = '<option value="0">' . __('Any') . '</option>';
|
|
|
|
}
|
2010-03-30 19:52:52 +02:00
|
|
|
switch ($type) {
|
|
|
|
case 'percentile_bar':
|
|
|
|
$elementFields['width_percentile'] = $elementFields['width'];
|
|
|
|
$elementFields['max_percentile'] = $elementFields['height'];
|
|
|
|
break;
|
|
|
|
case 'module_graph':
|
|
|
|
$elementFields['width_module_graph'] = $elementFields['width'];
|
|
|
|
$elementFields['height_module_graph'] = $elementFields['height'];
|
|
|
|
break;
|
|
|
|
}
|
2010-10-19 17:57:07 +02:00
|
|
|
$elementFields['label'] = safe_output($elementFields['label']);
|
2010-03-23 18:46:08 +01:00
|
|
|
echo json_encode($elementFields);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 'insert':
|
2010-03-29 15:58:08 +02:00
|
|
|
$values = array();
|
|
|
|
$values['id_layout'] = $id_visual_console;
|
|
|
|
$values['label'] = $label;
|
|
|
|
$values['pos_x'] = $left;
|
|
|
|
$values['pos_y'] = $top;
|
|
|
|
if ($agent != '')
|
|
|
|
$values['id_agent'] = get_agent_id($agent);
|
|
|
|
else
|
|
|
|
$values['id_agent'] = 0;
|
|
|
|
$values['id_agente_modulo'] = $id_module;
|
|
|
|
$values['id_layout_linked'] = $map_linked;
|
|
|
|
$values['label_color'] = $label_color;
|
|
|
|
$values['parent_item'] = $parent;
|
2010-03-29 20:31:22 +02:00
|
|
|
$values['no_link_color'] = 1;
|
2010-03-29 15:58:08 +02:00
|
|
|
|
2010-03-23 18:46:08 +01:00
|
|
|
switch ($type) {
|
2010-03-29 20:31:22 +02:00
|
|
|
case 'module_graph':
|
|
|
|
$values['type'] = MODULE_GRAPH;
|
|
|
|
$values['height'] = $height_module_graph;
|
|
|
|
$values['width'] = $width_module_graph;
|
|
|
|
$values['period'] = $period;
|
|
|
|
break;
|
2010-03-29 15:58:08 +02:00
|
|
|
case 'percentile_bar':
|
|
|
|
$values['type'] = PERCENTILE_BAR;
|
|
|
|
$values['width'] = $width_percentile;
|
|
|
|
$values['height'] = $max_percentile;
|
|
|
|
break;
|
2010-03-23 18:46:08 +01:00
|
|
|
case 'static_graph':
|
2010-03-29 15:58:08 +02:00
|
|
|
$values['type'] = STATIC_GRAPH;
|
2010-03-23 18:46:08 +01:00
|
|
|
$values['image'] = $image;
|
2010-03-25 17:18:05 +01:00
|
|
|
$values['width'] = $width;
|
|
|
|
$values['height'] = $height;
|
2010-03-23 18:46:08 +01:00
|
|
|
break;
|
2010-03-29 20:31:22 +02:00
|
|
|
case 'simple_value':
|
|
|
|
$values['type'] = SIMPLE_VALUE;
|
|
|
|
break;
|
2010-07-26 Miguel de Dios <miguel.dedios@artica.es>
* images/mimetypes/text.png: added lost image file in previous commits about
collections.
*images/tag_red.disabled.png, images/cross.disabled.png,
images/chart_curve.disabled.png, images/config.disabled.png,
images/chart_bar.disabled.png, images/photo.disabled.png,
images/camera.disabled.png, images/binary.disabled.png: added image files
for the new palete buttons (when it are disabled) in visual console editor.
* include/styles/pandora.css: added the styles for the new buttons of
visual console editor (label and icon), and some changes for new style for
buttons of the palete in this page.
* include/functions_html.php: in function "print_button" added new
parameter $imageButton to set the button as image button, by default is
false.
* include/ajax/visual_console_builder.ajax.php,
godmode/reporting/visual_console_builder.editor.js,
godmode/reporting/visual_console_builder.editor.php,
godmode/reporting/visual_console_builder.constans.php: change the buttons
palete for a palete with more small buttons as icon buttons, added new items
for visual map (icon and label). And fixed the dinamic change label color
for any elements.
* include/functions_visual_map.php: added the new items (label and icon)
and cleaned the source code.
Pending task: #3019641
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3061 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-07-26 13:56:04 +02:00
|
|
|
case 'label':
|
|
|
|
$values['type'] = LABEL;
|
|
|
|
break;
|
|
|
|
case 'icon':
|
|
|
|
$values['type'] = ICON;
|
|
|
|
$values['image'] = $image;
|
|
|
|
$values['width'] = $width;
|
|
|
|
$values['height'] = $height;
|
|
|
|
break;
|
2010-03-23 18:46:08 +01:00
|
|
|
}
|
2010-03-29 15:58:08 +02:00
|
|
|
$idData = process_sql_insert('tlayout_data', $values);
|
|
|
|
|
|
|
|
$return = array();
|
|
|
|
if ($idData === false) {
|
|
|
|
$return['correct'] = 0;
|
|
|
|
}
|
|
|
|
else {
|
2011-02-16 16:37:55 +01:00
|
|
|
$text = createInternalNameItem($label, $type, $image, $agent, $id_module, $idData);
|
|
|
|
|
2010-03-29 15:58:08 +02:00
|
|
|
$return['correct'] = 1;
|
|
|
|
$return['id_data'] = $idData;
|
2011-02-16 16:37:55 +01:00
|
|
|
$return['text'] = $text;
|
2010-03-29 15:58:08 +02:00
|
|
|
}
|
|
|
|
echo json_encode($return);
|
2010-03-23 18:46:08 +01:00
|
|
|
break;
|
|
|
|
case 'delete':
|
|
|
|
if (process_sql_delete('tlayout_data', array('id' => $id_element, 'id_layout' => $id_visual_console)) === false) {
|
|
|
|
$return['correct'] = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$return['correct'] = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
echo json_encode($return);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
?>
|