You are not logged in.
Pages: 1
Topic closed
Bonjour,
Je travaille avec un univers BO de GLPI pour effectuer différent rapport.
L'ajout des tables dans cette univers BO se fait progressivement en fonction des besoins.
Et la je suis bloqué sur la gestion des moniteurs.
Je n'arrive pas a comprendre le cheminement de liaison entre les tables :
- GLPI_COMPUTERS
- GLPI_MONITORS
Pour l'instant j'ai réussit à faire le lien entre les tables
GLPI_COMPUTERS et GLPI_COMPUTERS_ITEMS
Cependant dans la table GLPI_COMPUTERS_ITEMS il y a bien un champs :
- items_id RELATION to various table, according to itemtype (ID)
Mais je n'arrive pas a voir comment cela est géré.
cordialement
Prod : centos-release-7-2 | GLPI 9.4.3 | FusionInventory 9.4+1.1 | fusioninventory-agent_windows-x64_2.5.2
Test : centos-release-7-2 | GLPI 9.4.4 |
Rectorat de Caen
Offline
bonjour,
dans `glpi_computers_items` avec itemtype='Monitor'
computers_id est lié à glpi_computers.id
itemid est lié à glpi_monitors.id
Trouver la panne avant de réparer...
GLPI10.0.10 (ubuntu 22.04 PHP8.1 Mariadb10.6 ) plugins : comportements 2.7.2 reports 1.16.0 formcreator 2.13.8, datainjection 2.13.4 fields 1.21.6
Offline
Bonjour,
Et encore merci .
J'ai fait cette requête pour tester :
SELECT glpi_computers.name, glpi_monitors.size
FROM glpi_computers
INNER JOIN glpi_computers_items ON glpi_computers.id = glpi_computers_items.computers_id
INNER JOIN glpi_monitors ON glpi_computers_items.items_id = glpi_monitors.id
par contre est-il nécessaire de rajouter une close WHERE par rapport à glpi_computers_items.itemtype='monitor' ?
cordialement,
Prod : centos-release-7-2 | GLPI 9.4.3 | FusionInventory 9.4+1.1 | fusioninventory-agent_windows-x64_2.5.2
Test : centos-release-7-2 | GLPI 9.4.4 |
Rectorat de Caen
Offline
bonjour,
vous devez ajouter la restriction soit dans la jointure ou dans la cause where.
SELECT glpi_computers.name, glpi_monitors.size
FROM glpi_computers
INNER JOIN glpi_computers_items ON glpi_computers.id = glpi_computers_items.computers_id
INNER JOIN glpi_monitors ON glpi_computers_items.items_id = glpi_monitors.id AND glpi_computers_items.itemtype='Monitor'WHERE ...
Trouver la panne avant de réparer...
GLPI10.0.10 (ubuntu 22.04 PHP8.1 Mariadb10.6 ) plugins : comportements 2.7.2 reports 1.16.0 formcreator 2.13.8, datainjection 2.13.4 fields 1.21.6
Offline
Bonjour,
Ok encore un énorme merci.
Cordialement,
Prod : centos-release-7-2 | GLPI 9.4.3 | FusionInventory 9.4+1.1 | fusioninventory-agent_windows-x64_2.5.2
Test : centos-release-7-2 | GLPI 9.4.4 |
Rectorat de Caen
Offline
Pages: 1
Topic closed