0

I have been trying to add a new tab as displayed in the image. I'm working on iTop 2.4 Can Anyone explain to me how to do this?enter image description here

ThW
  • 16,962
  • 2
  • 18
  • 37
M. Nashath
  • 61
  • 4

1 Answers1

0

You have to create your own iTop extension and use the iApplicationUIExtension::OnDisplayRelations($oObject, WebPage $oPage, $bEditMode = false) API which provides you the current object so you can check its class and display the tab or not. It also gives you access to $oPage object so you can add your content to the tab.

If you are not familiar with iTop extension development, check this page which explains everything (note that it's for iTop 2.7 but the API is the same for iTop 2.4).

Here is an example from the "Approval process automation" extension:

class ApprovalBasePlugin implements iApplicationUIExtension, iApplicationObjectExtension
{
    ...

    public function OnDisplayRelations($oObject, WebPage $oPage, $bEditMode = false)
    {
        if (!$oObject instanceof Ticket)
        {
            // skip !
            return;
        }

        ...

        // Set the new tab name
        $oPage->SetCurrentTab(Dict::S('Approval:Tab:Title'));

        ...
 
        // Add content through the \WebPage APIs
        $oPage->add('<div id="'.$sId.'_status" class="approval-exec-status">');
        $oPage->add($oScheme->GetDisplayStatus($oPage, $bEditMode));
        $oPage->add('</div>');

        ...
    }

    ...
}
Molkobain
  • 1,169
  • 1
  • 10
  • 14