:: Version 3.2.0 ::
Hide Impact Analyses or Dashboard tab
Prerequisite: You must be familiar with the Syntax used in Tutorials and have already created an extension.
- learning:
- Hide Impact Analyses tab on the Change class
- level:
- Beginner
- domains:
- PHP
- methods:
- DisplayBareRelations, iTopWebPage::RemoveTab
- min version:
- 2.3.0
Hide Impact Analyses on a class
With a simple PHP iTop extension, you can hide the tab
Impact analyses
from the details of the
Change object (or any other Ticket class).
- Change
-
public function DisplayBareRelations(WebPage $oPage, $bEditMode = false) { parent::DisplayBareRelations($oPage, $bEditMode); $oPage->RemoveTab('Ticket:ImpactAnalysis'); }
Hide a Dashboard on condition
You can hide an attribute dashboard depending on an object field value
Here we suppose that the Team class as a Dashboard attribute with code = 'dashboard' and we want to hide it based on a particular condition on a team field:
- Class:Team
-
public function DisplayBareRelations(WebPage $oPage, $bEditMode = false) { parent::DisplayBareRelations($oPage, $bEditMode); if ($this->Get('notify') === 'no') $oPage->RemoveTab('Class:Team/Attribute:dashboard'); }
The identifier of the tab is the same as the dictionary
entry:
-
Class:class_name/Attribute:attribute_code
Cautious it is case sensitive and the attribute code is usually lowercase
3_2_0/customization/hidetab.txt ยท
Last modified: 2024/08/13 09:54 (external edit)