File tree Expand file tree Collapse file tree 2 files changed +17
-5
lines changed
Expand file tree Collapse file tree 2 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1111
1212- Fix menu icon
1313- Fix dropdown UI
14+ - Fix get linked items (move ` glpi_computers_items ` to ` glpi_assets_assets_peripheralassets ` )
1415
1516### Added
1617
Original file line number Diff line number Diff line change 2828 * -------------------------------------------------------------------------
2929 */
3030use Glpi \Application \View \TemplateRenderer ;
31+ use Glpi \Asset \Asset_PeripheralAsset ;
3132use Glpi \DBAL \QueryExpression ;
3233use Glpi \Form \Form ;
3334use Glpi \Message \MessageType ;
@@ -287,13 +288,23 @@ public function getLinkedItems()
287288 /** @var DBmysql $DB */
288289 global $ DB ;
289290
290- $ query = "SELECT `itemtype`, `items_id`
291- FROM `glpi_computers_items`
292- WHERE `computers_id` = ' " . $ this ->getID () . "' " ;
293291 $ tab = [];
294- foreach ($ DB ->doQuery ($ query ) as $ data ) {
295- $ tab [$ data ['itemtype ' ]][$ data ['items_id ' ]] = $ data ['items_id ' ];
292+ $ iterator = $ DB ->request ([
293+ 'SELECT ' => [
294+ 'itemtype_peripheral ' ,
295+ 'items_id_peripheral ' ,
296+ ],
297+ 'FROM ' => getTableForItemType (Asset_PeripheralAsset::class),
298+ 'WHERE ' => [
299+ 'itemtype_asset ' => Computer::class,
300+ 'items_id_asset ' => $ this ->getID (),
301+ ],
302+ ]);
303+
304+ foreach ($ iterator as $ data ) {
305+ $ tab [$ data ['itemtype_peripheral ' ]][$ data ['items_id_peripheral ' ]] = $ data ['items_id_peripheral ' ];
296306 }
307+
297308 return $ tab ;
298309 }
299310
You can’t perform that action at this time.
0 commit comments