First, wishing everyone a happy and healthy new year !
I added some integer information on contract object.
I want to display them as a gauge on the home page but I don't find clue about adding custom PHP code on page.
If it is possible, could you help me to do it?
Kind regards,
Last edit: Kevin 2024-01-12
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Is that a custom type of brick that you made? If so, you can overload the TileAction() of your controller to return any HTML you'll like.
If that's a native manage brick, then you can take a look at the various "tile display mode" to see if it helps. Check this page, in the Bricks > ManagerBrick > display_modes > tile section.
Otherwise, you can't really do it natively. The only way would be to go for the first option I described.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I don't think so, it only count on the grouping (tabs) of the manage bricks :/
We could try to help you make your own custom brick which would derive from the native ManageBrick. Can you make a mock of what you are trying to do?
I saw in the previous screenshot that you pointed 2 columns, you would like the sum (for all objects) of these 2 columns to be displayed in the tile in the home page?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for your help.
I would like to create a gauge that display the usage of the units.
So the "Unités d'oeuvre totales" is the maximum amount and "Unités d'oeuvre consommées" is the current value.
In the screenshot of your second post (https://sourceforge.net/p/itop/discussion/customizing-itop/thread/f8fd7536e9/3899/attachment/contracts.png/thumb) there is a list of objects. So the gauge should be the sum of "UE consommées" / the sum of "UE totales" ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello to all,
First, wishing everyone a happy and healthy new year !
I added some integer information on contract object.
I want to display them as a gauge on the home page but I don't find clue about adding custom PHP code on page.
If it is possible, could you help me to do it?
Kind regards,
Last edit: Kevin 2024-01-12
Can you show a screenshot of the page where you'd want to show it, exactly?
I would like to add it on the home page, on the tile I added (in the red box for example)
Or on the brick I added, replacing the two list columns for example
Hello Kevin,
Is that a custom type of brick that you made? If so, you can overload the TileAction() of your controller to return any HTML you'll like.
If that's a native manage brick, then you can take a look at the various "tile display mode" to see if it helps. Check this page, in the Bricks > ManagerBrick > display_modes > tile section.
Otherwise, you can't really do it natively. The only way would be to go for the first option I described.
Thanks for your answer
It is a native ManageBrick, so I will look for display mode.
I see pie-chart but can I precise fields to use as data?
Kind regards,
I don't think so, it only count on the grouping (tabs) of the manage bricks :/
We could try to help you make your own custom brick which would derive from the native ManageBrick. Can you make a mock of what you are trying to do?
I saw in the previous screenshot that you pointed 2 columns, you would like the sum (for all objects) of these 2 columns to be displayed in the tile in the home page?
Hello,
Thanks for your help.
I would like to create a gauge that display the usage of the units.
So the "Unités d'oeuvre totales" is the maximum amount and "Unités d'oeuvre consommées" is the current value.
If possible like on the attachment
Kind regards,
Thanks for the details.
In the screenshot of your second post (https://sourceforge.net/p/itop/discussion/customizing-itop/thread/f8fd7536e9/3899/attachment/contracts.png/thumb) there is a list of objects. So the gauge should be the sum of "UE consommées" / the sum of "UE totales" ?
No, I want a gauge for each contract found, one line by contract and one gauge with values as is for each.
You can't really put a custom display in these lists.
But you could add a custom
AttributePercentage
to your class and update its value when the object is updated through theComputeValues
method.This won't require a custom portal brick, just to alter the datamodel to add your attribute to the class and to display it in the portal.
OK Thanks :) Can I display this percentage with a gauge?
Or can I just add a custom page with my own PHP code?
Last edit: Kevin 2024-01-15
Kinda, it will be an horizontal gauge, but you can't display it as an "arc" like in your screenshot.
Find for me :) Gauge was the "best" but bar will be okay ;)
Thank you for your help :)
Great, hope you make it work :)
So, I try this solution with this :
and this :
Problem is that the consumed_work_units does not update when I change the used_work_units...
Did I do something wrong?
Last edit: Kevin 2024-01-15
Good news, it works, I just forgot to add the define delta :)
Great! Glad to see you made it works :)
Could you share a screenshot to inspire others?
Screenshots in attachments :)
Great, thanks for sharing the results!
Take care,
Guillaume