2013-02-28 Miguel de Dios <miguel.dedios@artica.es>

* godmode/modules/manage_network_components_form.php,
	include/functions_html.php, operation/menu.php,
	operation/events/events_list.php: improved source code.
	
	* include/functions_events.php: fixed into the function
	"events_get_agent" the query to get criticities.
	
	Fixes: #3606285




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7744 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-02-28 11:57:57 +00:00
parent c441dbb3bb
commit a7a4ebbdc6
6 changed files with 45 additions and 21 deletions

View File

@ -1,3 +1,14 @@
2013-02-28 Miguel de Dios <miguel.dedios@artica.es>
* godmode/modules/manage_network_components_form.php,
include/functions_html.php, operation/menu.php,
operation/events/events_list.php: improved source code.
* include/functions_events.php: fixed into the function
"events_get_agent" the query to get criticities.
Fixes: #3606285
2013-02-28 Sergio Martin <sergio.martin@artica.es> 2013-02-28 Sergio Martin <sergio.martin@artica.es>
* include/functions_io.php * include/functions_io.php

View File

@ -66,8 +66,8 @@ if ($create_network_from_module) {
$warning_instructions = $data_module["warning_instructions"]; $warning_instructions = $data_module["warning_instructions"];
$unknown_instructions = $data_module["unknown_instructions"]; $unknown_instructions = $data_module["unknown_instructions"];
$critical_inverse = $data_module["critical_inverse"]; $critical_inverse = $data_module["critical_inverse"];
$warning_inverse = $data_module["warning_inverse"]; $warning_inverse = $data_module["warning_inverse"];
$id_category = $data_module["id_category"]; $id_category = $data_module["id_category"];
} }
$id_component_type = (int) get_parameter ('id_component_type'); $id_component_type = (int) get_parameter ('id_component_type');

View File

@ -1235,12 +1235,17 @@ function events_get_agent ($id_agent, $period, $date = 0,
$datelimit = $date - $period; $datelimit = $date - $period;
$sql_where = ' AND 1 = 1 '; $sql_where = ' AND 1 = 1 ';
$criticities = array();
if ($filter_event_critical) { if ($filter_event_critical) {
$sql_where .= ' AND criticity = 4 '; $criticities[] = 4;
} }
if ($filter_event_warning) { if ($filter_event_warning) {
$sql_where .= ' AND criticity = 3 '; $criticities[] = 3;
} }
if (!empty($criticities)) {
$sql_where .= ' AND criticity IN (' . implode(', ', $criticities) . ')';
}
if ($filter_event_validated) { if ($filter_event_validated) {
$sql_where .= ' AND estado = 1 '; $sql_where .= ' AND estado = 1 ';
} }
@ -1314,9 +1319,9 @@ function events_get_event_types ($type_id){
case 'normal': $type_desc = __('Monitor Normal'); case 'normal': $type_desc = __('Monitor Normal');
break; break;
case 'alert_fired': $type_desc = __('Alert fired'); case 'alert_fired': $type_desc = __('Alert fired');
break; break;
case 'alert_recovered': $type_desc = __('Alert recovered'); case 'alert_recovered': $type_desc = __('Alert recovered');
break; break;
case 'alert_ceased': $type_desc = __('Alert ceased'); case 'alert_ceased': $type_desc = __('Alert ceased');
break; break;
case 'alert_manual_validation': $type_desc = __('Alert manual validation'); case 'alert_manual_validation': $type_desc = __('Alert manual validation');
@ -1356,19 +1361,24 @@ function events_get_event_types ($type_id){
function events_get_severity_types ($severity_id){ function events_get_severity_types ($severity_id){
$diferent_types = get_priorities (); $diferent_types = get_priorities ();
$severity_desc = ''; $severity_desc = '';
switch ($severity_id) { switch ($severity_id) {
case 0: $severity_desc = __('Maintenance'); case 0:
break; $severity_desc = __('Maintenance');
case 1: $severity_desc = __('Informational'); break;
break; case 1:
case 2: $severity_desc = __('Normal'); $severity_desc = __('Informational');
break; break;
case 3: $severity_desc = __('Warning'); case 2:
break; $severity_desc = __('Normal');
case 4: $severity_desc = __('Critical'); break;
break; case 3:
$severity_desc = __('Warning');
break;
case 4:
$severity_desc = __('Critical');
break;
default: default:
if (isset($config['text_char_long'])) { if (isset($config['text_char_long'])) {
foreach ($diferent_types as $key => $type) { foreach ($diferent_types as $key => $type) {

View File

@ -1343,10 +1343,13 @@ function html_print_table (&$table, $return = false) {
} }
$output .= ' cellpadding="'.$table->cellpadding.'" cellspacing="'.$table->cellspacing.'"'; $output .= ' cellpadding="'.$table->cellpadding.'" cellspacing="'.$table->cellspacing.'"';
$output .= ' border="'.$table->border.'" class="'.$table->class.'" id="'.$tableid.'">'; $output .= ' border="'.$table->border.'" class="'.$table->class.'" id="'.$tableid.'">';
$countcols = 0; $countcols = 0;
if (!empty($table->caption)) { if (!empty($table->caption)) {
$output .= '<caption style="text-align: left"><h4>' . $table->caption . '</h4></caption>'; $output .= '<caption style="text-align: left"><h4>' . $table->caption . '</h4></caption>';
} }
if (!empty ($table->head)) { if (!empty ($table->head)) {
$countcols = count ($table->head); $countcols = count ($table->head);
$output .= '<thead><tr>'; $output .= '<thead><tr>';

View File

@ -494,8 +494,8 @@ $(document).ready( function() {
$("#row_name").css('visibility', 'hidden'); $("#row_name").css('visibility', 'hidden');
$("#submit-update_filter").css('visibility', 'hidden'); $("#submit-update_filter").css('visibility', 'hidden');
$("#id_group").val(0); $("#id_group").val(0);
clear_tags_inputs(); clear_tags_inputs();
} }
// If filter selected then load filter // If filter selected then load filter
else { else {

View File

@ -199,7 +199,7 @@ if (check_acl ($config['id_user'], 0, "AR")) {
if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM")) if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM"))
$own_groups = array_keys(users_get_groups($config['id_user'], "IR")); $own_groups = array_keys(users_get_groups($config['id_user'], "IR"));
else else
$own_groups = array_keys(users_get_groups($config['id_user'], "IR", false)); $own_groups = array_keys(users_get_groups($config['id_user'], "IR", false));
foreach ($gisMaps as $gisMap) { foreach ($gisMaps as $gisMap) {
$is_in_group = in_array($gisMap['group_id'], $own_groups); $is_in_group = in_array($gisMap['group_id'], $own_groups);