diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 3ca6253950..e86b12d545 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2012-05-30 Juan Manuel Ramon + + * operation/events/export_csv.php: Fixed csv events exportation + query. + 2012-05-30 Sergio Martin * include/functions_modules.php: Duplicate the operations diff --git a/pandora_console/operation/events/export_csv.php b/pandora_console/operation/events/export_csv.php index 73867437ab..04a0c79e89 100644 --- a/pandora_console/operation/events/export_csv.php +++ b/pandora_console/operation/events/export_csv.php @@ -139,6 +139,11 @@ $fields = array ('id_grupo', 'id_agente', 'evento', 'estado', 'id_usuario', 'event_type', 'criticity', 'timestamp'); $sql = db_get_all_rows_filter ('tevento', $filter, $fields, 'AND', true, true); + +// If filter is empty and there are others filters not empty append "WHERE" clause +if (empty($filter) and (!empty($filter_state) or !empty($timestamp_filter))) + $sql .= ' WHERE 1=1 '; + $sql .= $filter_state . $timestamp_filter . ' ORDER BY timestamp DESC'; $new = true;