2013-11-19 Sergio Martin <sergio.martin@artica.es>

* operation/events/events.build_query.php: Fixed a
	subquery OR condition for not normal type.

	* operation/agentes/status_monitor.php: Fixed monitor
	filter by group and tags

	* mobile/operation/events.php: Fixed filter of events 
	view in mobile console



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9097 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2013-11-19 13:28:35 +00:00
parent 5ae968a728
commit 8c86a93bb2
4 changed files with 24 additions and 15 deletions

View File

@ -1,3 +1,14 @@
2013-11-19 Sergio Martin <sergio.martin@artica.es>
* operation/events/events.build_query.php: Fixed a
subquery OR condition for not normal type.
* operation/agentes/status_monitor.php: Fixed monitor
filter by group and tags
* mobile/operation/events.php: Fixed filter of events
view in mobile console
2013-11-19 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_groups.php

View File

@ -22,7 +22,7 @@ class Events {
private $free_search = '';
private $hours_old = 8;
private $status = 3;
private $type = "";
private $type = "all";
private $severity = -1;
private $filter = 0;
private $group = 0;
@ -333,7 +333,7 @@ class Events {
$this->type = $system->getRequest('type', __("Type"));
if ($this->type === __("Type")) {
$this->type = "";
$this->type = "all";
}
else {
$this->default = false;
@ -576,16 +576,17 @@ class Events {
'name' => 'type',
'title' => __('Type'),
'label' => __('Type'),
'items' => get_event_types(),
'items' => array_merge(array("all" => __('All')), get_event_types()),
'selected' => $this->type
);
$ui->formAddSelectBox($options);
$options = array(
'name' => 'severity',
'title' => __('Severity'),
'label' => __('Severity'),
'items' => get_priorities(),
'items' => array("-1" => __('All')) + get_priorities(),
'selected' => $this->severity
);
$ui->formAddSelectBox($options);
@ -1035,7 +1036,7 @@ class Events {
$(document).ready(function() {
$(window).bind(\"scroll\", function () {
if ($(this).scrollTop() + $(this).height()
>= ($(document).height() - 100)) {
>= ($(document).height() - 100) || true) {
ajax_load_rows();
}
@ -1094,4 +1095,4 @@ class Events {
}
}
?>
?>

View File

@ -97,8 +97,8 @@ $id_ag_group = db_get_value('id_grupo', 'tgrupo', 'nombre', $ag_group);
// Agent group selector
if (!defined('METACONSOLE')) {
if ($ag_group > 0 && check_acl ($config["id_user"], $id_ag_group, "AR")) {
$sql_conditions_group = sprintf (" AND tagente.id_grupo = %d", $id_ag_group);
if ($ag_group > 0 && check_acl ($config["id_user"], $ag_group, "AR")) {
$sql_conditions_group = sprintf (" AND tagente.id_grupo = %d", $ag_group);
}
elseif ($user_groups != '') {
// User has explicit permission on group 1 ?
@ -121,9 +121,7 @@ if (defined('METACONSOLE')) {
FROM tmodule_group WHERE name = '%s')", $modulegroup);
}
else if ($modulegroup > -1) {
$id_modulegroup = db_get_value('id_agente_modulo', 'tagente_modulo', 'nombre', $modulegroup);
$sql_conditions .= sprintf (" AND tagente_modulo.id_module_group = '%d'", $id_modulegroup);
$sql_conditions .= sprintf (" AND tagente_modulo.id_module_group = '%d'", $modulegroup);
}
@ -172,12 +170,11 @@ if ($tag_filter !== 0) {
WHERE ttag_module.id_tag IN (SELECT id_tag FROM ttag where name LIKE '%" . $tag_filter . "%')
)";
}
else{
$id_tag_filter = db_get_value('id_tag', 'ttag', 'name', $tag_filter);
else{
$sql_conditions .= " AND tagente_modulo.id_agente_modulo IN (
SELECT ttag_module.id_agente_modulo
FROM ttag_module
WHERE ttag_module.id_tag = " . $id_tag_filter . "
WHERE ttag_module.id_tag = " . $tag_filter . "
)";
}

View File

@ -82,7 +82,7 @@ if ($event_type != "") {
$sql_post .= " AND event_type LIKE '%$event_type%' ";
}
elseif ($event_type == "not_normal") {
$sql_post .= " AND event_type LIKE '%warning%' OR event_type LIKE '%critical%' OR event_type LIKE '%unknown%' ";
$sql_post .= " AND (event_type LIKE '%warning%' OR event_type LIKE '%critical%' OR event_type LIKE '%unknown%') ";
}
elseif ($event_type != "all") {
$sql_post .= " AND event_type = '" . $event_type."'";