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:
parent
99e2e179b4
commit
1b4ab4b9a6
|
@ -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
|
||||
|
|
|
@ -171,7 +171,7 @@ function um_db_delete_package ($id_package) {
|
|||
return true;
|
||||
}
|
||||
|
||||
function um_db_get_package ($id_package) {
|
||||
function um_db_get_package ($id_package) {
|
||||
$result = db_process_sql ('SELECT * FROM '.DB_PREFIX.'tupdate_package WHERE id = ' . $id_package . ' LIMIT 1');
|
||||
if ($result === false) {
|
||||
echo '<strong>Error getting package info</strong><br />';
|
||||
|
|
|
@ -171,7 +171,7 @@ function um_client_db_save_package ($package, $settings) {
|
|||
return true;
|
||||
}
|
||||
|
||||
function um_client_db_save_update ($update) {
|
||||
function um_client_db_save_update ($update) {
|
||||
$fields = get_object_vars ($update);
|
||||
|
||||
$fields['data'] = base64_encode($fields['data']);
|
||||
|
|
|
@ -56,7 +56,7 @@ function cancel_button_palette_callback() {
|
|||
}
|
||||
}
|
||||
|
||||
function update_button_palette_callback() {
|
||||
function update_button_palette_callback() {
|
||||
var values = {};
|
||||
|
||||
values = readFields();
|
||||
|
@ -388,7 +388,7 @@ function loadFieldsFromDB(item) {
|
|||
if (key == 'height') $("input[name=height]").val(val);
|
||||
if (key == 'label') $("input[name=label]").val(val);
|
||||
if (key == 'enable_link') $("input[name=enable_link]").val(val);
|
||||
|
||||
|
||||
if (key == 'image') {
|
||||
//Load image preview
|
||||
$("select[name=image]").val(val);
|
||||
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ foreach ($all_images as $image_file) {
|
|||
}
|
||||
|
||||
$table->width = '100%';
|
||||
$table->head = array ();
|
||||
$table->head = array();
|
||||
$table->head['icon'] = '';
|
||||
$table->head[0] = __('Label') . ' / ' . __('Agent');
|
||||
$table->head[1] = __('Image') . ' / ' . __('Module');
|
||||
|
|
|
@ -304,11 +304,11 @@ $buttons = array(
|
|||
'text' => '<a href="index.php?sec=reporting&sec2=operation/visual_console/render_view&id=' . $idVisualConsole . '&refr=' . $view_refresh . '">' .
|
||||
html_print_image ("images/eye.png", true, array ("title" => __('View'))) .'</a>'),);
|
||||
|
||||
if ($action == 'new' || $idVisualConsole === false){
|
||||
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;
|
||||
|
|
|
@ -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] .= ' ' . __('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');
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -194,7 +194,7 @@ function html_print_select_style ($fields, $name, $selected = '', $style='', $sc
|
|||
* @param array Array with dropdown values. Example: $fields["value"] = "label"
|
||||
* @param string Select form name
|
||||
* @param variant Current selected value. Can be a single value or an
|
||||
* array of selected values (in combination with multiple)
|
||||
* array of selected values (in combination with multiple)
|
||||
* @param string Javascript onChange code.
|
||||
* @param string Label when nothing is selected.
|
||||
* @param variant Value when nothing is selected
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -229,7 +234,7 @@ function html_print_select_groups($id_user = false, $privilege = "AR", $returnAl
|
|||
* @param array Array with dropdown values. Example: $fields["value"] = "label"
|
||||
* @param string Select form name
|
||||
* @param variant Current selected value. Can be a single value or an
|
||||
* array of selected values (in combination with multiple)
|
||||
* array of selected values (in combination with multiple)
|
||||
* @param string Javascript onChange code.
|
||||
* @param string Label when nothing is selected.
|
||||
* @param variant Value when nothing is selected
|
||||
|
|
|
@ -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;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -390,25 +390,25 @@ $table->head[0] = __('Agent'). ' ' .
|
|||
'<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=' . $refr . '&offset=' . $offset . '&group_id=' . $group_id . '&recursion=' . $recursion . '&search=' . $search . '&status='. $status . '&sort_field=name&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown, "alt" => "down")) . '</a>';
|
||||
$table->head[1] = __('Description');
|
||||
$table->head[2] = __('OS'). ' ' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=' . $refr . '&offset=' . $offset . '&group_id=' . $group_id . '&recursion=' . $recursion . '&search=' . $search . '&status='. $status . '&sort_field=os&sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectOsUp, "alt" => "up")) . '</a>' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=' . $refr . '&offset=' . $offset . '&group_id=' . $group_id . '&recursion=' . $recursion . '&search=' . $search . '&status='. $status . '&sort_field=os&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectOsDown, "alt" => "down")) . '</a>';
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=' . $refr . '&offset=' . $offset . '&group_id=' . $group_id . '&recursion=' . $recursion . '&search=' . $search . '&status='. $status . '&sort_field=os&sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectOsUp, "alt" => "up")) . '</a>' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=' . $refr . '&offset=' . $offset . '&group_id=' . $group_id . '&recursion=' . $recursion . '&search=' . $search . '&status='. $status . '&sort_field=os&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectOsDown, "alt" => "down")) . '</a>';
|
||||
$table->head[3] = __('Interval'). ' ' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=' . $refr . '&offset=' . $offset . '&group_id=' . $group_id . '&recursion=' . $recursion . '&search=' . $search . '&status='. $status . '&sort_field=interval&sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectIntervalUp, "alt" => "up")) . '</a>' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=' . $refr . '&offset=' . $offset . '&group_id=' . $group_id . '&recursion=' . $recursion . '&search=' . $search . '&status='. $status . '&sort_field=interval&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectIntervalDown, "alt" => "down")) . '</a>';
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=' . $refr . '&offset=' . $offset . '&group_id=' . $group_id . '&recursion=' . $recursion . '&search=' . $search . '&status='. $status . '&sort_field=interval&sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectIntervalUp, "alt" => "up")) . '</a>' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=' . $refr . '&offset=' . $offset . '&group_id=' . $group_id . '&recursion=' . $recursion . '&search=' . $search . '&status='. $status . '&sort_field=interval&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectIntervalDown, "alt" => "down")) . '</a>';
|
||||
$table->head[4] = __('Group'). ' ' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=' . $refr . '&offset=' . $offset . '&group_id=' . $group_id . '&recursion=' . $recursion . '&search=' . $search . '&status='. $status . '&sort_field=group&sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectGroupUp, "alt" => "up")) . '</a>' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=' . $refr . '&offset=' . $offset . '&group_id=' . $group_id . '&recursion=' . $recursion . '&search=' . $search . '&status='. $status . '&sort_field=group&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectGroupDown, "alt" => "down")) . '</a>';
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=' . $refr . '&offset=' . $offset . '&group_id=' . $group_id . '&recursion=' . $recursion . '&search=' . $search . '&status='. $status . '&sort_field=group&sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectGroupUp, "alt" => "up")) . '</a>' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=' . $refr . '&offset=' . $offset . '&group_id=' . $group_id . '&recursion=' . $recursion . '&search=' . $search . '&status='. $status . '&sort_field=group&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectGroupDown, "alt" => "down")) . '</a>';
|
||||
$table->head[5] = __('Modules');
|
||||
$table->head[6] = __('Status');
|
||||
$table->head[7] = __('Alerts');
|
||||
$table->head[8] = __('Last contact'). ' ' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=' . $refr . '&offset=' . $offset . '&group_id=' . $group_id . '&recursion=' . $recursion . '&search=' . $search . '&status='. $status . '&sort_field=last_contact&sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectLastContactUp, "alt" => "up")) . '</a>' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=' . $refr . '&offset=' . $offset . '&group_id=' . $group_id . '&recursion=' . $recursion . '&search=' . $search . '&status='. $status . '&sort_field=last_contact&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectLastContactDown, "alt" => "down")) . '</a>';
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=' . $refr . '&offset=' . $offset . '&group_id=' . $group_id . '&recursion=' . $recursion . '&search=' . $search . '&status='. $status . '&sort_field=last_contact&sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectLastContactUp, "alt" => "up")) . '</a>' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=' . $refr . '&offset=' . $offset . '&group_id=' . $group_id . '&recursion=' . $recursion . '&search=' . $search . '&status='. $status . '&sort_field=last_contact&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectLastContactDown, "alt" => "down")) . '</a>';
|
||||
|
||||
$table->align = array ();
|
||||
|
||||
|
||||
//Only for AW flag
|
||||
if (check_acl ($config["id_user"], $group_id, "AW")) {
|
||||
if (check_acl ($config["id_user"], $group_id, "AW")) {
|
||||
$table->head[9] = __('R');
|
||||
$table->align[9] = "center";
|
||||
$table->head[10] = __('Delete');
|
||||
|
|
|
@ -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. "
|
||||
|
@ -415,7 +416,7 @@ foreach ($modules as $module) {
|
|||
echo $intervalo_agente;
|
||||
$real_interval = $intervalo_agente;
|
||||
}
|
||||
|
||||
|
||||
if (($module["id_tipo_modulo"] != 3)
|
||||
AND ($module["id_tipo_modulo"] != 10)
|
||||
AND ($module["id_tipo_modulo"] != 17)
|
||||
|
|
|
@ -842,7 +842,7 @@ $table->head[8] = __('Warn');
|
|||
$table->align[8] = "left";
|
||||
|
||||
$table->head[9] = __('Data');
|
||||
if (! defined ('METACONSOLE')) {
|
||||
if (! defined ('METACONSOLE')) {
|
||||
$table->head[9] .= ' <a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=' . $refr . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . '&sort_field=data&sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectDataUp, "alt" => "up")) . '</a>' .
|
||||
'<a href="index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=' . $refr . '&offset=' . $offset . '&ag_group=' . $ag_group . '&ag_freestring=' . $ag_freestring . '&ag_modulename=' . $ag_modulename . '&status=' . $status . '&sort_field=data&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectDataDown, "alt" => "down")) . '</a>';
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
@ -215,7 +216,7 @@ if (is_ajax ()) {
|
|||
|
||||
// Add elements to array
|
||||
if (!empty($temp)) {
|
||||
|
||||
|
||||
// Add agent and server
|
||||
foreach ($temp as $element_key => $element_value) {
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ $buttons[$tab]['active'] = true;
|
|||
|
||||
ui_print_page_header (__('Incident management'), "images/book_edit.png", false, "", false, $buttons);
|
||||
|
||||
if($update_incident == 1) {
|
||||
if($update_incident == 1) {
|
||||
$values[0] = $id_incident;
|
||||
$values[1] = urlencode(io_safe_output(get_parameter('title')));
|
||||
$values[2] = urlencode(io_safe_output(get_parameter('description')));
|
||||
|
@ -85,9 +85,9 @@ if($update_incident == 1) {
|
|||
$values[7] = get_parameter('resolution');
|
||||
$values[8] = get_parameter('status');
|
||||
$values[9] = get_parameter('id_user_assigned');
|
||||
|
||||
|
||||
$params = implode($token, $values);
|
||||
|
||||
|
||||
$url = $integria_api."&op=update_incident&token=".$token."¶ms=".$params;
|
||||
|
||||
// Call the integria API
|
||||
|
@ -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."));
|
||||
}
|
||||
}
|
||||
|
@ -113,9 +114,9 @@ if($create_incident == 1) {
|
|||
$values[4] = $config['integria_inventory'];
|
||||
|
||||
$params = implode($token, $values);
|
||||
|
||||
|
||||
$url = $integria_api."&op=create_incident&token=".$token."¶ms=".$params;
|
||||
|
||||
|
||||
// Call the integria API
|
||||
$result = incidents_call_api($url);
|
||||
|
||||
|
@ -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"));
|
||||
}
|
||||
}
|
||||
|
@ -142,76 +144,79 @@ if($attach_file == 1) {
|
|||
|
||||
|
||||
$params = implode($token, $values);
|
||||
|
||||
|
||||
$url = $integria_api."&op=attach_file&token=".$token;
|
||||
|
||||
|
||||
// Call the integria API
|
||||
$result = incidents_call_api($url, array('params' => $params));
|
||||
|
||||
|
||||
$result_array = incidents_xml_to_array($result);
|
||||
|
||||
|
||||
if ($result_array['data'] == 0) {
|
||||
ui_print_success_message (__("File uploaded"));
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
ui_print_error_message (__("There was a problem uploading file"));
|
||||
}
|
||||
}
|
||||
else {
|
||||
switch ($_FILES['new_file']['error']) {
|
||||
case 1:
|
||||
ui_print_error_message (__('File is too big'));
|
||||
break;
|
||||
case 3:
|
||||
ui_print_error_message (__('File was partially uploaded. Please try again'));
|
||||
break;
|
||||
case 4:
|
||||
ui_print_error_message (__('No file was uploaded'));
|
||||
break;
|
||||
default:
|
||||
ui_print_error_message (__('Generic upload error').'(Code: '.$_FILES['new_file']['error'].')');
|
||||
case 1:
|
||||
ui_print_error_message (__('File is too big'));
|
||||
break;
|
||||
case 3:
|
||||
ui_print_error_message (__('File was partially uploaded. Please try again'));
|
||||
break;
|
||||
case 4:
|
||||
ui_print_error_message (__('No file was uploaded'));
|
||||
break;
|
||||
default:
|
||||
ui_print_error_message (__('Generic upload error').'(Code: '.$_FILES['new_file']['error'].')');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$delete_file = get_parameter('delete_file', 0);
|
||||
|
||||
if($delete_file != 0 && !$attach_file) {
|
||||
if ($delete_file != 0 && !$attach_file) {
|
||||
$url = $integria_api."&op=delete_file¶ms=".$delete_file;
|
||||
|
||||
|
||||
// Call the integria API
|
||||
$result = incidents_call_api($url);
|
||||
|
||||
$result = incidents_call_api($url);
|
||||
|
||||
|
||||
$result_array = incidents_xml_to_array($result);
|
||||
|
||||
|
||||
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"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$delete_incident = get_parameter('delete_incident', 0);
|
||||
|
||||
if($delete_incident != 0) {
|
||||
if ($delete_incident != 0) {
|
||||
$url = $integria_api."&op=delete_incident¶ms=".$delete_incident;
|
||||
|
||||
|
||||
// Call the integria API
|
||||
$result = incidents_call_api($url);
|
||||
|
||||
|
||||
$result_array = incidents_xml_to_array($result);
|
||||
|
||||
|
||||
if ($result_array['data']) {
|
||||
ui_print_success_message (__("Incident deleted"));
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
ui_print_error_message (__("There was a problem deteling incident"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$create_workunit = get_parameter('create_workunit', 0);
|
||||
|
||||
if($create_workunit == 1) {
|
||||
if ($create_workunit == 1) {
|
||||
$values[0] = $id_incident;
|
||||
$values[1] = str_replace(" ", "%20", io_safe_output(get_parameter('description')));
|
||||
$values[2] = get_parameter('time_used');
|
||||
|
@ -222,23 +227,24 @@ if($create_workunit == 1) {
|
|||
$params = implode($token, $values);
|
||||
|
||||
$url = $integria_api."&op=create_workunit&token=".$token."¶ms=".$params;
|
||||
|
||||
|
||||
// Call the integria API
|
||||
$result = incidents_call_api($url);
|
||||
|
||||
$result_array = incidents_xml_to_array($result);
|
||||
|
||||
|
||||
if ($result_array['data']) {
|
||||
ui_print_success_message (__("Workunit added"));
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
ui_print_error_message (__("There was a problem adding workunit"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$params = array();
|
||||
|
||||
// Set the url with parameters to call the api
|
||||
switch($tab) {
|
||||
switch ($tab) {
|
||||
case 'list':
|
||||
|
||||
$search_string = get_parameter('search_string', "");
|
||||
|
@ -262,7 +268,8 @@ switch($tab) {
|
|||
//Request incident information if any
|
||||
if ($id_incident) {
|
||||
$url = $integria_api."&op=get_incident_details¶ms=".$id_incident;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$url = $integria_api."&op=get_incident_details";
|
||||
}
|
||||
$url_resolutions = $integria_api."&op=get_incidents_resolutions";
|
||||
|
@ -282,7 +289,7 @@ switch($tab) {
|
|||
break;
|
||||
}
|
||||
|
||||
if(isset($url)) {
|
||||
if (isset($url)) {
|
||||
// Call the integria API
|
||||
$xml = incidents_call_api($url);
|
||||
}
|
||||
|
@ -291,7 +298,7 @@ else {
|
|||
}
|
||||
|
||||
// If is a valid XML, parse it
|
||||
if(xml_parse(xml_parser_create(), $xml)) {
|
||||
if (xml_parse(xml_parser_create(), $xml)) {
|
||||
// Check if xml is empty
|
||||
if($xml == "<xml>\n</xml>\n") {
|
||||
$result = false;
|
||||
|
|
|
@ -21,8 +21,8 @@ include_once ('include/functions_xml.php');
|
|||
enterprise_include_once ('include/functions_metaconsole.php');
|
||||
|
||||
function xml_array ($array, $buffer_file = array()) {
|
||||
|
||||
foreach ($array as $name => $value) {
|
||||
|
||||
foreach ($array as $name => $value) {
|
||||
//si coincide con el nivel de anidación y existe el fichero
|
||||
$file_to_print = false;
|
||||
if(isset($buffer_file[$name]) && file_exists($buffer_file[$name])) {
|
||||
|
|
Loading…
Reference in New Issue