Solved errors in mobile events view

This commit is contained in:
Kike 2018-10-29 16:16:03 +01:00
parent 6353af0482
commit da91b4d25f
2 changed files with 29 additions and 21 deletions

View File

@ -95,21 +95,25 @@ function events_get_events ($filter = false, $fields = false) {
*
* @return mixed False in case of error or invalid values passed. Event row otherwise
*/
function events_get_event ($id, $fields = false) {
if (empty ($id))
return false;
global $config;
if (is_array ($fields)) {
if (! in_array ('id_grupo', $fields))
$fields[] = 'id_grupo';
}
$event = db_get_row ('tevento', 'id_evento', $id, $fields);
if (! check_acl ($config['id_user'], $event['id_grupo'], 'ER'))
return false;
return $event;
function events_get_event ($id, $fields = false, $meta = false) {
if (empty ($id))
return false;
global $config;
if (is_array ($fields)) {
if (! in_array ('id_grupo', $fields))
$fields[] = 'id_grupo';
}
if ($meta === true){
$event = db_get_row ('tmetaconsole_event', 'id_evento', $id, $fiel ds);
}else{
$event = db_get_row ('tevento', 'id_evento', $id, $fields);
}
if (! check_acl ($config['id_user'], $event['id_grupo'], 'ER'))
return false;
return $event;
}
function events_get_events_no_grouped($sql_post, $offset = 0,
$pagination = 1, $meta = false, $history = false, $total = false,

View File

@ -297,7 +297,7 @@ class Events {
$id_event = $system->getRequest('id_event', 0);
if (events_change_status($id_event, EVENT_VALIDATE)) {
if (events_change_status($id_event, EVENT_VALIDATE,$system->getConfig('metaconsole'))) {
echo json_encode(array('correct' => 1));
}
else {
@ -379,11 +379,15 @@ class Events {
$this->default_filters['severity'] = false;
}
$this->filter = $system->getRequest('filter', __('Preset Filters'));
if (($this->filter === __("Preset Filters")) || ($this->filter == 0)) {
$this->filter = 0;
}
else {
if ($system->getRequest('filter', __('Preset Filters')) === __("Preset Filters")) {
//Set filter as default user event filter (only first time)
$this->filter = db_get_value('default_event_filter', 'tusuario', 'id_user', $system->getConfig('id_user'));
}
else {
$this->filter = $system->getRequest('filter', __('Preset Filters'));
}
if ($this->filter != 0) {
$this->default = false;
}