diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php
index 2beffd740f..5c48f1dcf1 100755
--- a/pandora_console/include/functions_ui.php
+++ b/pandora_console/include/functions_ui.php
@@ -3747,4 +3747,26 @@ function ui_print_module_string_value($value, $id_agente_module,
return $salida;
}
+
+/**
+* Displays a tag list
+*/
+function ui_print_tags_view($title = '', $tags = array()) {
+ $tv = '';
+ $tv .= '
';
+ if ($title !== '') $tv .= '
' . $title . '
';
+ foreach ($tags as $tag) {
+ $tv .= '
';
+ $tv .= '';
+ $tv .= $tag['title'];
+ $tv .= '';
+
+ $tv .= '';
+ $tv .= $tag['value'];
+ $tv .= '';
+ $tv .= '
';
+ }
+ $tv .= '
';
+ echo $tv;
+}
?>
diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css
index d20883b7e4..d438de4c86 100644
--- a/pandora_console/include/styles/pandora.css
+++ b/pandora_console/include/styles/pandora.css
@@ -3805,4 +3805,41 @@ color:#82b92e;font-family:Nunito;font-size:10pt;position:relative;top:6px;
}
.checkselected{
background-color: #eee;
+}
+.tag-wrapper{
+ padding: 0 10px 0 0;
+ overflow: auto;
+}
+
+.pandora-tag{
+ float:left;
+ margin-bottom:18px;
+ padding:1px 6px 1px 0;
+}
+
+.pandora-tag-title{
+ color: white;
+ background-color: #373737;
+ font-weight: bold;
+ padding: 6px 6px 6px 10px;
+ border: #373737;
+ border-width: 1px;
+ border-top-style: solid;
+ border-top-left-radius: 12px;
+ border-left-style: solid;
+ border-bottom-left-radius: 12px;
+ border-bottom-style: solid;
+}
+
+.pandora-tag-value{
+ color: #373737;
+ font-weight: bold;
+ padding: 6px 10px 6px 6px;
+ border: #373737;
+ border-width: 1px;
+ border-top-style: solid;
+ border-top-right-radius: 12px;
+ border-right-style: solid;
+ border-bottom-right-radius: 12px;
+ border-bottom-style: solid;
}
\ No newline at end of file
diff --git a/pandora_console/operation/events/events.build_query.php b/pandora_console/operation/events/events.build_query.php
index 1d6cb59b73..28280d359e 100755
--- a/pandora_console/operation/events/events.build_query.php
+++ b/pandora_console/operation/events/events.build_query.php
@@ -24,6 +24,7 @@ elseif (check_acl ($id_user, 0, "EM"))
$propagate = db_get_value('propagate','tgrupo','id_grupo',$id_group);
if ($id_group > 0) {
+ $filter_resume['groups'] = $id_group;
if ($propagate) {
$childrens_ids = array($id_group);
@@ -66,18 +67,22 @@ switch ($status) {
case 0:
case 1:
case 2:
+ $filter_resume['status'] = $status;
$sql_post .= " AND estado = " . $status;
break;
case 3:
+ $filter_resume['status'] = $status;
$sql_post .= " AND (estado = 0 OR estado = 2)";
break;
}
if ($search != "") {
+ $filter_resume['free_search'] = $search;
$sql_post .= " AND (evento LIKE '%". io_safe_input($search) . "%' OR id_evento LIKE '%$search%')";
}
if ($event_type != "") {
+ $filter_resume['event_type'] = $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") {
@@ -93,6 +98,7 @@ if ($event_type != "") {
}
if ($severity != -1) {
+ $filter_resume['severity'] = $severity;
switch ($severity) {
case EVENT_CRIT_WARNING_OR_CRITICAL:
$sql_post .= "
@@ -115,6 +121,7 @@ if ($severity != -1) {
// In metaconsole mode the agent search is performed by name
if ($meta) {
+ $filter_resume['agent'] = $text_agent;
if ($text_agent != __('All')) {
$sql_post .= " AND agent_name LIKE '%$text_agent%'";
}
@@ -128,6 +135,7 @@ else {
$sql_post .= " AND 1 = 0";
break;
default:
+ $filter_resume['agent'] = $id_agent;
$sql_post .= " AND id_agente = " . $id_agent;
break;
}
@@ -140,6 +148,7 @@ if ($meta) {
}
else {
if (!empty($text_module)) {
+ $filter_resume['module'] = $text_module;
$sql_post .= " AND id_agentmodule IN (
SELECT id_agente_modulo
FROM tagente_modulo
@@ -148,8 +157,10 @@ else {
}
}
-if ($id_user_ack != "0")
+if ($id_user_ack != "0") {
+ $filter_resume['user_ack'] = $id_user_ack;
$sql_post .= " AND id_usuario = '" . $id_user_ack . "'";
+}
if (!isset($date_from)) {
$date_from = "";
@@ -160,6 +171,7 @@ if (!isset($date_to)) {
if (($date_from == '') && ($date_to == '')) {
if ($event_view_hr > 0) {
+ $filter_resume['hours_max'] = $event_view_hr;
$unixtime = get_system_time () - ($event_view_hr * SECONDS_1HOUR);
$sql_post .= " AND (utimestamp > " . $unixtime . ")";
}
@@ -167,18 +179,22 @@ if (($date_from == '') && ($date_to == '')) {
else {
if ($date_from != '') {
if($time_from != '') {
+ $filter_resume['time_from'] = $date_from . " " . $time_from;
$udate_from = strtotime($date_from . " " . $time_from);
$sql_post .= " AND (utimestamp >= " . $udate_from . ")";
} else {
+ $filter_resume['time_from'] = $date_from;
$udate_from = strtotime($date_from . " 00:00:00");
$sql_post .= " AND (utimestamp >= " . $udate_from . ")";
}
}
if ($date_to != '') {
if($time_to != '') {
+ $filter_resume['time_to'] = $date_to . " " . $time_to;
$udate_to = strtotime($date_to . " " . $time_to);
$sql_post .= " AND (utimestamp <= " . $udate_to . ")";
} else {
+ $filter_resume['time_to'] = $date_to;
$udate_to = strtotime($date_to . " 23:59:59");
$sql_post .= " AND (utimestamp <= " . $udate_to . ")";
}
@@ -189,6 +205,7 @@ else {
if (!empty($tag_with)) {
$sql_post .= ' AND ( ';
$first = true;
+ $filter_resume['tag_inc'] = $tag_with;
foreach ($tag_with as $id_tag) {
if ($first) $first = false;
else $sql_post .= " AND ";
@@ -205,6 +222,7 @@ if (!empty($tag_with)) {
if (!empty($tag_without)) {
$sql_post .= ' AND ( ';
$first = true;
+ $filter_resume['tag_no_inc'] = $tag_without;
foreach ($tag_without as $id_tag) {
if ($first) $first = false;
else $sql_post .= " AND ";
@@ -216,10 +234,14 @@ if (!empty($tag_without)) {
// Filter/Only alerts
if (isset($filter_only_alert)) {
- if ($filter_only_alert == 0)
+ if ($filter_only_alert == 0) {
+ $filter_resume['alerts'] = $filter_only_alert;
$sql_post .= " AND event_type NOT LIKE '%alert%'";
- else if ($filter_only_alert == 1)
+ }
+ else if ($filter_only_alert == 1) {
+ $filter_resume['alerts'] = $filter_only_alert;
$sql_post .= " AND event_type LIKE '%alert%'";
+ }
}
// Tags ACLS
@@ -247,6 +269,7 @@ if (($tags_acls_condition != ERR_WRONG_PARAMETERS) && ($tags_acls_condition != E
if ($meta) {
if ($server_id) {
+ $filter_resume['server'] = $server_id;
$sql_post .= " AND server_id = " . $server_id;
} else {
$enabled_nodes = db_get_all_rows_sql('
diff --git a/pandora_console/operation/events/events_list.php b/pandora_console/operation/events/events_list.php
index bb42903940..424fbedfd6 100644
--- a/pandora_console/operation/events/events_list.php
+++ b/pandora_console/operation/events/events_list.php
@@ -25,6 +25,7 @@ require_once ($config['homedir'] . "/include/functions_users.php"); //Users func
require_once ($config['homedir'] . "/include/functions_groups.php");
require_once ($config["homedir"] . "/include/functions_graph.php");
require_once ($config["homedir"] . "/include/functions_tags.php");
+enterprise_include_once('include/functions_events.php');
check_login ();
@@ -163,6 +164,7 @@ $sql_post = "";
$id_user = $config['id_user'];
+$filter_resume = array();
require('events.build_query.php');
// Now $sql_post have all the where condition
@@ -459,7 +461,12 @@ $table_advanced->rowclass[] = '';
$data = array();
$data[0] = __("Alert events") . $jump;
-$data[0] .= html_print_select (array('-1' => __('All'), '0' => __('Filter alert events'), '1' => __('Only alert events')), "filter_only_alert", $filter_only_alert, '', '', '', true);
+$alert_events_titles = array(
+ '-1' => __('All'),
+ '0' => __('Filter alert events'),
+ '1' => __('Only alert events')
+);
+$data[0] .= html_print_select ($alert_events_titles, "filter_only_alert", $filter_only_alert, '', '', '', true);
$data[1] = __('Block size for pagination') . $jump;
$lpagination[25] = 25;
$lpagination[50] = 50;
@@ -561,7 +568,8 @@ $types["not_normal"] = __("Not normal");
$data[1] .= html_print_select ($types, 'event_type', $event_type, '', __('All'), '', true);
$data[2] = __('Severity') . $jump;
-$data[2] .= html_print_select (get_priorities (), "severity", $severity, '', __('All'), '-1', true, false, false);
+$severities = get_priorities ();
+$data[2] .= html_print_select ($severities, "severity", $severity, '', __('All'), '-1', true, false, false);
$table->data[] = $data;
$table->rowclass[] = '';
@@ -641,7 +649,7 @@ $events_filter .= ""; //This is the filter div
if (is_metaconsole())
ui_toggle($events_filter, __("Show Options"));
else
- ui_toggle($events_filter, __('Event control filter'), '', !$open_filter);
+ ui_toggle($events_filter, __('Event control filter'));
// Error div for ajax messages
echo "";
@@ -696,6 +704,7 @@ if ($group_rep == 0) {
$result = db_get_all_rows_sql ($sql);
}
elseif ($group_rep == 1) {
+ $filter_resume['duplicate'] = $group_rep;
$result = events_get_events_grouped(
$sql_post,
$offset,
@@ -707,6 +716,7 @@ elseif ($group_rep == 1) {
'DESC');
}
elseif ($group_rep == 2) {
+ $filter_resume['duplicate'] = $group_rep;
$result = events_get_events_grouped_by_agent(
$sql_post,
$offset,
@@ -715,6 +725,19 @@ elseif ($group_rep == 2) {
$history);
}
+// Active filter tag view call (only enterprise version)
+// It is required to pass some references to enterprise function
+// to translate the active filters
+enterprise_hook('print_event_tags_active_filters',
+ array( $filter_resume, array(
+ 'status' => $fields,
+ 'event_type' => $types,
+ 'severity' => $severities,
+ 'duplicate' => $repeated_sel,
+ 'alerts' => $alert_events_titles)
+ )
+);
+
if (!empty($result)) {
if ($group_rep == 0) {
$sql = "SELECT COUNT(id_evento)