2011-11-28 Juan Manuel Ramon <juanmanuel.ramon@artica.es>

* operation/events/events_list.php
	 operation/events/events.php: Added tag url popup, new style in 
	 extended event table and new fields.  



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5184 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
juanmanuelr 2011-11-28 13:22:22 +00:00
parent 2010058251
commit 72322d6f01
3 changed files with 71 additions and 12 deletions

View File

@ -1,3 +1,9 @@
2011-11-28 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* operation/events/events_list.php
operation/events/events.php: Added tag url popup, new style in
extended event table and new fields.
2011-11-28 Sergio Martin <sergio.martin@artica.es>
* include/functions_config.php: Clean deprecated lock policies

View File

@ -215,6 +215,11 @@ if ($config["pure"] == 0) {
window.open(url, '<?php __('Sound Alerts'); ?>','width=300, height=300, toolbar=no, location=no, directories=no, status=no, menubar=no');
}
function openURLTagWindow(url) {
window.open(url, url,'width=300, height=300, toolbar=no, location=no, directories=no, status=no, menubar=no');
}
</script>
<?php
}

View File

@ -491,8 +491,9 @@ foreach ($result as $event) {
$data[4] .= '</a>&nbsp;';
}
else {
$data[4] .= html_print_image ("images/tick.png", true,
array ("title" => __('Event validated'))).'&nbsp;';
/* $data[4] .= html_print_image ("images/tick.png", true,
array ("title" => __('Event validated'))).'&nbsp;'; */
$data[4] .= '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
}
// Delete event
if (check_acl ($config["id_user"], $event["id_grupo"], "IM") == 1) {
@ -558,11 +559,11 @@ foreach ($result as $event) {
array_push ($table->data, $data);
//Hiden row with extended description
$string = '<table width="90%" style="border:solid 1px #D3D3D3;" class="toggle"><tr>';
$string = '<table width="99%" style="border:solid 1px #D3D3D3;" class="toggle" cellpadding="6"><tr>';
$string .= '<td align="left" valign="top" width="25%" border="solid 1px">';
$string .= '<b>' . __('Event name') . '</b></td><td align="left">';
$string .= io_safe_output($event["evento"]);
$string .= '</td></tr><tr style="border-left: solid 1px; #D3D3D3;">';
$string .= '</td></tr><tr style="border-left: solid 1px; #D3D3D3;" class="rowOdd">';
$string .= '<td align="left" valign="top" width="15%">';
$string .= '<b>' . __('Severity') . '</b></td><td align="left">';
$string .= html_print_image ($img_sev, true,
@ -575,21 +576,49 @@ foreach ($result as $event) {
$string .= '<td align="left" valign="top" width="15%">';
$string .= '<b>' . __('Type') . '</b></td><td align="left">';
$string .= events_print_type_img ($event["event_type"], true).' '.events_print_type_description($event["event_type"], true);
$string .= '</td></tr><tr class="rowOdd">';
$string .= '<td align="left" valign="top" width="15%">';
$string .= '<b>' . __('Status') . '</b></td><td align="left">';
$string .= $title_st;
$string .= '</td></tr><tr>';
$string .= '<td align="left" valign="top" width="15%">';
$string .= '<b>' . __('Timestamp') . '</b></td><td align="left">';
if ($group_rep == 1) {
$string .= date ($config["date_format"], $event['timestamp_rep']);
}
else {
$string .= date ($config["date_format"], $event["timestamp"]);
}
$string .= '</td></tr><tr class="rowOdd">';
$odd = '';
if ($event["id_agente"] != 0) {
$string .= '<td align="left" valign="top" width="15%">';
$string .= '<b>' . __('Agent name') . '</b></td><td align="left">';
$string .= ui_print_agent_name ($event["id_agente"], true);
$string .= '</td></tr><tr>';
//$odd = 'rowOdd';
$odd = ($odd == '')? 'rowOdd' : '';
}
if ($event["id_agentmodule"] != 0) {
$string .= '<td align="left" valign="top" width="15%">';
$string .= '<b>' . __('Agent module source') . '</b></td><td align="left">';
$string .= '<b>' . __('Agent module') . '</b></td><td align="left">';
$string .= '<a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$event["id_agente"].'&amp;tab=data">';
$string .= db_get_value('nombre', 'tagente_modulo', 'id_agente_modulo', $event["id_agentmodule"]);
$string .= '</a></td></tr><tr>';
$string .= '</a></td></tr><tr class="' . $odd . '">';
//$odd = '';
$odd = ($odd == '')? 'rowOdd' : '';
// Module group
$string .= '<td align="left" valign="top" width="15%">';
$string .= '<b>' . __('Module group') . '</b></td><td align="left">';
$id_module_group = db_get_value('id_module_group', 'tagente_modulo', 'id_agente_modulo', $event["id_agentmodule"]);
$module_group = db_get_value('name', 'tmodule_group', 'id_mg', $id_module_group);
$string .= '<a href="index.php?sec=estado&amp;sec2=operation/agentes/status_monitor&amp;status=-1&amp;modulegroup=' . $id_module_group . '">';
$string .= $module_group;
$string .= '</a></td></tr><tr class="' . $odd . '">';
//$odd = 'rowOdd';
$odd = ($odd == '')? 'rowOdd' : '';
}
if ($event["id_alert_am"] != 0) {
@ -616,14 +645,17 @@ foreach ($result as $event) {
$string .= $templateName;
$string .= '</a></td></tr><tr>';
$string .= '</a></td></tr><tr class="' . $odd . '">';
//$odd = '';
$odd = ($odd == '')? 'rowOdd' : '';
}
$string .= '<td align="left" valign="top" width="15%">';
$string .= '<b>' . __('Group') . '</b></td><td align="left">';
$string .= ui_print_group_icon ($event["id_grupo"], true);
$string .= groups_get_name ($event["id_grupo"]);
$string .= '</td></tr><tr>';
$string .= '</td></tr><tr class="' . $odd . '">';
$odd = ($odd == '')? 'rowOdd' : '';
$string .= '<td align="left" valign="top" width="15%">';
if ($group_rep == 0) {
$string .= '<b>' . __('User ID') . '</b></td><td align="left">';
@ -648,16 +680,32 @@ foreach ($result as $event) {
}
}
$string .= '</td></tr>';
$string .= '<tr><td align="left" valign="top">' . '<b>' . __('Comments') . '</td><td align="left">';
$string .= '<tr class="' . $odd . '"><td align="left" valign="top">' . '<b>' . __('Comments') . '</td><td align="left">';
if($event["user_comment"] != '') {
$string .= $event["user_comment"];
} else {
$string .= '<i>- ' . __('Empty') . ' -</i>';
}
$string .= '</td></tr>';
$string .= '<tr><td align="left" valign="top">' . '<b>' . __('Tags') . '</td><td align="left">';
$odd = ($odd == '')? 'rowOdd' : '';
$string .= '<tr class="' . $odd . '"><td align="left" valign="top">' . '<b>' . __('Tags') . '</td><td align="left">';
if ($event["tags"] != '') {
$string .= $event["tags"];
$tag_array = explode(',', $event["tags"]);
//html_debug_print($tag_array);
foreach ($tag_array as $tag_element){
$blank_char_pos = strpos($tag_element, ' ');
//html_debug_print($blank_char_pos);
$tag_name = substr($tag_element, 0, $blank_char_pos);
$tag_url = substr($tag_element, $blank_char_pos + 1);
//html_debug_print("Tag name " . $tag_name);
//html_debug_print($tag_url);
$string .= ' ' .$tag_name;
if (!empty($tag_url)){
$string .= ' <a href="javascript: openURLTagWindow(\'' . $tag_url . '\');">' . html_print_image('images/lupa.png', true, array('title' => __('Click here to open a popup window with URL tag'))) . '</a> ';
}
$string .= ',';
}
$string = rtrim($string, ',');
}
else {
$string .= '<i>- ' . __('Empty') . ' -</i>';