mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
fix inherit ack timestamp feature
This commit is contained in:
parent
6114787764
commit
8029125929
@ -13102,18 +13102,26 @@ function api_set_create_event($id, $trash1, $other, $returnType)
|
|||||||
$values['custom_data'] = '';
|
$values['custom_data'] = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$ack_utimestamp = 0;
|
||||||
|
|
||||||
if ($other['data'][18] != '') {
|
if ($other['data'][18] != '') {
|
||||||
$values['id_extra'] = $other['data'][18];
|
$values['id_extra'] = $other['data'][18];
|
||||||
$sql_validation = 'SELECT id_evento,estado FROM tevento where estado IN (0,2) and id_extra ="'.$other['data'][18].'";';
|
$sql_validation = 'SELECT id_evento,estado,ack_utimestamp
|
||||||
|
FROM tevento
|
||||||
|
WHERE estado IN (0,2) AND id_extra ="'.$other['data'][18].'";';
|
||||||
|
|
||||||
$validation = db_get_all_rows_sql($sql_validation);
|
$validation = db_get_all_rows_sql($sql_validation);
|
||||||
|
|
||||||
if ($validation) {
|
if ($validation) {
|
||||||
foreach ($validation as $val) {
|
foreach ($validation as $val) {
|
||||||
if ((bool) $config['keep_in_process_status_extra_id'] === true
|
if ((bool) $config['keep_in_process_status_extra_id'] === true) {
|
||||||
&& (int) $val['estado'] === EVENT_STATUS_INPROCESS
|
// Inherit status when previous event was in "in process" status.
|
||||||
&& (int) $values['status'] === 0
|
if ((int) $val['estado'] === EVENT_STATUS_INPROCESS && (int) $values['status'] === 0) {
|
||||||
) {
|
$values['status'] = 2;
|
||||||
$values['status'] = 2;
|
}
|
||||||
|
|
||||||
|
// Always inherit ack_utimestamp.
|
||||||
|
$ack_utimestamp = $val['ack_utimestamp'];
|
||||||
}
|
}
|
||||||
|
|
||||||
api_set_validate_event_by_id($val['id_evento']);
|
api_set_validate_event_by_id($val['id_evento']);
|
||||||
@ -13143,7 +13151,8 @@ function api_set_create_event($id, $trash1, $other, $returnType)
|
|||||||
$values['tags'],
|
$values['tags'],
|
||||||
$custom_data,
|
$custom_data,
|
||||||
$values['server_id'],
|
$values['server_id'],
|
||||||
$values['id_extra']
|
$values['id_extra'],
|
||||||
|
$ack_utimestamp
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($other['data'][12] != '') {
|
if ($other['data'][12] != '') {
|
||||||
|
@ -2334,7 +2334,8 @@ function events_create_event(
|
|||||||
$tags='',
|
$tags='',
|
||||||
$custom_data='',
|
$custom_data='',
|
||||||
$server_id=0,
|
$server_id=0,
|
||||||
$id_extra=''
|
$id_extra='',
|
||||||
|
$ack_utimestamp=0
|
||||||
) {
|
) {
|
||||||
if ($source === false) {
|
if ($source === false) {
|
||||||
$source = get_product_name();
|
$source = get_product_name();
|
||||||
@ -2362,7 +2363,7 @@ function events_create_event(
|
|||||||
'warning_instructions' => $warning_instructions,
|
'warning_instructions' => $warning_instructions,
|
||||||
'unknown_instructions' => $unknown_instructions,
|
'unknown_instructions' => $unknown_instructions,
|
||||||
'owner_user' => '',
|
'owner_user' => '',
|
||||||
'ack_utimestamp' => 0,
|
'ack_utimestamp' => $ack_utimestamp,
|
||||||
'custom_data' => $custom_data,
|
'custom_data' => $custom_data,
|
||||||
'data' => '',
|
'data' => '',
|
||||||
'module_status' => 0,
|
'module_status' => 0,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user