Skip to content

Commit 0bdc559

Browse files
LainowRom1-Bstonebuzz
authored
Fix missing itemtype in connectedTo method (#454)
* Fix missing itemtype in connectedTo method * Update CHANGELOG * Update CHANGELOG.md Co-authored-by: Romain B. <8530352+Rom1-B@users.noreply.github.com> * Update CHANGELOG.md Co-authored-by: Stanislas <skita@teclib.com> --------- Co-authored-by: Romain B. <8530352+Rom1-B@users.noreply.github.com> Co-authored-by: Stanislas <skita@teclib.com>
1 parent ebfc2d4 commit 0bdc559

9 files changed

+27
-7
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [Unreleased]
99

10+
### Fixed
11+
12+
- Use `global` configuration for injection links
13+
1014
## [2.14.1] - 2024-12-27
1115

1216
### Added

inc/databaseinstanceinjection.class.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,10 @@ public function isPrimaryType()
5252

5353
public function connectedTo()
5454
{
55+
/** @var array $CFG_GLPI */
56+
global $CFG_GLPI;
5557

56-
return [\Glpi\Inventory\Asset\Computer::class];
58+
return $CFG_GLPI["databaseinstance_types"];
5759
}
5860

5961

inc/deviceharddriveinjection.class.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@ public function isPrimaryType()
5151

5252
public function connectedTo()
5353
{
54+
/** @var array $CFG_GLPI */
55+
global $CFG_GLPI;
5456

55-
return ["Computer"];
57+
return $CFG_GLPI['itemdeviceharddrive_types'];
5658
}
5759

5860

inc/devicememoryinjection.class.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@ public function isPrimaryType()
5151

5252
public function connectedTo()
5353
{
54+
/** @var array $CFG_GLPI */
55+
global $CFG_GLPI;
5456

55-
return ["Computer"];
57+
return $CFG_GLPI['itemdevicememory_types'];
5658
}
5759

5860

inc/devicemotherboardinjection.class.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@ public function isPrimaryType()
5151

5252
public function connectedTo()
5353
{
54+
/** @var array $CFG_GLPI */
55+
global $CFG_GLPI;
5456

55-
return ["Computer"];
57+
return $CFG_GLPI['itemdevicemotherboard_types'];
5658
}
5759

5860

inc/deviceprocessorinjection.class.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@ public function isPrimaryType()
5151

5252
public function connectedTo()
5353
{
54+
/** @var array $CFG_GLPI */
55+
global $CFG_GLPI;
5456

55-
return ["Computer"];
57+
return $CFG_GLPI['itemdeviceprocessor_types'];
5658
}
5759

5860

inc/item_operatingsysteminjection.class.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,10 @@ public function getOptions($primary_type = '')
7878

7979
public function connectedTo()
8080
{
81+
/** @var array $CFG_GLPI */
82+
global $CFG_GLPI;
8183

82-
return ['Computer', 'NetworkEquipment'];
84+
return $CFG_GLPI['operatingsystem_types'];
8385
}
8486

8587

inc/item_softwarelicenseinjection.class.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ public function relationSide()
6060

6161
public function connectedTo()
6262
{
63-
return ['SoftwareLicense', 'Software'];
63+
/** @var array $CFG_GLPI */
64+
global $CFG_GLPI;
65+
66+
return $CFG_GLPI['software_types'];
6467
}
6568

6669

inc/networknameinjection.class.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public function connectedTo()
5353
{
5454
/** @var array $CFG_GLPI */
5555
global $CFG_GLPI;
56+
5657
return $CFG_GLPI["networkport_types"];
5758
}
5859

0 commit comments

Comments
 (0)