Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

feat(inventory): manage custom data to inventory #3049

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions inc/formatconvert.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1510,6 +1510,11 @@ static function computerInventoryTransformation($array) {
}
}

// * CUSTOM
if (isset($array['CUSTOM'])) {
$a_inventory['custom'] = array_change_key_case($array['CUSTOM'], CASE_LOWER);
}

$plugin_params = [
'inventory' => $a_inventory,
'source' => $array
Expand Down Expand Up @@ -2317,6 +2322,12 @@ static function networkequipmentInventoryTransformation($array) {
$a_inventory['components'][$a_component['INDEX']] = $array_tmp;
}
}

// * CUSTOM
if (isset($array['CUSTOM'])) {
$a_inventory['custom'] = array_change_key_case($array['CUSTOM'], CASE_LOWER);
}

return $a_inventory;
}

Expand Down Expand Up @@ -2413,6 +2424,11 @@ static function printerInventoryTransformation($array) {
$a_inventory['pagecounters'] = $array_tmp;
}

// * CUSTOM
if (isset($array['CUSTOM'])) {
$a_inventory['custom'] = array_change_key_case($array['CUSTOM'], CASE_LOWER);
}

return $a_inventory;
}

Expand Down