#Fix item inventory 11560

This commit is contained in:
miguel angel rasteu 2023-06-26 08:29:19 +02:00
parent c486b44707
commit c65bd468a5
2 changed files with 27 additions and 15 deletions

View File

@ -7163,9 +7163,6 @@ function chooseType() {
$('#row_regular_expression').show();
$("#row_date").show();
$("#id_agents")
.change(event_change_id_agent_inventory);
$("#id_agents").trigger('change');
$("#row_servers").show();
@ -7187,13 +7184,15 @@ function chooseType() {
false,
false,
false,
false
false,
).'"';
echo ', "false", '.json_encode($id_agents).'';
?>
);
});
$("#combo_server").trigger('change');
$("#combo_group").change(function() {
$('#hidden-date_selected').val('');
@ -7218,6 +7217,9 @@ function chooseType() {
?>
);
});
$("#id_agents").change(event_change_id_agent_inventory);
$("#id_agents").trigger('change');
$("#id_agents").change(function() {
$('#hidden-date_selected').val('');
updateInventoryDates(
@ -7244,7 +7246,7 @@ function chooseType() {
?>
);
});
if (!$("#hidden-date_selected").val())
updateInventoryDates(
<?php

View File

@ -1411,6 +1411,7 @@ switch ($action) {
];
$report = db_get_row_filter(
'treport',
['id_report' => $idReport]
@ -1520,21 +1521,28 @@ switch ($action) {
$good_format = false;
switch ($action) {
case 'update':
$values = [];
$server_id = get_parameter('server_id', 0);
if (is_metaconsole() === true
&& empty($server_id) === false
) {
$connection = metaconsole_get_connection_by_id(
$server_id
);
metaconsole_connect($connection);
$values['server_name'] = $connection['server_name'];
$values['type'] = get_parameter('type', null);
if (is_metaconsole() === true && $values['type'] === 'inventory') {
$values['server_name'] = get_parameter('combo_server');
} else {
$server_id = get_parameter('server_id', 0);
if (is_metaconsole() === true
&& empty($server_id) === false
) {
$connection = metaconsole_get_connection_by_id(
$server_id
);
metaconsole_connect($connection);
$values['server_name'] = $connection['server_name'];
}
}
$values['id_report'] = $idReport;
$values['description'] = get_parameter('description');
$values['type'] = get_parameter('type', null);
$values['recursion'] = get_parameter('recursion', null);
$values['show_extended_events'] = get_parameter(
'include_extended_events',
@ -1764,6 +1772,7 @@ switch ($action) {
$description = get_parameter('description');
$values['external_source'] = json_encode($es);
$good_format = true;
break;
case 'inventory_changes':
@ -2574,6 +2583,7 @@ switch ($action) {
$es['inventory_regular_expression'] = get_parameter('inventory_regular_expression', '');
$values['external_source'] = json_encode($es);
$good_format = true;
break;
case 'event_report_log':