2012-12-05 Miguel de Dios <miguel.dedios@artica.es>

* extensions/update_manager/lib/libupdate_manager_client.php,
	extensions/update_manager/lib/libupdate_manager.php,
	operation/agentes/ver_agente.php,
	operation/agentes/status_monitor.php,
	operation/agentes/estado_ultimopaquete.php,
	operation/agentes/estado_agente.php,
	operation/integria_incidents/incident.php,
	operation/reporting/reporting_xml.php,
	godmode/reporting/visual_console_builder.editor.js,
	godmode/reporting/visual_console_builder.wizard.php,
	godmode/reporting/visual_console_builder.elements.php,
	include/functions_visual_map.php,
	include/functions_visual_map_editor.php: uploaded the changes of
	source code style previous to my next commit for to make the next
	commit more easy.
	
	* godmode/reporting/visual_console_builder.php: set empty string
	for the new visualmap.
	
	* include/ajax/visual_console_builder.ajax.php: fixed the regular
	expresion to extract the url for the graph.
	
	* include/functions_html.php: fixed into the function
	"html_print_select_groups" lost code for to show the selectbox.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7230 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2012-12-05 14:20:47 +00:00
parent 99e2e179b4
commit 1b4ab4b9a6
17 changed files with 194 additions and 90 deletions

View File

@ -1,3 +1,30 @@
2012-12-05 Miguel de Dios <miguel.dedios@artica.es>
* extensions/update_manager/lib/libupdate_manager_client.php,
extensions/update_manager/lib/libupdate_manager.php,
operation/agentes/ver_agente.php,
operation/agentes/status_monitor.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/estado_agente.php,
operation/integria_incidents/incident.php,
operation/reporting/reporting_xml.php,
godmode/reporting/visual_console_builder.editor.js,
godmode/reporting/visual_console_builder.wizard.php,
godmode/reporting/visual_console_builder.elements.php,
include/functions_visual_map.php,
include/functions_visual_map_editor.php: uploaded the changes of
source code style previous to my next commit for to make the next
commit more easy.
* godmode/reporting/visual_console_builder.php: set empty string
for the new visualmap.
* include/ajax/visual_console_builder.ajax.php: fixed the regular
expresion to extract the url for the graph.
* include/functions_html.php: fixed into the function
"html_print_select_groups" lost code for to show the selectbox.
2012-12-05 Sergio Martin <sergio.martin@artica.es>
* pandoradb.sql

View File

@ -1291,6 +1291,8 @@ function deleteDB(idElement) {
if (data['correct']) {
$("#parent > option[value=" + idElement + "]").remove();
jQuery.each(lines, function(i, line) {
if ((line['id'] == idElement) || (line['node_begin'] == idElement)) {
lines.splice(i);
@ -1298,6 +1300,8 @@ function deleteDB(idElement) {
});
refresh_lines(lines, 'background', true);
$('#' + idElement).remove();
activeToolboxButton('delete_item', false);
}

View File

@ -308,7 +308,7 @@ if ($action == 'new' || $idVisualConsole === false){
$buttons = array('data' => $buttons['data']); //Show only the data tab
// If it is a fail try, reset the values
$action = 'new';
$visualConsoleName = "";
$visualConsoleName = __("New visual console");
}
$buttons[$activeTab]['active'] = true;

View File

@ -29,11 +29,12 @@ require_once($config['homedir'] . "/include/functions_agents.php");
$table->id = 'wizard_table';
$table->width = '98%';
$table->data = array ();
$table->style = array ();
$table->style[0] = 'font-weight: bold; vertical-align: text-top;';
$table->style[1] = 'font-weight: bold; vertical-align: top;';
$table->style[2] = 'font-weight: bold; vertical-align: top';
$table->size = array ();
$table->size[0] = "20%";
$table->size[1] = "20%";
@ -58,8 +59,7 @@ $type_list = array(
STATIC_GRAPH => __('Static Graph'),
PERCENTILE_BAR => __('Percentile Item'),
MODULE_GRAPH => __('Module graph'),
SIMPLE_VALUE => __('Simple value')
);
SIMPLE_VALUE => __('Simple value'));
$table->rowstyle["all_0"] = 'display: none;';
$table->data["all_0"][0] = __('Type');
@ -75,12 +75,14 @@ $table->data["all_1"][1] = html_print_input_text ('range', 50, '', 5, 5, true);
$table->rowstyle["staticgraph_modulegraph"] = 'display: none;';
$table->data["staticgraph_modulegraph"][0] = __('Size (px)');
$table->data["staticgraph_modulegraph"][1] = __('Width').': '.html_print_input_text ('width', 0, '', 5, 5, true);
$table->data["staticgraph_modulegraph"][1] = __('Width').': ' .
html_print_input_text ('width', 0, '', 5, 5, true);
$table->data["staticgraph_modulegraph"][1] .= '&nbsp;&nbsp;&nbsp;' . __('Height').': '.html_print_input_text ('height', 0, '', 5, 5, true);
$table->rowstyle["modulegraph_simplevalue"] = 'display: none;';
$table->data["modulegraph_simplevalue"][0] = __('Period');
$table->data["modulegraph_simplevalue"][1] = html_print_extended_select_for_time ('period', '', '', '', '', false, true);
$table->data["modulegraph_simplevalue"][1] =
html_print_extended_select_for_time ('period', '', '', '', '', false, true);
$table->rowstyle["simplevalue"] = 'display: none;';
$table->data["simplevalue"][0] = __('Process');
@ -91,15 +93,18 @@ $table->data["simplevalue"][1] = html_print_select (
$table->rowstyle["percentileitem_1"] = 'display: none;';
$table->data["percentileitem_1"][0] = __('Width (px)');
$table->data["percentileitem_1"][1] = html_print_input_text ('percentileitem_width', 0, '', 5, 5, true);
$table->data["percentileitem_1"][1] =
html_print_input_text ('percentileitem_width', 0, '', 5, 5, true);
$table->rowstyle["percentileitem_2"] = 'display: none;';
$table->data["percentileitem_2"][0] = __('Max value');
$table->data["percentileitem_2"][1] = html_print_input_text ('max_value', 0, '', 5, 5, true);
$table->data["percentileitem_2"][1] =
html_print_input_text ('max_value', 0, '', 5, 5, true);
$table->rowstyle["percentileitem_3"] = 'display: none;';
$table->data["percentileitem_3"][0] = __('Type');
$table->data["percentileitem_3"][1] = html_print_radio_button_extended('type_percentile', 'percentile', ('Percentile'), 'percentile', false, '', 'style="float: left;"', true) .
$table->data["percentileitem_3"][1] =
html_print_radio_button_extended('type_percentile', 'percentile', ('Percentile'), 'percentile', false, '', 'style="float: left;"', true) .
html_print_radio_button_extended('type_percentile', 'bubble', ('Bubble'), 'percentile', false, '', 'style="float: left;"', true);
$table->rowstyle["percentileitem_4"] = 'display: none;';
@ -109,8 +114,8 @@ $table->data["percentileitem_4"][1] = html_print_radio_button_extended('value_sh
$table->rowstyle["all_2"] = 'display: none;';
$table->data["all_2"][0] = __('Groups');
$table->data["all_2"][1] = html_print_select_groups($config['id_user'], "AR", true,
'groups', '', '', '', 0, true);
$table->data["all_2"][1] = html_print_select_groups(
$config['id_user'], "AR", true, 'groups', '', '', '', 0, true);
$table->rowstyle["all_one_item_per_agent"] = 'display: none';
$table->data["all_one_item_per_agent"][0] = __('One item per agent');

View File

@ -74,21 +74,31 @@ switch ($action) {
$return['font'] = $config['fontpath'];
echo json_encode($return);
break;
case 'get_image_sparse':
$img = grafico_modulo_sparse($id_agent_module,
$period, false, $width, $height, '', null, false, 1, false, 0, '', 0, 0,
true, true);
preg_match("/src='(.*)'/", $img, $matches);
preg_match("/src=[\'\"](.*)[\'\"]/", $img, $matches);
$url = $matches[1];
echo $url;
break;
case 'get_layout_data':
$layoutData = db_get_row_filter('tlayout_data', array('id' => $id_element));
$layoutData = db_get_row_filter('tlayout_data',
array('id' => $id_element));
echo json_encode($layoutData);
break;
case 'get_module_value':
$unit_text = false;
$layoutData = db_get_row_filter('tlayout_data', array('id' => $id_element));
@ -104,7 +114,9 @@ switch ($action) {
case PERCENTILE_BAR:
case PERCENTILE_BUBBLE:
default:
$returnValue = db_get_sql ('SELECT datos FROM tagente_estado WHERE id_agente_modulo = ' . $layoutData['id_agente_modulo']);
$returnValue = db_get_sql ('SELECT datos
FROM tagente_estado
WHERE id_agente_modulo = ' . $layoutData['id_agente_modulo']);
//html_debug_print($value_show);
//html_debug_print($layoutData);
@ -114,7 +126,9 @@ switch ($action) {
if ($value_show == 'value') {
$returnValue = format_for_graph($returnValue, 2);
$unit_text_db = db_get_sql ('SELECT unit FROM tagente_modulo WHERE id_agente_modulo = ' . $layoutData['id_agente_modulo']);
$unit_text_db = db_get_sql ('SELECT unit
FROM tagente_modulo
WHERE id_agente_modulo = ' . $layoutData['id_agente_modulo']);
$unit_text_db = trim(io_safe_output($unit_text_db));
if ($value_show == 'value') {
@ -129,6 +143,7 @@ switch ($action) {
}
}
break;
}
// Linked to other layout ?? - Only if not module defined
@ -198,6 +213,9 @@ switch ($action) {
echo json_encode($return);
break;
case 'get_color_line':
$layoutData = db_get_row_filter('tlayout_data', array('id' => $id_element));
@ -205,6 +223,9 @@ switch ($action) {
$return['color_line'] = visual_map_get_color_line_status($layoutData);
echo json_encode($return);
break;
case 'get_image':
$layoutData = db_get_row_filter('tlayout_data', array('id' => $id_element));
@ -212,6 +233,9 @@ switch ($action) {
$return['image'] = visual_map_get_image_status_element($layoutData);
echo json_encode($return);
break;
case 'update':
case 'move':
$values = array();
@ -332,6 +356,9 @@ switch ($action) {
break;
}
break;
case 'load':
switch ($type) {
case 'background':
@ -345,7 +372,8 @@ switch ($action) {
case 'simple_value':
case 'label':
case 'icon':
$elementFields = db_get_row_filter('tlayout_data', array('id' => $id_element));
$elementFields = db_get_row_filter('tlayout_data',
array('id' => $id_element));
$elementFields['agent_name'] = io_safe_output(agents_get_name($elementFields['id_agent']));
//Make the html of select box of modules about id_agent.
if ($elementFields['id_agent'] != 0) {
@ -378,10 +406,12 @@ switch ($action) {
$elementFields['type_percentile'] = 'bubble';
}
break;
case 'module_graph':
$elementFields['width_module_graph'] = $elementFields['width'];
$elementFields['height_module_graph'] = $elementFields['height'];
break;
}
//Support for max, min and svg process on simple value items
if ($type == 'simple_value') {
@ -400,14 +430,19 @@ switch ($action) {
break;
}
}
$elementFields['label'] = io_safe_output($elementFields['label']);
echo json_encode($elementFields);
break;
default:
enterprise_hook("enterprise_ajax_load_values", array($type, $id_element));
break;
}
break;
case 'insert':
$values = array();
$values['id_layout'] = $id_visual_console;
@ -484,6 +519,9 @@ switch ($action) {
}
echo json_encode($return);
break;
case 'delete':
if (db_process_sql_delete('tlayout_data', array('id' => $id_element, 'id_layout' => $id_visual_console)) === false) {
$return['correct'] = 0;
@ -494,6 +532,9 @@ switch ($action) {
echo json_encode($return);
break;
case 'get_original_size_background':
$replace = strlen($config["homeurl"] . '/');
@ -504,9 +545,15 @@ switch ($action) {
echo json_encode($size);
break;
default:
enterprise_hook("enterprise_visualmap_ajax");
break;
}
/* visual map element status check */

View File

@ -211,14 +211,19 @@ function html_print_select_groups($id_user = false, $privilege = "AR", $returnAl
$multiple = false, $sort = true, $class = '', $disabled = false, $style = false, $option_style = false, $id_group = false) {
global $config;
$fields = users_get_groups_for_select($id_user, $privilege, $returnAllGroup, true, $id_group);
$fields = users_get_groups_for_select($id_user, $privilege,
$returnAllGroup, true, $id_group);
$output = html_print_select ($fields, $name, $selected, $script, $nothing, $nothing_value,
$return, $multiple, false, $class, $disabled, $style, $option_style);
$output = html_print_select ($fields, $name, $selected, $script,
$nothing, $nothing_value, $return, $multiple, false, $class,
$disabled, $style, $option_style);
if ($return) {
return $output;
}
else {
echo $output;
}
}
/**

View File

@ -120,6 +120,7 @@ function visual_map_print_item($layoutData) {
echo $text;
echo "</div>";
break;
case PERCENTILE_BAR:
case PERCENTILE_BUBBLE:
$module_value = db_get_sql ('SELECT datos FROM tagente_estado WHERE id_agente_modulo = ' . $id_module);
@ -128,7 +129,9 @@ function visual_map_print_item($layoutData) {
$value_text = false;
}
elseif ($layoutData['image'] == 'value') {
$unit_text = db_get_sql ('SELECT unit FROM tagente_modulo WHERE id_agente_modulo = ' . $id_module);
$unit_text = db_get_sql ('SELECT unit
FROM tagente_modulo
WHERE id_agente_modulo = ' . $id_module);
$unit_text = trim(io_safe_output($unit_text));
$value_text = format_for_graph($module_value, 2);
@ -157,6 +160,7 @@ function visual_map_print_item($layoutData) {
echo '</div>';
break;
case MODULE_GRAPH:
$img = grafico_modulo_sparse($id_module, $period, 0, $width,
$height, '', null, false, 1, false, 0, '', 0, 0, true, true);
@ -725,11 +729,13 @@ function visual_map_get_status_element($layoutData) {
$id_agent = 0;
}
break;
default:
//If it's a graph, a progress bar or a data tag, ALWAYS report status OK
//(=0) to avoid confussions here.
$status = VISUAL_MAP_STATUS_NORMAL;
break;
}
}

View File

@ -112,7 +112,8 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
$params['size'] = 20;
$params['selectbox_id'] = 'module';
$params['javascript_is_function_select'] = true;
$form_items['agent_row']['html'] .= '<td>' . ui_print_agent_autocomplete_input($params);
$form_items['agent_row']['html'] .= '<td>' .
ui_print_agent_autocomplete_input($params);

View File

@ -387,7 +387,8 @@ foreach ($modules as $module) {
}
$nombre_grupomodulo = modules_get_modulegroup_name ($module["id_module_group"]);
if ($nombre_grupomodulo != "") {
if (($label_group == 0) || ($last_label != $nombre_grupomodulo)){ // Show label module group
// Show label module group
if (($label_group == 0) || ($last_label != $nombre_grupomodulo)) {
$label_group = -1;
$last_label = $nombre_grupomodulo;
$texto = $texto. "

View File

@ -60,7 +60,8 @@ if (is_ajax ()) {
}
$filter = " WHERE id_grupo IN (". implode(',', $groups) .")";
$agents = db_get_all_rows_sql("SELECT id_agente, nombre FROM tagente". $filter);
$agents = db_get_all_rows_sql("SELECT id_agente, nombre
FROM tagente" . $filter);
echo json_encode($agents);
return;

View File

@ -97,7 +97,8 @@ if($update_incident == 1) {
if ($result_array['data']) {
ui_print_success_message (__("Incident updated"));
} else {
}
else {
ui_print_error_message (__("There was a problem updating the incident, please check if any field was modified and the values are correct."));
}
}
@ -123,7 +124,8 @@ if($create_incident == 1) {
if ($result_array['data']) {
ui_print_success_message (__("Incident created"));
} else {
}
else {
ui_print_error_message (__("There was a problem creating incident"));
}
}
@ -152,7 +154,8 @@ if($attach_file == 1) {
if ($result_array['data'] == 0) {
ui_print_success_message (__("File uploaded"));
} else {
}
else {
ui_print_error_message (__("There was a problem uploading file"));
}
}
@ -187,7 +190,8 @@ if($delete_file != 0 && !$attach_file) {
if ($result_array['data'] == 0 || $result_array['data'] == -2) {
ui_print_success_message (__("File deleted"));
} else if ($result_array['data'] == -1) {
}
else if ($result_array['data'] == -1) {
ui_print_error_message (__("You user doesn't have enough rights to delete this file"));
}
}
@ -204,7 +208,8 @@ if($delete_incident != 0) {
if ($result_array['data']) {
ui_print_success_message (__("Incident deleted"));
} else {
}
else {
ui_print_error_message (__("There was a problem deteling incident"));
}
}
@ -230,7 +235,8 @@ if($create_workunit == 1) {
if ($result_array['data']) {
ui_print_success_message (__("Workunit added"));
} else {
}
else {
ui_print_error_message (__("There was a problem adding workunit"));
}
}
@ -262,7 +268,8 @@ switch($tab) {
//Request incident information if any
if ($id_incident) {
$url = $integria_api."&op=get_incident_details&params=".$id_incident;
} else {
}
else {
$url = $integria_api."&op=get_incident_details";
}
$url_resolutions = $integria_api."&op=get_incidents_resolutions";