-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
New hook : enable choosing the icon of an item in impact analysis #17141
base: main
Are you sure you want to change the base?
New hook : enable choosing the icon of an item in impact analysis #17141
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just completing/altering $CFG_GLPI["default_impact_asset_types"]
?
I'm not sure a hook is necessary here
It would be possible to change it in the plugin setup.php file by getting the request parameters, however I feel like having a dedicated hook make things clearer. Adding to that, I was thinking of modifying ajax/impact.php & impact.js so that the icons shown in the search result sidebar go through the same treatment, so that the search preview would match the actual icons which will be loaded. |
Hello Alexandre. This hook permets to define icons for specific types (example : Firewall, Router, Wifi access point) and not only define icons for an global itemtype (as picture for models of objects) |
Indeed, it may permit to define a specific icon for each different item. As it introduces extra queries (each displayed item is loaded, and impact graph may contains many items, it would be preferable to pass the |
I changed the target to main branch, as it introduces a new feature. |
…onDBTM instance loaded from DB
Updated the code accordingly : the hook is moved with the ones expecting an array as parameters, and the array contains the keys 'itemtype' and 'items_id' (0 in case of the default icon for the sidebar). |
Add a new hook to enable changing the icon of an item in the impact anlysis.