2012-11-05 Miguel de Dios <miguel.dedios@artica.es>
* operation/events/events.php: cleaned source code style. * operation/events/events_list.php: cleaned source code style and fixed the lost id_agent when reload. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7129 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
cdabd8f2fd
commit
32fd0fd87c
|
@ -1,3 +1,10 @@
|
|||
2012-11-05 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* operation/events/events.php: cleaned source code style.
|
||||
|
||||
* operation/events/events_list.php: cleaned source code style and
|
||||
fixed the lost id_agent when reload.
|
||||
|
||||
2012-11-05 Vanessa Gil <vanessa.gil@artica.es>
|
||||
|
||||
* operation/reporting/reporting_xml.php: Moved functions
|
||||
|
|
|
@ -93,7 +93,8 @@ if (is_ajax ()) {
|
|||
alerts_agent_module_standby ($event['id_alert_am'], 0);
|
||||
}
|
||||
|
||||
$return = events_validate_event ($id, $similars, $comment, $new_status);
|
||||
$return = events_validate_event ($id, $similars, $comment,
|
||||
$new_status);
|
||||
if ($return)
|
||||
echo 'ok';
|
||||
else
|
||||
|
@ -123,25 +124,31 @@ if (is_ajax ()) {
|
|||
$type = array();
|
||||
$alert = get_parameter('alert_fired');
|
||||
if ($alert == 'true') {
|
||||
$resultAlert = alerts_get_event_status_group($idGroup, 'alert_fired', $query);
|
||||
$resultAlert = alerts_get_event_status_group($idGroup,
|
||||
'alert_fired', $query);
|
||||
}
|
||||
$critical = get_parameter('critical');
|
||||
if ($critical == 'true') {
|
||||
$resultCritical = alerts_get_event_status_group($idGroup, 'going_up_critical', $query);
|
||||
$resultCritical = alerts_get_event_status_group($idGroup,
|
||||
'going_up_critical', $query);
|
||||
}
|
||||
$warning = get_parameter('warning');
|
||||
if ($warning == 'true') {
|
||||
$resultWarning = alerts_get_event_status_group($idGroup, 'going_up_warning', $query);
|
||||
$resultWarning = alerts_get_event_status_group($idGroup,
|
||||
'going_up_warning', $query);
|
||||
}
|
||||
|
||||
if ($resultAlert) {
|
||||
$return = array('fired' => $resultAlert, 'sound' => $config['sound_alert']);
|
||||
$return = array('fired' => $resultAlert,
|
||||
'sound' => $config['sound_alert']);
|
||||
}
|
||||
else if ($resultCritical) {
|
||||
$return = array('fired' => $resultCritical, 'sound' => $config['sound_critical']);
|
||||
$return = array('fired' => $resultCritical,
|
||||
'sound' => $config['sound_critical']);
|
||||
}
|
||||
else if ($resultWarning) {
|
||||
$return = array('fired' => $resultWarning, 'sound' => $config['sound_warning']);
|
||||
$return = array('fired' => $resultWarning,
|
||||
'sound' => $config['sound_warning']);
|
||||
}
|
||||
else {
|
||||
$return = array('fired' => 0);
|
||||
|
@ -254,7 +261,8 @@ if ($config["pure"] == 0) {
|
|||
break;
|
||||
}
|
||||
|
||||
ui_print_page_header (__("Events"), "images/lightning_go.png", false, "eventview", false, $onheader);
|
||||
ui_print_page_header (__("Events"), "images/lightning_go.png",
|
||||
false, "eventview", false, $onheader);
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
|
@ -269,7 +277,6 @@ if ($config["pure"] == 0) {
|
|||
function openURLTagWindow(url) {
|
||||
window.open(url, '','width=300, height=300, toolbar=no, location=no, directories=no, status=no, menubar=no');
|
||||
}
|
||||
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
|
@ -280,7 +287,8 @@ else {
|
|||
echo " ";
|
||||
|
||||
echo '<a target="_top" href="' . $url . '&pure=0">';
|
||||
html_print_image ("images/normalscreen.png", false, array ("title" => __('Back to normal mode')));
|
||||
html_print_image ("images/normalscreen.png", false,
|
||||
array("title" => __('Back to normal mode')));
|
||||
echo '</a>';
|
||||
echo "</h2>";
|
||||
}
|
||||
|
@ -314,7 +322,8 @@ if ($validate) {
|
|||
}
|
||||
|
||||
if (isset($ids[0]) && $ids[0] != -1) {
|
||||
$return = events_validate_event ($ids, ($group_rep == 1), $comment, $new_status);
|
||||
$return = events_validate_event ($ids, ($group_rep == 1),
|
||||
$comment, $new_status);
|
||||
if ($new_status == 1) {
|
||||
ui_print_result_message ($return,
|
||||
__('Successfully validated'),
|
||||
|
@ -472,7 +481,9 @@ $(document).ready( function() {
|
|||
$("#status_img_"+id).attr ("alt", <?php echo "'" . __('Event validated') . "'"; ?>);
|
||||
|
||||
// Remove row due to new state
|
||||
if (($("#status").val() == 2) || ($("#status").val() == 0) || ($("#status").val() == 3)){
|
||||
if (($("#status").val() == 2)
|
||||
|| ($("#status").val() == 0)
|
||||
|| ($("#status").val() == 3)) {
|
||||
|
||||
$.each($tr, function(index, value) {
|
||||
row = value;
|
||||
|
@ -630,7 +641,6 @@ $(document).ready( function() {
|
|||
}
|
||||
}
|
||||
});
|
||||
/* ]]> */
|
||||
|
||||
function toggleCommentForm(id_event) {
|
||||
display = $('.event_form_' + id_event).css('display');
|
||||
|
@ -707,7 +717,8 @@ $(document).ready( function() {
|
|||
$("#status_img_"+id).attr ("alt", <?php echo "'" . __('Event in process') . "'"; ?>);
|
||||
|
||||
// Remove row due to new state
|
||||
if (($("#status").val() == 0) || ($("#status").val() == 1)){
|
||||
if (($("#status").val() == 0)
|
||||
|| ($("#status").val() == 1)) {
|
||||
|
||||
$.each($tr, function(index, value) {
|
||||
row = value;
|
||||
|
@ -753,4 +764,5 @@ $(document).ready( function() {
|
|||
<?php
|
||||
}
|
||||
?>
|
||||
/* ]]> */
|
||||
</script>
|
|
@ -175,7 +175,8 @@ if ($search != "") {
|
|||
if ($event_type != "") {
|
||||
// If normal, warning, could be several (going_up_warning, going_down_warning... too complex
|
||||
// for the user so for him is presented only "warning, critical and normal"
|
||||
if ($event_type == "warning" || $event_type == "critical" || $event_type == "normal") {
|
||||
if ($event_type == "warning" || $event_type == "critical"
|
||||
|| $event_type == "normal") {
|
||||
$sql_post .= " AND event_type LIKE '%$event_type%' ";
|
||||
}
|
||||
elseif ($event_type == "not_normal") {
|
||||
|
@ -292,7 +293,8 @@ html_print_select ($fields, 'status', $status, '', '', '');
|
|||
echo "</td></tr><tr>";
|
||||
|
||||
// Free search
|
||||
echo "<td>".__('Free search')."</td><td>";
|
||||
echo "<td>" . __('Free search') . "</td>";
|
||||
echo "<td>";
|
||||
html_print_input_text ('search', io_safe_output($search), '', 15);
|
||||
echo '</td>';
|
||||
|
||||
|
@ -305,6 +307,7 @@ $params['input_name'] = 'text_agent';
|
|||
$params['print_hidden_input_idagent'] = true;
|
||||
$params['hidden_input_idagent_name'] = 'id_agent';
|
||||
$params['value'] = $text_agent;
|
||||
$params['hidden_input_idagent_value'] = $id_agent;
|
||||
ui_print_agent_autocomplete_input($params);
|
||||
echo '</td>';
|
||||
|
||||
|
@ -691,7 +694,6 @@ foreach ($result as $event) {
|
|||
$data[$i] .= '<span class="'.$myclass.'" style="font-size: 7.5pt;">' . ui_print_truncate_text (io_safe_output($event["evento"]), 160) . '</span>';
|
||||
$data[$i] .= '</a></span>';
|
||||
$i++;
|
||||
|
||||
}
|
||||
|
||||
if (in_array('id_agente', $show_fields)) {
|
||||
|
@ -913,8 +915,7 @@ unset ($table);
|
|||
?>
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
/*
|
||||
<![CDATA[ */
|
||||
/*<![CDATA[ */
|
||||
$(document).ready( function() {
|
||||
// Don't collapse filter if update button has been pushed
|
||||
if ($("#hidden-toogle_filter").val() == 'false'){
|
||||
|
|
Loading…
Reference in New Issue