fix bug: in progress events deleting on event view massive deletion

Former-commit-id: 4c4f0a387ad3abd7cfea913b45c885ab3af4ecc6
This commit is contained in:
alejandro-campos 2019-01-15 13:27:14 +01:00
parent 5235b62c0d
commit 9048a13840
2 changed files with 15 additions and 3 deletions

View File

@ -900,10 +900,12 @@ else {
validate_event_advanced($(this).val(), new_status);
}
});
location.reload();
}
</script>
<?php
}
if (!$readonly && ($show_delete_button)) {
$array_events_actions['delete_selected'] = 'Delete selected';
?>
@ -927,7 +929,7 @@ else {
foreach ($event_responses as $val)
$array_events_actions[$val['id']] = $val['name'];
if (!$config["centralized_management"]) {
if ($config['event_replication'] != 1) {
echo '<div style="width:100%;text-align:right;">';
echo '<form method="post" id="form_event_response">';
html_print_select($array_events_actions, 'response_id', '', '', '', 0, false, false, false);
@ -1029,8 +1031,6 @@ else {
delete_selected();
break;
}
$( ".chk_val" ).prop( "checked", false );
}
}
</script>

View File

@ -559,6 +559,18 @@ if ($validate) {
if ($delete) {
$ids = (array) get_parameter ("validate_ids", -1);
// Discard deleting in progress events
$in_process_status = db_get_all_rows_sql("
SELECT id_evento
FROM tevento
WHERE estado=2");
foreach ($in_process_status as $val) {
if (($key = array_search($val['id_evento'], $ids)) !== false) {
unset($ids[$key]);
}
}
if ($ids[0] != -1) {
$return = events_delete_event ($ids, ($group_rep == 1), $meta);
ui_print_result_message ($return,