Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Type and Model in Display Field #54

Open
Yoken0S opened this issue Mar 19, 2021 · 1 comment
Open

Add Type and Model in Display Field #54

Yoken0S opened this issue Mar 19, 2021 · 1 comment

Comments

@Yoken0S
Copy link

Yoken0S commented Mar 19, 2021

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
Copy link
Author

Yoken0S commented Apr 9, 2021

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"; }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant