InfotelGLPI / positions

Plugin positions for GLPI
http://blogglpi.infotel.com
GNU General Public License v2.0
17 stars 11 forks source link

Add Type and Model in Display Field #54

Open Yoken0S opened 3 years ago

Yoken0S commented 3 years ago

Hello,

First thanks for this plugin.

Secondly, is it possible to add the Type and Model of an item in the Display area please?

I read in previous issue that you didn't add all fields and that why it doesn't work ;)

Yoken0S commented 3 years ago

Hi,

If have a temporary solution for those like me wants these fields. Add this code in info.class.php in static function showFields right below the first if (empty($searchOption)) {

Code : if($field['Field'] == 'printertypes_id' || $field['Field'] == 'printermodels_id' || $field['Field'] == 'computertypes_id' || $field['Field'] == 'computermodels_id') { $searchOption["table"] = "glpi_" .substr($field['Field'],0,-3); if(preg_match('/types/', $field['Field'], $matches)) $searchOption["name"] = "Type"; elseif(preg_match('/models/', $field['Field'], $matches)) $searchOption["name"] = "Model"; }