#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_regular_expression').show();
$("#row_date").show(); $("#row_date").show();
$("#id_agents")
.change(event_change_id_agent_inventory);
$("#id_agents").trigger('change');
$("#row_servers").show(); $("#row_servers").show();
@ -7187,14 +7184,16 @@ function chooseType() {
false, false,
false, false,
false, false,
false false,
).'"'; ).'"';
echo ', "false", '.json_encode($id_agents).'';
?> ?>
); );
}); });
$("#combo_server").trigger('change'); $("#combo_server").trigger('change');
$("#combo_group").change(function() { $("#combo_group").change(function() {
$('#hidden-date_selected').val(''); $('#hidden-date_selected').val('');
updateInventoryDates( updateInventoryDates(
@ -7218,6 +7217,9 @@ function chooseType() {
?> ?>
); );
}); });
$("#id_agents").change(event_change_id_agent_inventory);
$("#id_agents").trigger('change');
$("#id_agents").change(function() { $("#id_agents").change(function() {
$('#hidden-date_selected').val(''); $('#hidden-date_selected').val('');
updateInventoryDates( updateInventoryDates(

View File

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