From a150e0d1fbd5ccb5f8642efcb844c6011eea524b Mon Sep 17 00:00:00 2001 From: FranckMARTEAU Date: Wed, 16 Apr 2025 15:40:52 +0200 Subject: [PATCH] computer import correction Make import computer from ocs working --- inc/ocsprocess.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/inc/ocsprocess.class.php b/inc/ocsprocess.class.php index 05b1192..c01bbfc 100644 --- a/inc/ocsprocess.class.php +++ b/inc/ocsprocess.class.php @@ -526,7 +526,8 @@ public static function importComputer($import_params) //No entity or location predefined, check rules if ($defaultentity == -1) { //Try to affect computer to an entity - $rule = new RuleImportEntityCollection(); + //$rule = new RuleImportEntityCollection(); + $rule = new RuleImportAssetCollection(); $input = [ 'itemtype' => "Computer", @@ -556,6 +557,8 @@ public static function importComputer($import_params) ['ocsid' => $ocsid] ); + $data['entities_id']=$data['rules_id']; + if (isset($data['_ignore_import']) && $data['_ignore_import'] == 1) { //ELSE Return code to indicates that the machine was not imported because it doesn't matched rules return ['status' => self::COMPUTER_LINK_REFUSED,