add owner when validate event

This commit is contained in:
alejandro-campos 2020-06-09 11:54:02 +02:00
parent d6ac646046
commit f22cc5b22b
1 changed files with 19 additions and 3 deletions

View File

@ -612,14 +612,12 @@ function events_update_status($id_evento, $status, $filter=null, $history=false)
'UPDATE %s 'UPDATE %s
SET estado = %d, SET estado = %d,
ack_utimestamp = %d, ack_utimestamp = %d,
id_usuario = "%s", id_usuario = "%s"
owner_user = "%s"
WHERE id_evento IN (%s)', WHERE id_evento IN (%s)',
$table, $table,
$status, $status,
time(), time(),
$config['id_user'], $config['id_user'],
$config['id_user'],
join(',', $target_ids) join(',', $target_ids)
); );
} }
@ -635,6 +633,14 @@ function events_update_status($id_evento, $status, $filter=null, $history=false)
break; break;
case EVENT_STATUS_VALIDATED: case EVENT_STATUS_VALIDATED:
events_change_owner(
$id_evento,
$config['id_user'],
false,
is_metaconsole() ? true : false,
$history
);
$status_string = 'Validated'; $status_string = 'Validated';
break; break;
@ -1872,6 +1878,16 @@ function events_change_status(
return false; return false;
} }
if ($new_status == EVENT_STATUS_VALIDATED) {
events_change_owner(
$id_event,
$config['id_user'],
false,
$meta,
$history
);
}
events_comment( events_comment(
$id_event, $id_event,
'', '',